[Haskell-cafe] Trapped by the Monads
Mark Carter
mcturra2000 at yahoo.co.uk
Tue Sep 20 14:41:21 EDT 2005
Mark Carter wrote:
> What struck me was this bit of code:
>
> assemblyLine w = (return w) >>= makeChopsticks >>= polishChopsticks
> >>= wrapChopsticks
>
>
> Interestingly, this looks like Forth (!), where you put a value on the
> stack, and successive operations fiddle with the stack as a series of
> transformations. Not that I know Forth, you understand. Hmm, so
> Haskell can be a concatenative language if you want it to be.
Another thing I noticed in my nano-experience of Haskell is the Maybe
monad. This is interesting because it's a bit like a hybrid variables.
If you look at a book like "Writing Solid Code" (or is it "Code
Complete", I can't remember now) which examine C style, they basically
scorn the use of hybrid variables. However, I read in something like
"Thinking Forth" (or maybe it was just a comment I saw atrributed to
Charles Moore, the inventor of Forth), who actually advocated hybrid
variables.
It would be interesting to see how far the notion of "Haskell as Forth"
can go. Can Haskell make a better Forth than Forth can, or does it miss
some things which are quite natural in Forth.
___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
More information about the Haskell-Cafe
mailing list