[Haskell-cafe] Is ([] -> []) an arrow?
Chad Scherrer
chad.scherrer at gmail.com
Wed Mar 21 15:18:38 EDT 2007
In John Hughes's "Programming With Arrows"
(http://www.cs.chalmers.se/~rjmh/afp-arrows.pdf), he discusses a
"stream function" type
newtype SF a b = SF {runSF :: [a] -> [b]}
and gives
instance Arrow SF where ....
He gives some examples using this, and everything seems to go just fine.
But in Ross Patterson's "Arrows and Computation"
(http://www.soi.city.ac.uk/~ross/papers/fop.html), he says that
newtype ListMap i o = LM ([i] -> [o])
is ALMOST an arrow.
Now, I've heard (but never verified) that IO fails to satisfy some
monad laws, yet here we are, using it as a monad. Is a similar kind of
thing going on here? Has anyone hit any snags in using this instance?
Thanks,
Chad
More information about the Haskell-Cafe
mailing list