[Haskell-cafe] Why?

David Leimbach leimy2k at gmail.com
Thu Dec 10 20:34:21 EST 2009

> >> 2b. You can define brand new flow control constructs *inside* the
> language
> >> itself. (E.g., in Java, a "for" loop is a built-in language construct.
> In
> >> Haskell, "for" is a function in Control.Monad. Just a plain ordinary
> >> function that anybody could write.)
> >>
> >
> > Psst, heard about Scheme & call/cc?
> But, very importantly, purity allows you to *restrict* the flow
> constructs that client code has available.  If you have continuations
> + mutable state you can do anything, but the more code can *do*, the
> less you *know* about it.  For example, providing parser combinators
> as an applicative functor offers more power than a traditional parser
> generator, but not enough that we can no longer parse efficiently.

Exactly my fear over unsafePerformIO in 3rd party Haskell libraries :-).

One can present an interface in Haskell that looks safe, but it can be very
unsafe in its implementation.


> Luke
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091210/53816f35/attachment.html

More information about the Haskell-Cafe mailing list