Hacker News new | past | comments | ask | show | jobs | submit login
Combinator birds in Clojure (github.com/fogus)
32 points by llambda on April 16, 2012 | hide | past | favorite | 5 comments



A relevant read is To Dissect a Mockingbird: A Graphical Notation for the Lambda Calculus with Animated Reduction at http://dkeenan.com/Lambda/index.htm


Another good read is An Introduction to Functional Programming Through Lambda Calculus, http://www.macs.hw.ac.uk/~greg/books/


Some of the comparisons to Haskell were in error. I submitted a pull request that fixed them.


Thank you for that. I will now find out the real implementations of Haskell's pure, <$>, and join.


Well, here's the type signatures for each:

    pure (== return) :: (Applicative f) => a -> f a
    <$> (== fmap) :: (Functor f) => (a -> b) -> (f a -> f b)
    join :: (Monad m) => m (m a) -> m a
All of these are polymorphic, and example in the case of lists would be

    pure x = [x]
    odd <$> [1,2,3] == [True, False, True]
    join [[1,2], [3], [4,5]] = [1,2,3,4,5]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: