The basic arrow class.
Instances should satisfy the following laws:
arr id = idarr (f >>> g) = arr f >>> arr gfirst (arr f) = arr (first f)first (f >>> g) = first f >>> first gfirst f >>> arr fst = arr fst >>> ffirst f >>> arr (id *** g) = arr (id *** g) >>> first ffirst (first f) >>> arr assoc = arr assoc >>> first f
where
assoc ((a,b),c) = (a,(b,c))The other combinators have sensible default definitions, which may be overridden for efficiency.
Methods
arr :: (b -> c) -> a b cLift a function to an arrow.
first :: a b c -> a (b, d) (c, d)Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
second :: a b c -> a (d, b) (d, c)A mirror image of first.
The default definition may be overridden with a more efficient version if desired.
(***) :: a b c -> a b' c' -> a (b, b') (c, c')infixr 3Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(&&&) :: a b c -> a b c' -> a b (c, c')infixr 3Fanout: send the input to both argument arrows and combine their output.
The default definition may be overridden with a more efficient version if desired.
Instances6Arrow
Arrow IOLADefined in hxt-9.3.1.22 · Control.Arrow.IOListArrowArrow LADefined in hxt-9.3.1.22 · Control.Arrow.ListArrowMonad m => Arrow (Kleisli m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowArrow (IOSLA s)Defined in hxt-9.3.1.22 · Control.Arrow.IOStateListArrowArrow (SLA s)Defined in hxt-9.3.1.22 · Control.Arrow.StateListArrowArrow (->)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow