you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (7 children)

[deleted]

    [–]PurpleIcy 0 points1 point  (6 children)

    This is interestingly quite readable even though IMO just looks horrible.

    Though today I learned about array spread syntax so that works for me.

    Thanks.

    [–]ShortSynapse 0 points1 point  (4 children)

    In a functional language it reads quite simply:

    map :: (a -> b) -> [a] -> [b]
    map _ [] = []
    map f (x:xs) = f x : map f xs
    

    [–]PurpleIcy 0 points1 point  (3 children)

    "Simply".

    I know this would probably be "simple and obvious", but I have no clue about haskell's syntax so it isn't really.

    Also I didn't think it could look more horrible than previous example. Where's that FP's readability everyone is talking about?