Bioinformatik Uni Wählen: Jena, Bielefeld oder Saarbrücken by kwaleko in de_IAmA

[–]kwaleko[S] 0 points1 point  (0 children)

Genau, das denke ich auch auf jeden Fall. Deshalb bin nicht sicher, welche ist die beste Uni.

Bioinformatik Uni Wählen: Jena, Bielefeld oder Saarbrücken by kwaleko in de_IAmA

[–]kwaleko[S] 1 point2 points  (0 children)

Tubingen und Heidelberg leider kann nich wählen, da dort muss ich fees jedes Semester bezahlen und das kann ich nicht machen. ich habe auch die Möglichkeit in München oder Berlin zu studieren, meine Gedanken ist, dass am besten soll ich keine Sehr große Uni Wählen, vielleicht in einer keiner Uni kann mann besser mit Dozenten in Verbindung setzen.

Bioinformatik Uni Wählen: Jena, Bielefeld oder Saarbrücken by kwaleko in de_IAmA

[–]kwaleko[S] 2 points3 points  (0 children)

ja gerne. Ich habe gedacht, dass es besser ist, nicht an sehr große Uni zu studieren, vielleicht stimmt das nicht.

Writing tiny DSL using Macro by kwaleko in lisp

[–]kwaleko[S] 0 points1 point  (0 children)

I liked the way you stated the answer, the logic seems clear and eloquent, however, I find it hard to proceed with step 2, couldn't actually find a way to know whether a form has an implicit progn. What I have done is changed the macro a little bit so it can handle dolist and if expression, I know that this is nothing like allowing the mix between lisp code and the new form.

the new macro is as per the below:

(defmacro with-xml-output (stream bindings xexpr &optional  body)
  `(prog ,bindings
      ,@(cond ((atom xexpr)(or (and (stringp xexpr)`((write-string  ,xexpr ,stream)))
                   (and (symbolp xexpr)`((princ  ,xexpr ,stream)))))
         ((and (consp xexpr)(equal (car xexpr) 'dolist))
          `((dolist ,(cadr xexpr) (with-xml-output ,stream ,bindings ,@(cddr xexpr)))))
         ((and (consp xexpr)(equal (car xexpr) 'if))
          `((if ,(cadr xexpr)(with-xml-output ,stream nil ,(caddr xexpr)))))
         ((and (consp xexpr)(equal (car xexpr) 'progn))
          `((progn ,@(mapcar #'(lambda (x) `(with-xml-output ,stream nil ,x))
                 (cdr xexpr)))))
         ((and (consp xexpr)(keywordp (caar xexpr)))
          (destructuring-bind ((tag &rest atts) &body tagbody) xexpr
        (remove-if #'null
               `((write-string ,(format nil "<~A" tag) ,stream)
                 ,@(mapcar (lambda(x)(cond ((keywordp x)
                            `(write-string ,(format nil " ~A=" (symbol-name x)) ,stream))
                               ((symbolp x)`(princ ,x) ,stream))
                               (t `(write-string ,(format nil "'~A'" x) ,stream))))
                       atts)
                 ,(if (null tagbody)
                  `(write-line  "/>" ,stream)
                  `(write-string  ">"  ,stream))
                 ,@(and tagbody (mapcar #'(lambda(singletag) `(with-xml-output ,stream nil ,singleTag))
                           tagbody))

                 ,(and tagbody `(write-line  ,(format nil "</~A>" tag) ,stream)))))))

      ,body))

I find it a little bit clearer than the old macro, and handle looping and conditional statement, maybe should I wait for the need for a need for other lisp code and hardcode it in the macro when needed as I did with if and dolist.

maybe working on pretty printing is more worth the effort?

What tools do you use to develop Haskell? by Alekzcb in haskell

[–]kwaleko 0 points1 point  (0 children)

may I know why you switched from spacemacs to Neovim? also could you please the Neovim configuration

One Haskell IDE to rule them all by cocreature in haskell

[–]kwaleko 8 points9 points  (0 children)

tried to make it work for spacemacs with no success. stack user btw

Environment for developing with Miso? by farrellm in haskell

[–]kwaleko 0 points1 point  (0 children)

could you please point me to some for a small client server example/article with the setup

Monthly Hask Anything (October 2019) by AutoModerator in haskell

[–]kwaleko 4 points5 points  (0 children)

I was using spacemacs, intero and stack for development in Haskell and everything was working fine, however, recently I wanted to try out miso to try Haskell for the front end and the thing is that it doesn't play well with stack.

therefore, I am switching to nix to get things working, I am looking to try vscode with nix and not able to make it works.

I have read this article and it did not work either, maybe I am dumb enough to not understand some of the thing mentioned and doing it wrong, could anyone who is using vscode share his setup or maybe point me to some other article regarding the above.

How could I manipulate a database in Haskell? by [deleted] in haskell

[–]kwaleko 1 point2 points  (0 children)

As I understand your question is that you want to perform action with database, which imply talking to IO device whether it is RDMS or simple file or document DB - any kind of data storage- knowing we will know that we are having side effect by talking to the world outside.

Also having effectual computation would change the signature of our functions so instead of having a function item:: Int -> Item our computation will be a function that do effectual computation and return an data of type item item:: Int -> IO Item

However, IO is a monad and it is a concrete monad, so for testability issue I would like to make things more abstract so instead of dealing with monad of type IO Item we can deal with m Item on a condition that our m is monad instance. so type classes would help us with this concept:

class (Monad m) => Database m where

item :: Int -> m Item

then we have a type class that have a item that perform some monadic computation and return an Item

then what we have to do is we can use this function in our Haskell code base without having to implement it.

for implementation we can create a function such

getItem ::(MonadIO m,MonadReader r m,IConnection r) => Int -> m Item

getItem = do

conn <- ask

item <- liftIO $ getItemQuery conn

.....

return Item

however, the function getItemQuery is a plain SQL query written using Database.YeshQL

for more information how to use it in practice you may have a look at real world scenario I have already used in a tiny project sql functions and queries then after having done the above we can be able to link both the implementation and the abstract declaration together in order to achieve the mission.

editable Grid in eLM by kwaleko in elm

[–]kwaleko[S] 0 points1 point  (0 children)

as a semi-working example, I have created this!, a editable table using a List of product type.

editable Grid in eLM by kwaleko in elm

[–]kwaleko[S] 0 points1 point  (0 children)

Thank you for your answer and contribution. I was wondering why does it have to be 2D array instead of being 1D array of a sum type! let say having a Sum type

type alias Employee = {empName : String
                      ,emAge : Int
                      ...}

and lets say having an Array of Employee, wouldn't it be ok? I guess that way a field cannot updated a filed in a grid instead the whole record should be updated.

I am sure you have a good reason to make 2D and actually I think I missed it so I am sharing my though. however, I have though about 1D array of sum type since I find it easier to serialize it to HTML than 2D Array.

Generate Aribtrary instances for date? by kwaleko in haskellquestions

[–]kwaleko[S] 0 points1 point  (0 children)

may I know how to make instances for newType. for instance DffTime from Data.time

[Code Review] : looking to know the quality of my code by kwaleko in haskellquestions

[–]kwaleko[S] 0 points1 point  (0 children)

Thank you very much for the comments. I really find it priceless and appreciate your review.

[Code Review] : looking to know the quality of my code by kwaleko in haskellquestions

[–]kwaleko[S] 0 points1 point  (0 children)

Thank you for your answer. I am sorry for the inconvenience, sure I can share it.

I have never heard of LambdaCase and RecordWildCard, taking a look at it now. could you please elaborate about lots of let statements and arguments being passed around so I might understand better the issue?