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.
Instances11Arrow, …
Applicative f => Arrow (Static f)Defined in semigroupoids-6.0.1 · Data.Semigroupoid.StaticMonad m => Arrow (Kleisli m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowArrow p => Arrow (Closure p)Defined in profunctors-5.6.3 · Data.Profunctor.ClosedArrow p => Arrow (Tambara p)Defined in profunctors-5.6.3 · Data.Profunctor.StrongComonad w => Arrow (Cokleisli w)Defined in comonad-5.0.9 · Control.ComonadArrow (->)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowArrow p => Arrow (WrappedProfunctor p)Defined in invariant-0.6.4 · Data.Functor.InvariantArrow p => Arrow (WrappedArrow p)Defined in profunctors-5.6.3 · Data.Profunctor.Types(Arrow p, Arrow q) => Arrow (Product p q)Defined in bifunctors-5.6.2 · Data.Bifunctor.Product(Applicative f, Arrow p) => Arrow (Tannen f p)Defined in bifunctors-5.6.2 · Data.Bifunctor.Tannen(Applicative f, Arrow p) => Arrow (Cayley f p)Defined in profunctors-5.6.3 · Data.Profunctor.Cayley