concat-examples-0.3.0.0: Some examples of compiling to categories
Safe HaskellSafe-Inferred
LanguageHaskell2010

ConCat.Choice

Description

Indexed sets of morphisms

Synopsis

Documentation

newtype Choice con a b Source #

Nondeterminism category. Like a set of morphisms all of the same type, but represented as a function whose range is that set. The function's domain is existentially hidden.

Constructors

Choice (OptArg con (a -> b)) 

Instances

Instances details
con () => BottomCat (Choice con :: Type -> Type -> Type) (a :: Type) (b :: Type) Source # 
Instance details

Defined in ConCat.Choice

Methods

bottomC :: Choice con a b Source #

(Integral a, Num b, con ()) => FromIntegralCat (Choice con :: Type -> Type -> Type) (a :: Type) (b :: Type) Source # 
Instance details

Defined in ConCat.Choice

con () => UnknownCat (Choice con :: Type -> Type -> Type) (a :: Type) (b :: Type) Source # 
Instance details

Defined in ConCat.Choice

Methods

unknownC :: Choice con a b Source #

(RepCat (->) a r, con ()) => RepCat (Choice con :: Type -> Type -> Type) (a :: Type) (r :: Type) Source # 
Instance details

Defined in ConCat.Choice

Methods

reprC :: Choice con a r Source #

abstC :: Choice con r a Source #

CartCon con => BoolCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

notC :: Choice con (BoolOf (Choice con)) (BoolOf (Choice con)) Source #

andC :: Choice con (Prod (Choice con) (BoolOf (Choice con)) (BoolOf (Choice con))) (BoolOf (Choice con)) Source #

orC :: Choice con (Prod (Choice con) (BoolOf (Choice con)) (BoolOf (Choice con))) (BoolOf (Choice con)) Source #

xorC :: Choice con (Prod (Choice con) (BoolOf (Choice con)) (BoolOf (Choice con))) (BoolOf (Choice con)) Source #

CartCon con => BraidedPCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

swapP :: Ok2 (Choice con) a b => Choice con (Prod (Choice con) a b) (Prod (Choice con) b a) Source #

CartCon con => BraidedSCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

swapS :: Ok2 (Choice con) a b => Choice con (Coprod (Choice con) a b) (Coprod (Choice con) b a) Source #

CartCon con => Category (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Associated Types

type Ok (Choice con) :: Type -> Constraint Source #

Methods

id :: Ok (Choice con) a => Choice con a a Source #

(.) :: forall b c a. Ok3 (Choice con) a b c => Choice con b c -> Choice con a b -> Choice con a c Source #

CartCon con => ClosedCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

apply :: Ok2 (Choice con) a b => Choice con (Prod (Choice con) (Exp (Choice con) a b) a) b Source #

curry :: Ok3 (Choice con) a b c => Choice con (Prod (Choice con) a b) c -> Choice con a (Exp (Choice con) b c) Source #

uncurry :: Ok3 (Choice con) a b c => Choice con a (Exp (Choice con) b c) -> Choice con (Prod (Choice con) a b) c Source #

CartCon con => CoproductCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

inl :: Ok2 (Choice con) a b => Choice con a (Coprod (Choice con) a b) Source #

inr :: Ok2 (Choice con) a b => Choice con b (Coprod (Choice con) a b) Source #

jam :: Ok (Choice con) a => Choice con (Coprod (Choice con) a a) a Source #

CartCon con => DistribCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

distl :: Ok3 (Choice con) a u v => Choice con (Prod (Choice con) a (Coprod (Choice con) u v)) (Coprod (Choice con) (Prod (Choice con) a u) (Prod (Choice con) a v)) Source #

distr :: Ok3 (Choice con) u v b => Choice con (Prod (Choice con) (Coprod (Choice con) u v) b) (Coprod (Choice con) (Prod (Choice con) u b) (Prod (Choice con) v b)) Source #

CartCon con => MonoidalPCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

(***) :: Ok4 (Choice con) a b c d => Choice con a c -> Choice con b d -> Choice con (Prod (Choice con) a b) (Prod (Choice con) c d) Source #

first :: forall a a' b. Ok3 (Choice con) a b a' => Choice con a a' -> Choice con (Prod (Choice con) a b) (Prod (Choice con) a' b) Source #

