Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- toCCC :: forall {k} (a :: FK k) (b :: FK k). (BiCCC k, Ob a, Ob b) => ((TermF :: FK k) ~> (a --> b)) -> FromFree a ~> FromFree b
- lam :: forall {k} (a :: k) (b :: k) (i :: k). (CCC k, Ob i, Ob a, Ob b) => ((forall (x :: k). Cast x (i && a) => x ~> a) -> (i && a) ~> b) -> i ~> (a ~~> b)
- ($) :: forall {k} (i :: k) (a :: k) (b :: k). (CCC k, Ob b) => (i ~> (a ~~> b)) -> (i ~> a) -> i ~> b
- lift :: forall {k} (i :: k) (a :: k) (b :: k). CCC k => (a ~> b) -> (i ~> a) -> i ~> b
- pattern (:&) :: forall {k} (i :: k) (a :: k) (b :: k). (CCC k, Ob a, Ob b) => (i ~> a) -> (i ~> b) -> i ~> (a && b)
- left :: forall {k} (a :: k) (b :: k) (i :: k). (HasBinaryCoproducts k, Ob a, Ob b) => (i ~> a) -> i ~> (a || b)
- right :: forall {k} (a :: k) (b :: k) (i :: k). (HasBinaryCoproducts k, Ob a, Ob b) => (i ~> b) -> i ~> (a || b)
- either :: forall {k} (a :: k) (b :: k) (c :: k) (i :: k). (HasBinaryCoproducts k, CCC k, Ob a, Ob b, Ob c) => (i ~> (a ~~> c)) -> (i ~> (b ~~> c)) -> i ~> ((a || b) ~~> c)
- data FreeCCC (a :: FK k) (b :: FK k)
- data family InitF :: k
- data family TermF :: k
- data family (a :: k) * (b :: k) :: k
- data family (a :: k) + (b :: k) :: k
- data FK k = F k
Documentation
toCCC :: forall {k} (a :: FK k) (b :: FK k). (BiCCC k, Ob a, Ob b) => ((TermF :: FK k) ~> (a --> b)) -> FromFree a ~> FromFree b Source Comments #
Adapted from Phil Freeman: https://blog.functorial.com/posts/2017-10-08-HOAS-CCCs.html
lam :: forall {k} (a :: k) (b :: k) (i :: k). (CCC k, Ob i, Ob a, Ob b) => ((forall (x :: k). Cast x (i && a) => x ~> a) -> (i && a) ~> b) -> i ~> (a ~~> b) Source Comments #
($) :: forall {k} (i :: k) (a :: k) (b :: k). (CCC k, Ob b) => (i ~> (a ~~> b)) -> (i ~> a) -> i ~> b Source Comments #
lift :: forall {k} (i :: k) (a :: k) (b :: k). CCC k => (a ~> b) -> (i ~> a) -> i ~> b Source Comments #
pattern (:&) :: forall {k} (i :: k) (a :: k) (b :: k). (CCC k, Ob a, Ob b) => (i ~> a) -> (i ~> b) -> i ~> (a && b) Source Comments #
left :: forall {k} (a :: k) (b :: k) (i :: k). (HasBinaryCoproducts k, Ob a, Ob b) => (i ~> a) -> i ~> (a || b) Source Comments #
right :: forall {k} (a :: k) (b :: k) (i :: k). (HasBinaryCoproducts k, Ob a, Ob b) => (i ~> b) -> i ~> (a || b) Source Comments #
either :: forall {k} (a :: k) (b :: k) (c :: k) (i :: k). (HasBinaryCoproducts k, CCC k, Ob a, Ob b, Ob c) => (i ~> (a ~~> c)) -> (i ~> (b ~~> c)) -> i ~> ((a || b) ~~> c) Source Comments #
F k |
Instances
BiCCC k => Monoidal (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC
leftUnitor :: forall (a :: FK k). Ob a => ((Unit :: FK k) ** a) ~> a Source Comments # leftUnitorInv :: forall (a :: FK k). Ob a => a ~> ((Unit :: FK k) ** a) Source Comments # rightUnitor :: forall (a :: FK k). Ob a => (a ** (Unit :: FK k)) ~> a Source Comments # rightUnitorInv :: forall (a :: FK k). Ob a => a ~> (a ** (Unit :: FK k)) Source Comments # associator :: forall (a :: FK k) (b :: FK k) (c :: FK k). (Ob a, Ob b, Ob c) => ((a ** b) ** c) ~> (a ** (b ** c)) Source Comments # associatorInv :: forall (a :: FK k) (b :: FK k) (c :: FK k). (Ob a, Ob b, Ob c) => (a ** (b ** c)) ~> ((a ** b) ** c) Source Comments # | |||||
BiCCC k => CategoryOf (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
BiCCC k => HasBinaryCoproducts (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC lft :: forall (a :: FK k) (b :: FK k). (Ob a, Ob b) => a ~> (a || b) Source Comments # lft' :: forall (a :: FK k) (a' :: FK k) (b :: FK k). (a ~> a') -> Obj b -> a ~> (a' || b) Source Comments # rgt :: forall (a :: FK k) (b :: FK k). (Ob a, Ob b) => b ~> (a || b) Source Comments # rgt' :: forall (a :: FK k) (b :: FK k) (b' :: FK k). Obj a -> (b ~> b') -> b ~> (a || b') Source Comments # (|||) :: forall (x :: FK k) (a :: FK k) (y :: FK k). (x ~> a) -> (y ~> a) -> (x || y) ~> a Source Comments # (+++) :: forall (a :: FK k) (b :: FK k) (x :: FK k) (y :: FK k). (a ~> x) -> (b ~> y) -> (a || b) ~> (x || y) Source Comments # | |||||
BiCCC k => HasBinaryProducts (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC fst :: forall (a :: FK k) (b :: FK k). (Ob a, Ob b) => (a && b) ~> a Source Comments # fst' :: forall (a :: FK k) (a' :: FK k) (b :: FK k). (a ~> a') -> Obj b -> (a && b) ~> a' Source Comments # snd :: forall (a :: FK k) (b :: FK k). (Ob a, Ob b) => (a && b) ~> b Source Comments # snd' :: forall (a :: FK k) (b :: FK k) (b' :: FK k). Obj a -> (b ~> b') -> (a && b) ~> b' Source Comments # (&&&) :: forall (a :: FK k) (x :: FK k) (y :: FK k). (a ~> x) -> (a ~> y) -> a ~> (x && y) Source Comments # (***) :: forall (a :: FK k) (b :: FK k) (x :: FK k) (y :: FK k). (a ~> x) -> (b ~> y) -> (a && b) ~> (x && y) Source Comments # | |||||
BiCCC k => Closed (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC curry' :: forall (a :: FK k) (b :: FK k) (c :: FK k). Obj a -> Obj b -> ((a ** b) ~> c) -> a ~> (b ~~> c) Source Comments # uncurry' :: forall (b :: FK k) (c :: FK k) (a :: FK k). Obj b -> Obj c -> (a ~> (b ~~> c)) -> (a ** b) ~> c Source Comments # (^^^) :: forall (b :: FK k) (y :: FK k) (x :: FK k) (a :: FK k). (b ~> y) -> (x ~> a) -> (a ~~> b) ~> (x ~~> y) Source Comments # | |||||
BiCCC k => HasInitialObject (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC
| |||||
BiCCC k => HasTerminalObject (FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC
| |||||
BiCCC k => Promonad (FreeCCC :: FK k -> FK k -> Type) Source Comments # | |||||
BiCCC k => MonoidalProfunctor (FreeCCC :: FK k -> FK k -> Type) Source Comments # | |||||
BiCCC k => Profunctor (FreeCCC :: FK k -> FK k -> Type) Source Comments # | |||||
type UN ('F :: j -> FK j) ('F a :: FK j) Source Comments # | |||||
type Unit Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type (~>) Source Comments # | |||||
type InitialObject Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type TerminalObject Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type Ob (a :: FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type (a :: FK k) ** (b :: FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type (a :: FK k) || (b :: FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type (a :: FK k) && (b :: FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC | |||||
type (a :: FK k) ~~> (b :: FK k) Source Comments # | |||||
Defined in Proarrow.Helper.CCC |