[Haskell-cafe] Question about arrows
Bryan Burgers
bryan.burgers at gmail.com
Sat Aug 4 02:01:57 EDT 2007
On 8/3/07, Lewis-Sandy, Darrell <darrelll at amgen.com> wrote:
>
> Is there a class property of the Control.Arrow class that represents the
> evaluatation of an arrow:
>
> eval :: (Arrow a)=>a b c->b->c
>
You could always use the ArrowEval class. Granted, it doesn't exist,
so you'd have to write it, but it should serve your purposes.
class ArrowEval a where
eval :: a b c -> b -> c
instance ArrowEval (->) where
eval = ...
instance ArrowEval YourPartial where
eval = ...
(That's off the cuff, so I probably didn't get the syntax correct.)
Does that fit your problem? But like Mr. Morris said, eval isn't valid
for every arrow, so you can only define instances of ArrowEval where
it is valid.
Bryan
More information about the Haskell-Cafe
mailing list