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

ConCat.TArr

Description

Domain-typed arrays

Synopsis

Documentation

class HasFin a where Source #

Associated Types

type Card a :: Nat Source #

Methods

fin :: a <-> Finite (Card a) Source #

Instances

Instances details
HasFin Void Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Card Void :: Nat Source #

HasFin () Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Card () :: Nat Source #

Methods

fin :: () <-> Finite (Card ()) Source #

HasFin Bool Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Card Bool :: Nat Source #

KnownNat n => HasFin (Finite n) Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Card (Finite n) :: Nat Source #

Methods

fin :: Finite n <-> Finite (Card (Finite n)) Source #

(HasFin' a, HasFin' b) => HasFin (a :* b) Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Card (a :* b) :: Nat Source #

Methods

fin :: (a :* b) <-> Finite (Card (a :* b)) Source #

(HasFin' a, HasFin' b) => HasFin (a :+ b) Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Card (a :+ b) :: Nat Source #

Methods

fin :: (a :+ b) <-> Finite (Card (a :+ b)) Source #

type HasFin' a = (KnownCard a, HasFin a) Source #

toFin :: HasFin a => a -> Finite (Card a) Source #

unFin :: HasFin a => Finite (Card a) -> a Source #

newtype Arr a b Source #

Constructors

Arr (VC a b) 

Instances

Instances details
HasFin' a => OkFunctor (:>) (Arr a) Source # 
Instance details

Defined in ConCat.Circuit

Methods

okFunctor :: Ok' (:>) a0 |- Ok' (:>) (Arr a a0) Source #

(OkCAR (Arr a b), IfCat (:>) (Rep (Arr a b))) => IfCat (:>) (Arr a b) Source # 
Instance details

Defined in ConCat.Circuit

Methods

ifC :: IfT (:>) (Arr a b) Source #

HasFin' a => Representable (Arr a) Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Rep (Arr a) Source #

Methods

tabulate :: (Rep (Arr a) -> a0) -> Arr a a0 Source #

index :: Arr a a0 -> Rep (Arr a) -> a0 Source #

(Decomposable a, Foldable (Decomp a)) => Foldable (Arr a) Source # 
Instance details

Defined in ConCat.TArr

Methods

fold :: Monoid m => Arr a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Arr a a0 -> m Source #

foldMap' :: Monoid m => (a0 -> m) -> Arr a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Arr a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Arr a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Arr a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Arr a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Arr a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Arr a a0 -> a0 Source #

toList :: Arr a a0 -> [a0] Source #

null :: Arr a a0 -> Bool Source #

length :: Arr a a0 -> Int Source #

elem :: Eq a0 => a0 -> Arr a a0 -> Bool Source #

maximum :: Ord a0 => Arr a a0 -> a0 Source #

minimum :: Ord a0 => Arr a a0 -> a0 Source #

sum :: Num a0 => Arr a a0 -> a0 Source #

product :: Num a0 => Arr a a0 -> a0 Source #

KnownCard a => Applicative (Arr a) Source # 
Instance details

Defined in ConCat.TArr

Methods

pure :: a0 -> Arr a a0 Source #

(<*>) :: Arr a (a0 -> b) -> Arr a a0 -> Arr a b Source #

liftA2 :: (a0 -> b -> c) -> Arr a a0 -> Arr a b -> Arr a c Source #

(*>) :: Arr a a0 -> Arr a b -> Arr a b Source #

(<*) :: Arr a a0 -> Arr a b -> Arr a a0 Source #

Functor (Arr a) Source # 
Instance details

Defined in ConCat.TArr

Methods

fmap :: (a0 -> b) -> Arr a a0 -> Arr a b Source #

(<$) :: a0 -> Arr a b -> Arr a a0 Source #

HasFin' a => Distributive (Arr a) Source # 
Instance details

Defined in ConCat.TArr

Methods

distribute :: Functor f => f (Arr a a0) -> Arr a (f a0) Source #

collect :: Functor f => (a0 -> Arr a b) -> f a0 -> Arr a (f b) Source #

distributeM :: Monad m => m (Arr a a0) -> Arr a (m a0) Source #

collectM :: Monad m => (a0 -> Arr a b) -> m a0 -> Arr a (m b) Source #

HasRep (Arr a b) Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type Rep (Arr a b) Source #

Methods

repr :: Arr a b -> Rep (Arr a b) Source #

abst :: Rep (Arr a b) -> Arr a b Source #

OkCAR (Arr a b) => GenBuses (Arr a b) Source # 
Instance details

Defined in ConCat.Circuit

Methods

genBuses' :: Template u v -> [Source] -> BusesM (Buses (Arr a b)) Source #

ty :: Ty Source #

unflattenB' :: State [Source] (Buses (Arr a b)) Source #

Newtype (Arr a b) Source # 
Instance details

Defined in ConCat.TArr

Associated Types

type O (Arr a b) Source #

Methods

pack :: O (Arr a b) -> Arr a b Source #

unpack :: Arr a b -> O (Arr a b) Source #

type Rep (Arr a) Source # 
Instance details

Defined in ConCat.TArr

type Rep (Arr a) = a
type Rep (Arr a b) Source # 
Instance details

Defined in ConCat.TArr

type Rep (Arr a b) = O (Arr a b)
type O (Arr a b) Source # 
Instance details

Defined in ConCat.TArr

type O (Arr a b)

type Flat f = Arr (Rep f) Source #

flat :: HasFlat f => f <--> Flat f Source #

toFlat :: HasFlat f => f a -> Flat f a Source #

unFlat :: HasFlat f => Flat f a -> f a Source #

vecProd :: forall m n. KnownNat2 m n => Vector (m + n) <--> (Vector m :*: Vector n) Source #

vecComp :: forall m n. KnownNat2 m n => Vector (m * n) <--> (Vector m :.: Vector n) Source #

arrProd :: forall a b. KnownCard2 a b => Arr (a :+ b) <--> (Arr a :*: Arr b) Source #

arrComp :: forall a b. KnownCard2 a b => Arr (a :* b) <--> (Arr a :.: Arr b) Source #

reverseF :: forall f a. (Representable f, HasFin' (Rep f)) => f a -> f a Source #

Reverse the order of a representable functor.

reverseFinite :: forall n. KnownNat n => Finite n -> Finite n Source #