[Haskell] ListMap example

jeff polakow jp at capoeira.scitec.kobe-u.ac.jp
Thu Aug 12 01:16:05 EDT 2004


Hello,

  Why is the following not an arrow?

newtype ListMap i o = LM ([i] -> [o]
instance Arrow ListMap where
  pure f = LM (map f)
  LM f >>> LM g = LM (g . f)
  first (LM f) = LM ((uncurry zip) . (cross f id) . unzip)

thanks,
  Jeff


More information about the Haskell mailing list