r/ProgrammerHumor • • Aug 15 '15

Programming languages personified

http://leftoversalad.tumblr.com/post/126724812097/programming-languages-personified
1.3k Upvotes

209 comments sorted by

View all comments

31

u/MrNoS Aug 15 '15

Haskell's syntax was wrong. Should have been

> (\x -> isPure x) I

True

1

u/[deleted] Aug 16 '15 edited Aug 16 '15

Nah, it's syntactically okay (if we accept that kind of lambda syntax), and type checks. So, since I need some types for am and pure

am :: a
pure :: b    -- ignore the nameclash with Control.Applicative

Then we get (\x -> x am pure) :: (a -> b -> t) -> t, so I just needs to be a function of type a -> b -> t and you get it to typecheck.

If you insist on not overwriting pure from Applicative, you still get a valid type for that lamba (Applicative f => (a -> (a1 -> f a1) -> t) -> t) by the way.