second :: Ok3 (Choice con) a b b' => Choice con b b' -> Choice con (Prod (Choice con) a b) (Prod (Choice con) a b') Source #

CartCon con => MonoidalSCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

(+++) :: Ok4 (Choice con) a b c d => Choice con c a -> Choice con d b -> Choice con (Coprod (Choice con) c d) (Coprod (Choice con) a b) Source #

left :: forall a a' b. Oks (Choice con) '[a, b, a'] => Choice con a a' -> Choice con (Coprod (Choice con) a b) (Coprod (Choice con) a' b) Source #

right :: Oks (Choice con) '[a, b, b'] => Choice con b b' -> Choice con (Coprod (Choice con) a b) (Coprod (Choice con) a b') Source #

CartCon con => ProductCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

exl :: Ok2 (Choice con) a b => Choice con (Prod (Choice con) a b) a Source #

exr :: Ok2 (Choice con) a b => Choice con (Prod (Choice con) a b) b Source #

dup :: Ok (Choice con) a => Choice con a (Prod (Choice con) a a) Source #

CartCon con => TerminalCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

it :: Ok (Choice con) a => Choice con a (Unit (Choice con)) Source #

CartCon con => UnitCat (Choice con) Source # 
Instance details

Defined in ConCat.Choice

Methods

lunit :: Ok (Choice con) a => Choice con a (Prod (Choice con) (Unit (Choice con)) a) Source #

lcounit :: Ok (Choice con) a => Choice con (Prod (Choice con) (Unit (Choice con)) a) a Source #

runit :: Ok (Choice con) a => Choice con a (Prod (Choice con) a (Unit (Choice con))) Source #

rcounit :: Ok (Choice con) a => Choice con (Prod (Choice con) a (Unit (Choice con))) a Source #

CartCon con => ConstCat (Choice con) b Source # 
Instance details

Defined in ConCat.Choice

Methods

const :: Ok (Choice con) a => b -> Choice con a (ConstObj (Choice con) b) Source #

unitArrow :: b -> Choice con (Unit (Choice con)) (ConstObj (Choice con) b) Source #

(Enum a, CartCon con) => EnumCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

succC :: Choice con a a Source #

predC :: Choice con a a Source #

(Eq a, CartCon con) => EqCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

equal :: Choice con (Prod (Choice con) a a) (BoolOf (Choice con)) Source #

notEqual :: Choice con (Prod (Choice con) a a) (BoolOf (Choice con)) Source #

(Floating a, con ()) => FloatingCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

expC :: Choice con a a Source #

logC :: Choice con a a Source #

cosC :: Choice con a a Source #

sinC :: Choice con a a Source #

sqrtC :: Choice con a a Source #

tanhC :: Choice con a a Source #

(Fractional a, con ()) => FractionalCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

recipC :: Choice con a a Source #

divideC :: Choice con (Prod (Choice con) a a) a Source #

(CartCon con, Functor h) => FunctorCat (Choice con) h Source # 
Instance details

Defined in ConCat.Choice

Methods

fmapC :: Ok2 (Choice con) a b => Choice con a b -> Choice con (h a) (h b) Source #

unzipC :: Ok2 (Choice con) a b => Choice con (h (a :* b)) (h a :* h b) Source #

CartCon con => IfCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

ifC :: IfT (Choice con) a Source #

(Integral a, con ()) => IntegralCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

divC :: Choice con (Prod (Choice con) a a) a Source #

modC :: Choice con (Prod (Choice con) a a) a Source #

(Ord a, CartCon con) => MinMaxCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

minC :: Choice con (Prod (Choice con) a a) a Source #

maxC :: Choice con (Prod (Choice con) a a) a Source #

(Num a, CartCon con) => NumCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

negateC :: Choice con a a Source #

addC :: Choice con (Prod (Choice con) a a) a Source #

subC :: Choice con (Prod (Choice con) a a) a Source #

mulC :: Choice con (Prod (Choice con) a a) a Source #

powIC :: Choice con (Prod (Choice con) a Int) a Source #

OkFunctor (Choice con) h Source # 
Instance details

Defined in ConCat.Choice

Methods

okFunctor :: Ok' (Choice con) a |- Ok' (Choice con) (h a) Source #

(Ord a, CartCon con) => OrdCat (Choice con) a Source # 
Instance details

Defined in ConCat.Choice

Methods

lessThan :: Choice con (Prod (Choice con) a a) (BoolOf (Choice con)) Source #

greaterThan :: Choice con (Prod (Choice con) a a) (BoolOf (Choice con)) Source #

lessThanOrEqual :: Choice con (Prod (Choice con) a a) (BoolOf (Choice con)) Source #

greaterThanOrEqual :: Choice con (Prod (Choice con) a a) (BoolOf (Choice con)) Source #

(Representable f, CartCon con) => RepresentableCat (Choice con) f Source # 
Instance details

Defined in ConCat.Choice

Methods

tabulateC :: Ok (Choice con) a => Choice con (Rep f -> a) (f a) Source #

indexC :: Ok (Choice con) a => Choice con (f a) (Rep f -> a) Source #

(Zip h, CartCon con) => ZipCat (Choice con) h Source # 
Instance details

Defined in ConCat.Choice

Methods

zipC :: Ok2 (Choice con) a b => Choice con (h a :* h b) (h (a :* b)) Source #

(AddCat (->) h a, CartCon con) => AddCat (Choice con) h a Source # 
Instance details

Defined in ConCat.Choice

Methods

sumAC :: Choice con (h a) a Source #

(Distributive g, Functor f, CartCon con) => DistributiveCat (Choice con) g f Source # 
Instance details

Defined in ConCat.Choice

Methods

distributeC :: Ok (Choice con) a => Choice con (f (g a)) (g (f a)) Source #

(Pointed h, CartCon con) => PointedCat (Choice con) h a Source # 
Instance details

Defined in ConCat.Choice

Methods

pointC :: Choice con a (h a) Source #

(Integral b, RealFrac a, con ()) => RealFracCat (Choice con) a b Source # 
Instance details

Defined in ConCat.Choice

Methods

floorC :: Choice con a b Source #

ceilingC :: Choice con a b Source #

truncateC :: Choice con a b Source #

Newtype (Choice con a b) Source # 
Instance details

Defined in ConCat.Choice

Associated Types

type O (Choice con a b) Source #

Methods

pack :: O (Choice con a b) -> Choice con a b Source #

unpack :: Choice con a b -> O (Choice con a b) Source #

type Ok (Choice con) Source # 
Instance details

Defined in ConCat.Choice

type Ok (Choice con) = Yes1 :: Type -> Constraint
type O (Choice con a b) Source # 
Instance details

Defined in ConCat.Choice

type O (Choice con a b) = OptArg con (a -> b)

onChoice :: forall con a b q. con () => (forall p. con p => (p -> a -> b) -> q) -> Choice con a b -> q Source #

exactly :: con () => (a -> b) -> Choice con a b Source #

Deterministic (trivially nondeterministic) arrow

chooseC :: forall con p a b. (CartCon con, con p) => Choice con p (a -> b) -> Choice con a b Source #

Generate any value of type p.

choose :: forall con p a. (CartCon con, con p) => (p -> a) -> a Source #

Generate any value of type p.

op1C :: forall con a b c d. CartCon con => ((a -> b) -> c -> d) -> Choice con a b -> Choice con c d Source #

op2C :: forall con a b c d e f. CartCon con => ((a -> b) -> (c -> d) -> e -> f) -> Choice con a b -> Choice con c d -> Choice con e f Source #

data OptArg con z Source #

Constructors

NoArg z 
forall p.con p => Arg (p -> z) 

Instances

Instances details
CartCon con => Applicative (OptArg con) Source # 
Instance details

Defined in ConCat.Choice

Methods

pure :: a -> OptArg con a Source #

(<*>) :: OptArg con (a -> b) -> OptArg con a -> OptArg con b Source #

liftA2 :: (a -> b -> c) -> OptArg con a -> OptArg con b -> OptArg con c Source #

(*>) :: OptArg con a -> OptArg con b -> OptArg con b Source #

(<*) :: OptArg con a -> OptArg con b -> OptArg con a Source #

CartCon con => Functor (OptArg con) Source # 
Instance details

Defined in ConCat.Choice

Methods

fmap :: (a -> b) -> OptArg con a -> OptArg con b Source #

(<$) :: a -> OptArg con b -> OptArg con a Source #

onOptArg :: forall con z q. con () => (forall p. con p => (p -> z) -> q) -> OptArg con z -> q Source #

onOptArg' :: forall con z q. con () => (z -> q) -> (forall p. con p => (p -> z) -> q) -> OptArg con z -> q Source #

type CartCon con = (con (), OpCon (:*) (Sat con)) Source #