[Haskell-cafe] Arrow transformers: how to make them wright?
permeakra at gmail.com
Tue Aug 31 14:07:38 EDT 2010
A Control.Arrow in base package introduces an arrow type, and ghc have
good support for arrow notation. Many things, avaible in monads, are
avaible in arrows as well. There is an arrows package, that introduces
some arrow classes : state, reader, writer and so on. However, it does
not introduce systematic lifting of arrow classes operations.
Arrows are generalisation of monads. There are libraries, that
introduces systematic lifting of operations from monad classes.
So, the quesions are:
what operations should be in arrow transformer class? Captain Obvious
says, it should look at least like:
class ArrowTrans t where
lift :: ( Arrow a, Arrow (t a) ) => a b c -> t a b c
what laws arrow transformers must obey? C.O. says, at least
lift a b c >>> lift a c d == lift ( a b c >> a c d )
how to perform lifting of actions for classes like this:
class Arrow a => ArrowError a e| a-> e where
raise :: a e ()
handle :: a e c -> a b c -> a b c
class Arrow a => ArrowReader a e | a -> e where
look :: a () e
local :: a b c -> a (b,e) c
The answers lies somewhere in category theory, C.O. says. Of course,
such answer is not satisfactory.
More information about the Haskell-Cafe