Name: Anonymous 2009-03-30 21:01
http://www.reddit.com/r/programming/comments/88oln/factor_makes_you_write_better_code/
Where is your LISP now?
Where is your LISP now?
fibs = loeb $ const 0 : const 1 : map (((sum . take 2) .) . drop) [0..]
primes = loeb $ const Nothing : const Nothing : const (Just 2) : const (Just 3) : map (flip flip Nothing . ap (flip . (if' .) . ap ((.) . all . ((0 /=) .) . mod) ((. catMaybes) . takeWhile . (. join (*)) . flip (<=))) Just) [3, 5..]