[Haskell] Help on Arrows
Georg Martius
mai99dgf at studserv.uni-leipzig.de
Sat Jan 15 16:33:09 EST 2005
Hi folks,
I would like to use Arrows, but I just can't figure out how to actually use them.
I looked at various documentations including the API doc [1], the Wiki [2], [3], and some random pages on the net but didn't find a single simple example that tells me how to apply an Arrow to a value.
Assume I have the extremly simple arrow such as:
> MyAdd1A :: (Arrow a, Num b) => a b b
> MyAdd1A = arr (\ x -> x + 1 )
I am probably totally wrong, buy I look for something like evaluateArrow with the type:
> evaluateArrow :: (Arrow a) => a b c -> b -> c
to use it like:
> main = do let x = evaluateArrow $ MyAdd1A 1
> print x
Please enlighten me!
Georg
[1] http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control.Arrow.html#2
[2] http://haskell.org/hawiki/UnderstandingArrows
[3] http://www.haskell.org/arrows/
--
---- Georg Martius, Tel: (+49 34297) 89434 ----
------- http://www.flexman.homeip.net ---------
More information about the Haskell
mailing list