Re:Functional programming, APL and UNIX pipes
by yummyfajitas on Sunday May 23, 2010 @06:51PM
(#1373239)
Haskell does. Roughly the author's example using monads:
The only thing you can't directly do with monads is the fold, since the fold breaks you out of the monad. Also, you could use arrows:
Then myCounter [ [10..20], [50..60]] is the function you want.
[ Parent
| on HN ]
Re:Functional programming, APL and UNIX pipes
by yummyfajitas on Monday May 24, 2010 @10:32AM
(#1374702)
Actually, just realized you can do everything with monads.
(return [[10..20], [50..100]] >>= concat >>= classify >>= foldr getCount (0,0,0))
Just use the identity monad rather than the list monad.