
6 Jul
2011
6 Jul
'11
9:04 a.m.
Hi! Is it possible to define an Arrow instance of list to list functions? Something like import Control.Arrow import Control.Category type X a b = [a] -> [b] instance Category X where id = map Prelude.id g . f = g Prelude.. f instance Arrow X where arr f = map f first f = unzip >>> first f >>> uncurry zip The problem is that it's not allowed to use partially applied type synonyms. It is however possible to define a type synonym which value is a partially applied type, but I haven't been able to figure out if I could somehow use that fact in defining the X... Is it at all possible, or is a newtype the only way to do it? -- Markus Läll