leimy2k at gmail.com
Thu Dec 10 20:34:21 EST 2009
> >> 2b. You can define brand new flow control constructs *inside* the
> >> itself. (E.g., in Java, a "for" loop is a built-in language construct.
> >> 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.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe