Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Arrow

Lean: Hale.Base.Arrow | Haskell: Control.Arrow

Overview

Arrow abstraction for generalized function-like computations. Extends Category with lifting and product/sum operations.

API Mapping

LeanHaskellKind
Arrow classArrowTypeclass
arrarrMethod
firstfirstMethod
secondsecondMethod
split(***)Method
ArrowChoice classArrowChoiceTypeclass
leftleftMethod
rightrightMethod
fanin`(

Instances

  • Arrow Fun
  • ArrowChoice Fun

Proofs & Guarantees

None listed (laws follow from LawfulCategory and the arrow laws).

Example

-- Lift a pure function into the Arrow
(Arrow.arr (Cat := Fun) (· * 2)).apply 3
-- => 6