proarrow-0: Category theory with a central role for profunctors
Safe HaskellNone
LanguageHaskell2010

Proarrow.Category.Instance.Free

Documentation

type MULTICAT k = [k] -> k -> Type Source Comments #

newtype FREE (str :: CAT [FK k]) (p :: CAT k) Source Comments #

Constructors

F (FK k) 

Instances

Instances details
(Structure str, Profunctor p) => CategoryOf (FREE str p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type (~>) 
Instance details

Defined in Proarrow.Category.Instance.Free

type (~>) = Free :: FREE str p -> FREE str p -> Type
(Structure str, Profunctor p) => Promonad (Free :: FREE str p -> FREE str p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Methods

id :: forall (a :: FREE str p). Ob a => Free a a Source Comments #

(.) :: forall (b :: FREE str p) (c :: FREE str p) (a :: FREE str p). Free b c -> Free a b -> Free a c Source Comments #

(Structure str, Profunctor p) => Profunctor (Free :: FREE str p -> FREE str p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Methods

dimap :: forall (c :: FREE str p) (a :: FREE str p) (b :: FREE str p) (d :: FREE str p). (c ~> a) -> (b ~> d) -> Free a b -> Free c d Source Comments #

(\\) :: forall (a :: FREE str p) (b :: FREE str p) r. ((Ob a, Ob b) => r) -> Free a b -> r Source Comments #

type UN ('F :: FK k1 -> FREE str p) ('F k2 :: FREE str p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type UN ('F :: FK k1 -> FREE str p) ('F k2 :: FREE str p) = k2
type (~>) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type (~>) = Free :: FREE str p -> FREE str p -> Type
type Ob (a :: FREE str p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type Ob (a :: FREE str p) = (Is ('F :: FK k -> FREE str p) a, IsFK (UN ('F :: FK k -> FREE str p) a))

data Free (a :: FREE str p) (b :: FREE str p) where Source Comments #

Constructors

Free :: forall {k} (a1 :: FK k) (b1 :: FK k) (str :: CAT [FK k]) (p :: CAT k). (IsFK a1, IsFK b1) => (forall (ctx :: [FK k]). IsFKs ctx => MFree str p ctx a1 -> MFree str p ctx b1) -> Free ('F a1 :: FREE str p) ('F b1 :: FREE str p) 

Instances

Instances details
(Structure str, Profunctor p) => Promonad (Free :: FREE str p -> FREE str p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Methods

id :: forall (a :: FREE str p). Ob a => Free a a Source Comments #

(.) :: forall (b :: FREE str p) (c :: FREE str p) (a :: FREE str p). Free b c -> Free a b -> Free a c Source Comments #

(Structure str, Profunctor p) => Profunctor (Free :: FREE str p -> FREE str p -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Methods

dimap :: forall (c :: FREE str p) (a :: FREE str p) (b :: FREE str p) (d :: FREE str p). (c ~> a) -> (b ~> d) -> Free a b -> Free c d Source Comments #

(\\) :: forall (a :: FREE str p) (b :: FREE str p) r. ((Ob a, Ob b) => r) -> Free a b -> r Source Comments #

data FK k Source Comments #

Constructors

EMB k 

Instances

Instances details
Structure (Plain :: [FK k] -> [FK k] -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) 
Instance details

Defined in Proarrow.Category.Instance.Free

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) = NoConstraint :: Kind -> Constraint

Methods

foldStructure :: forall cat (ctx1 :: [FK k]) (ctx2 :: [FK k]). HasStructure (Plain :: [FK k] -> [FK k] -> Type) k => Plain ctx1 ctx2 -> cat (Lower (Flatten ctx1)) (Lower (Flatten ctx2)) Source Comments #

IsFK a => IsFKs ('[a] :: [FK k]) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type Flatten ('[a] :: [FK k]) 
Instance details

Defined in Proarrow.Category.Instance.Free

type Flatten ('[a] :: [FK k]) = a

Methods

withFlattenOb :: (IsFK (Flatten '[a]) => r) -> r Source Comments #

type UN ('EMB :: j -> FK j) ('EMB a :: FK j) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type UN ('EMB :: j -> FK j) ('EMB a :: FK j) = a
type HasStructure (Plain :: [FK k] -> [FK k] -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) = NoConstraint :: Kind -> Constraint
type Flatten ('[a] :: [FK k]) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type Flatten ('[a] :: [FK k]) = a
type UN ('F :: FK k1 -> FREE str p) ('F k2 :: FREE str p) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type UN ('F :: FK k1 -> FREE str p) ('F k2 :: FREE str p) = k2

data MFree (str :: CAT [FK k]) (p :: CAT k) (as :: [FK k]) (b :: FK k) where Source Comments #

Constructors

Id :: forall {k} (b :: FK k) (str :: CAT [FK k]) (p :: CAT k). IsFK b => MFree str p '[b] b 
Emb :: forall {k} (p :: CAT k) (a :: k) (b1 :: k) (str :: CAT [FK k]) (as :: [FK k]). p a b1 -> MFree str p as ('EMB a) -> MFree str p as ('EMB b1) 
Str :: forall {k} (str :: CAT [FK k]) (as :: [FK k]) (ctx2 :: [FK k]) (p :: CAT k) (b :: FK k). str as ctx2 -> MFree str p ctx2 b -> MFree str p as b 

class IsFK (a :: FK k) where Source Comments #

Associated Types

type Lower (a :: FK k) :: k Source Comments #

Methods

withLowerOb :: (Ob (Lower a) => r) -> r Source Comments #

Instances

Instances details
Ob a => IsFK ('EMB a :: FK k) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type Lower ('EMB a :: FK k) 
Instance details

Defined in Proarrow.Category.Instance.Free

type Lower ('EMB a :: FK k) = a

Methods

withLowerOb :: (Ob (Lower ('EMB a)) => r) -> r Source Comments #

class IsFKs (as :: [FK k]) where Source Comments #

Associated Types

type Flatten (as :: [FK k]) :: FK k Source Comments #

Methods

withFlattenOb :: (IsFK (Flatten as) => r) -> r Source Comments #

Instances

Instances details
IsFK a => IsFKs ('[a] :: [FK k]) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type Flatten ('[a] :: [FK k]) 
Instance details

Defined in Proarrow.Category.Instance.Free

type Flatten ('[a] :: [FK k]) = a

Methods

withFlattenOb :: (IsFK (Flatten '[a]) => r) -> r Source Comments #

class Structure (str :: CAT [FK k]) where Source Comments #

Associated Types

type HasStructure (str :: CAT [FK k]) :: Kind -> Constraint Source Comments #

Methods

foldStructure :: forall cat (ctx1 :: [FK k]) (ctx2 :: [FK k]). HasStructure str k => str ctx1 ctx2 -> cat (Lower (Flatten ctx1)) (Lower (Flatten ctx2)) Source Comments #

Instances

Instances details
Structure (Plain :: [FK k] -> [FK k] -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) 
Instance details

Defined in Proarrow.Category.Instance.Free

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) = NoConstraint :: Kind -> Constraint

Methods

foldStructure :: forall cat (ctx1 :: [FK k]) (ctx2 :: [FK k]). HasStructure (Plain :: [FK k] -> [FK k] -> Type) k => Plain ctx1 ctx2 -> cat (Lower (Flatten ctx1)) (Lower (Flatten ctx2)) Source Comments #

data Plain (ctx1 :: k) (ctx2 :: k1) Source Comments #

Instances

Instances details
Structure (Plain :: [FK k] -> [FK k] -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

Associated Types

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) 
Instance details

Defined in Proarrow.Category.Instance.Free

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) = NoConstraint :: Kind -> Constraint

Methods

foldStructure :: forall cat (ctx1 :: [FK k]) (ctx2 :: [FK k]). HasStructure (Plain :: [FK k] -> [FK k] -> Type) k => Plain ctx1 ctx2 -> cat (Lower (Flatten ctx1)) (Lower (Flatten ctx2)) Source Comments #

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

type HasStructure (Plain :: [FK k] -> [FK k] -> Type) = NoConstraint :: Kind -> Constraint

class NoConstraint (k1 :: k) Source Comments #

Instances

Instances details
NoConstraint (k2 :: k1) Source Comments # 
Instance details

Defined in Proarrow.Category.Instance.Free

fold :: forall {k} (str :: CAT [FK k]) (p :: CAT k) cat (a :: FK k) (b :: FK k). (Category cat, Structure str, HasStructure str k) => (p :~> cat) -> Free ('F a :: FREE str p) ('F b :: FREE str p) -> cat (Lower a) (Lower b) Source Comments #

data Test a b where Source Comments #

Constructors

Show :: Test Int [Char] 
Read :: Test [Char] Int 
Succ :: Test Int Int 
Dup :: Test [Char] [Char] 

type T (ctx :: [FK Type]) = MFree (Plain :: [FK Type] -> [FK Type] -> Type) Test ctx Source Comments #

show :: forall (ctx :: [FK Type]). T ctx ('EMB Int) -> T ctx ('EMB String) Source Comments #

read :: forall (ctx :: [FK Type]). T ctx ('EMB String) -> T ctx ('EMB Int) Source Comments #

succ :: forall (ctx :: [FK Type]). T ctx ('EMB Int) -> T ctx ('EMB Int) Source Comments #

dup :: forall (ctx :: [FK Type]). T ctx ('EMB String) -> T ctx ('EMB String) Source Comments #

test :: forall (ctx :: [FK Type]). T ctx ('EMB String) -> T ctx ('EMB String) Source Comments #

testF :: Free ('F ('EMB String) :: FREE (Plain :: [FK Type] -> [FK Type] -> Type) Test) ('F ('EMB String) :: FREE (Plain :: [FK Type] -> [FK Type] -> Type) Test) Source Comments #