[Haskell-cafe] Practical Haskell question.

Benja Fallenstein benja.fallenstein at gmail.com
Mon Jun 25 05:06:07 EDT 2007

Hi Peter,

2007/6/25, peterv <bf3 at telenet.be>:
> I'm baffled. So using the Arrow abstraction (which I don't know yet) would
> solve this problem? How can (perfectActionB x) be checked with without ever
> executing performActionA which evaluates to x? This can only be done when x
> is a constant expression no?

Arrows separate the action -- 'performActionB' -- from the argument --
'x', so you can look at the action before you have to compute the
argument to it. Of course, this means that you can no longer compute
the action from the argument -- that is, 'if x then performActionB
else performActionC' is something you can't directly do; you have to
use a choice primitive instead, which explicitly says "use one of
these two arrows depending on what value this argument is," which then
lets the library check these two arrows before actually applying them
to an argument.

- Benja

More information about the Haskell-Cafe mailing list