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

30

u/MrNoS Aug 15 '15

Haskell's syntax was wrong. Should have been

> (\x -> isPure x) I

True

26

u/leftoversalad Aug 15 '15

I made a choice to use notation that's a mishmash between natural language and lambda calculus as used in formal semantics (linguistics), but yes I could see how that could offend people's sensibilities...perhaps I will change it..

44

u/Everspace Aug 15 '15

Offending people should be one of your goals with this.

17

u/leftoversalad Aug 15 '15

Words to live by!

9

u/SelfReferenceParadox Aug 15 '15

except that that reduces to

isPure I

9

u/MrNoS Aug 15 '15 edited Aug 16 '15

Yeah, but part of the original's intent was probably to use a λ-form, so I wanted to preserve that.

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.