HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulefirst-class-families-0.8.1.0Haskell2010

Fcf.Data.Function

Simple combinators for functions.

  • 3 types
datadata (&) (c :: a) (d :: a -> Exp b) (e :: b)
#

Reverse function application, argument first.

Example
Example1 expression
:kind! Eval ('(True, Nothing) & Fst)Eval ('(True, Nothing) & Fst) :: Bool= True
Instances1Eval
  • type Eval (x & f) = Eval (f x)Defined in first-class-families-0.8.1.0 · Fcf.Data.Function
datadata On (d :: b -> b -> Exp c) (e :: a -> Exp b) (f :: a) (g :: a) (h :: c)
#

Lift a binary function to the domain of a projection.

Example
Example1 expression
:kind! Eval (((&&) `On` Fst) '(True, Nothing) '(False, Just '()))Eval (((&&) `On` Fst) '(True, Nothing) '(False, Just '())) :: Bool= False
Instances1Eval
  • type Eval (On r f x y) = Eval (r (Eval (f x)) (Eval (f y)))Defined in first-class-families-0.8.1.0 · Fcf.Data.Function
datadata Bicomap (f :: a -> Exp c) (g :: b -> Exp d) (h :: c -> d -> Exp e) (i :: a) (j :: b) (k :: e)
#

Pre-compose a binary function with a function for each argument.

Example
Example1 expression
:kind! Eval (Bicomap Fst Pure (||) '(False, Nothing) True)Eval (Bicomap Fst Pure (||) '(False, Nothing) True) :: Bool= True
Instances1Eval
  • type Eval (Bicomap f g r x y) = Eval (r (Eval (f x)) (Eval (g y)))Defined in first-class-families-0.8.1.0 · Fcf.Data.Function