| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Object
Description
Synopsis
- type Obj (a :: k) = a ~> a
- pattern Obj :: forall k (a :: k). CategoryOf k => Ob a => Obj a
- pattern Objs :: forall {j} {k} p (a :: k) (b :: j). Profunctor p => (Ob a, Ob b) => p a b
- obj :: forall {k} (a :: k). (CategoryOf k, Ob a) => Obj a
- src :: forall {j} {k} (a :: k) (b :: j) p. Profunctor p => p a b -> Obj a
- tgt :: forall {k1} {k2} (a :: k2) (b :: k1) p. Profunctor p => p a b -> Obj b
- class (Ob a, CategoryOf k) => Ob' (a :: k)
- class (CategoryOf k, forall (a :: k). Ob' a) => VacuousOb k
- objDicts :: forall {k1} {k2} p (a :: k2) (a' :: k1). Profunctor p => p a a' -> (ObjDict a, ObjDict a')
- data ObjDict (a :: k) where
- type family (as :: [k]) ++ (bs :: [k]) :: [k] where ...
- data ListOf (c :: OB k) (xs :: [k]) where
- class KnownListOf (c :: OB k) (xs :: [k]) where
- withKnownListOf :: forall {k} (c :: OB k) (xs :: [k]) r. ListOf c xs -> (KnownListOf c xs => r) -> r
- mapListOf :: forall {k} c (xs :: [k]) r. (forall (x :: k). c x => r) -> ListOf c xs -> [r]
- lengthListOf :: forall {k} (c :: OB k) (xs :: [k]). ListOf c xs -> Int
- appendListOf :: forall {k} (c :: OB k) (as :: [k]) (bs :: [k]). ListOf c as -> ListOf c bs -> ListOf c (as ++ bs)
- withKnownAppend :: forall {k} (c :: OB k) (as :: [k]) (bs :: [k]) r. (KnownListOf c as, KnownListOf c bs) => (KnownListOf c (as ++ bs) => r) -> r
- withKnownAssoc :: forall {k} (c :: OB k) (as :: [k]) (bs :: [k]) (cs :: [k]) r. (KnownListOf c as, KnownListOf c bs, KnownListOf c cs) => ((KnownListOf c ((as ++ bs) ++ cs), KnownListOf c (as ++ (bs ++ cs))) => r) -> r
- eqListOf :: forall {k} c (as :: [k]) (bs :: [k]). (forall (x :: k) (y :: k). (c x, c y) => Maybe (x :~: y)) -> ListOf c as -> ListOf c bs -> Maybe (as :~: bs)
- data SomeOf (c :: OB k) where
- someOfList :: forall {k} (c :: OB k) (xs :: [k]). ListOf c xs -> [SomeOf c]
- withListOf :: forall {k} (c :: OB k) r. [SomeOf c] -> (forall (xs :: [k]). ListOf c xs -> r) -> r
- someRepOf :: forall {k} (c :: OB k). SomeOf ((Typeable :: k -> Constraint) :&&: c) -> SomeTypeRep
Documentation
pattern Objs :: forall {j} {k} p (a :: k) (b :: j). Profunctor p => (Ob a, Ob b) => p a b Source Github #
obj :: forall {k} (a :: k). (CategoryOf k, Ob a) => Obj a Source Github #
The identity morphism for a given object.
Compared to id this makes the kind argument implicit,
allowing to write obj @a instead of id @k @a.
src :: forall {j} {k} (a :: k) (b :: j) p. Profunctor p => p a b -> Obj a Source Github #
Extract source identity morphism from a profunctor heteromorphism.
tgt :: forall {k1} {k2} (a :: k2) (b :: k1) p. Profunctor p => p a b -> Obj b Source Github #
Extract target identity morphism from a profunctor heteromorphism.
class (Ob a, CategoryOf k) => Ob' (a :: k) Source Github #
Ob as a proper class, for the positions where the type family Ob itself cannot appear,
such as the head of a quantified constraint.
Instances
| (Ob a, CategoryOf k) => Ob' (a :: k) Source Github # | |
Defined in Proarrow.Core | |
class (CategoryOf k, forall (a :: k). Ob' a) => VacuousOb k Source Github #
A category without constraints on its objects.
Instances
| (CategoryOf k, forall (a :: k). Ob' a) => VacuousOb k Source Github # | |
Defined in Proarrow.Core | |
objDicts :: forall {k1} {k2} p (a :: k2) (a' :: k1). Profunctor p => p a a' -> (ObjDict a, ObjDict a') Source Github #
Lists of objects
data ListOf (c :: OB k) (xs :: [k]) where Source Github #
A type-level list with the evidence c for each element, as a value.
class KnownListOf (c :: OB k) (xs :: [k]) where Source Github #
A type-level list whose elements have the evidence c, as its ListOf.
Instances
| KnownListOf (c :: OB k) ('[] :: [k]) Source Github # | |
| (c x, KnownListOf c xs) => KnownListOf (c :: a -> Constraint) (x ': xs :: [a]) Source Github # | |
withKnownListOf :: forall {k} (c :: OB k) (xs :: [k]) r. ListOf c xs -> (KnownListOf c xs => r) -> r Source Github #
The class from the list.
mapListOf :: forall {k} c (xs :: [k]) r. (forall (x :: k). c x => r) -> ListOf c xs -> [r] Source Github #
A value for each element, in order.
lengthListOf :: forall {k} (c :: OB k) (xs :: [k]). ListOf c xs -> Int Source Github #
The number of elements.
appendListOf :: forall {k} (c :: OB k) (as :: [k]) (bs :: [k]). ListOf c as -> ListOf c bs -> ListOf c (as ++ bs) Source Github #
The elements of both lists.
withKnownAppend :: forall {k} (c :: OB k) (as :: [k]) (bs :: [k]) r. (KnownListOf c as, KnownListOf c bs) => (KnownListOf c (as ++ bs) => r) -> r Source Github #
The class for the elements of both lists.
withKnownAssoc :: forall {k} (c :: OB k) (as :: [k]) (bs :: [k]) (cs :: [k]) r. (KnownListOf c as, KnownListOf c bs, KnownListOf c cs) => ((KnownListOf c ((as ++ bs) ++ cs), KnownListOf c (as ++ (bs ++ cs))) => r) -> r Source Github #
The class for the elements of three lists, appended either way round.
eqListOf :: forall {k} c (as :: [k]) (bs :: [k]). (forall (x :: k) (y :: k). (c x, c y) => Maybe (x :~: y)) -> ListOf c as -> ListOf c bs -> Maybe (as :~: bs) Source Github #
Whether two lists have the same elements, given how to decide that for one element.
One object of many
data SomeOf (c :: OB k) where Source Github #
Some type with the evidence c, which one known only at runtime.
Instances
someOfList :: forall {k} (c :: OB k) (xs :: [k]). ListOf c xs -> [SomeOf c] Source Github #
The elements of the list, each on its own.