Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Sat a b where
- type DOC = Doc ()
- type (<) i j = CmpNat i j ~ LT
- type family Product xs where ...
- type family Sum xs where ...
- type family xs ++ ys where ...
- type family Tail xs where ...
- type family Last xs where ...
- type family Init xs where ...
- plusAssoc' :: forall x y z. ((x + y) + z) :~: (x + (y + z))
- plusAssoc :: forall x y z k. (((x + y) + z) ~ (x + (y + z)) => k) -> k
- prodAssoc' :: forall x y z. ((x * y) * z) :~: (x * (y * z))
- prodAssoc :: forall x y z k. (((x * y) * z) ~ (x * (y * z)) => k) -> k
- prodHomo' :: forall x y. Product (x ++ y) :~: (Product x * Product y)
- prodHomo :: forall x y k. (Product (x ++ y) ~ (Product x * Product y) => k) -> k
- knownProduct' :: forall s k. All KnownNat s => SList s -> (KnownNat (Product s) => k) -> k
- knownProduct :: forall s k. KnownShape s => (KnownNat (Product s) => k) -> k
- initLast' :: forall s k. SList s -> ((Init s ++ '[Last s]) ~ s => k) -> k
- initLast :: forall s k. KnownShape s => ((Init s ++ '[Last s]) ~ s => k) -> k
- knownLast' :: All KnownNat s => SList s -> (KnownNat (Last s) => k) -> k
- knownLast :: forall s k. KnownShape s => (KnownNat (Last s) => k) -> k
- splitApp' :: forall ys xs k. SList xs -> ((Take (PeanoLength xs) (xs ++ ys) ~ xs, Drop (PeanoLength xs) (xs ++ ys) ~ ys) => k) -> k
- splitApp :: forall xs ys k. KnownLen xs => ((Take (PeanoLength xs) (xs ++ ys) ~ xs, Drop (PeanoLength xs) (xs ++ ys) ~ ys) => k) -> k
- knownAppend' :: forall t s k. (All KnownNat s, KnownShape t) => SList s -> (KnownShape (s ++ t) => k) -> k
- knownAppend :: forall s t k. (KnownShape s, KnownShape t) => (KnownShape (s ++ t) => k) -> k
- type family Length xs where ...
- type family Reverse' xs ys where ...
- type family Reverse xs where ...
- newtype V n a = V [a]
- data NP f xs where
- newtype I a = I a
- newtype K a x = K a
- type HList = NP I
- pattern HSingle :: forall k f a. f a -> NP k f ((:) k a ([] k))
- pattern VecSing :: forall s t. Tensor s t -> HTV t ((:) Shape s ([] Shape))
- pattern VecPair :: forall s t s'. Tensor s t -> Tensor s' t -> HTV t ((:) Shape s ((:) Shape s' ([] Shape)))
- pattern VecTriple :: forall s t s' s3. Tensor s t -> Tensor s' t -> Tensor s3 t -> HTV t ((:) Shape s ((:) Shape s' ((:) Shape s3 ([] Shape))))
- type family All (c :: k -> Constraint) (xs :: [k]) :: Constraint where ...
- class Fun c where
- type Ap c (t :: k) :: l
- class Cons x xs
- class Snoc x xs
- class FMap c xs
- newtype F g t s = F {
- fromF :: g s t
- type HTV t = NP (F T t)
- data Pair a b = a :& b
- type family Fst (x :: Pair a b) where ...
- type family Snd (x :: Pair a b) where ...
- newtype Uncurry g s = Uncurry {
- fromUncurry :: g (Fst s) (Snd s)
- type HHTV = NP (Uncurry T)
- hhead :: NP f (x ': xs) -> f x
- htail :: NP f (x ': xs) -> NP f xs
- htmap :: forall f ss t u. (forall s. Tensor s t -> Tensor (Ap f s) u) -> HTV t ss -> HTV u (Ap (FMap f) ss)
- hmap :: (forall x. f x -> g x) -> NP f xs -> NP g xs
- hendo :: NP Endo xs -> HList xs -> HList xs
- happ :: NP f xs -> NP f ys -> NP f (xs ++ ys)
- data Both f g x = Both (f x) (g x)
- hzip :: NP f xs -> NP g xs -> NP (Both f g) xs
- hzipWith :: (forall x. f x -> g x -> h x) -> NP f xs -> NP g xs -> NP h xs
- hfor_ :: Monad m => NP f xs -> (forall x. f x -> m a) -> m ()
- htoList :: NP (K a) xs -> [a]
- hsplit' :: SPeano n -> NP f xs -> (NP f (Take n xs), NP f (Drop n xs))
- hsplit :: forall xs ys f. KnownLen xs => NP f (xs ++ ys) -> (NP f xs, NP f ys)
- hsnoc :: NP f xs -> f x -> NP f (xs ++ '[x])
- data Peano
- type Dim0 = Zero
- type Dim1 = Succ Dim0
- type Dim2 = Succ Dim1
- type Dim3 = Succ Dim2
- type Axis0 = Zero
- type Axis1 = Succ Dim0
- type Axis2 = Succ Dim1
- type Axis3 = Succ Dim2
- class KnownPeano n where
- data SPeano n where
- data Vec n a where
- vecToList :: Vec n a -> [a]
- type family Take n xs where ...
- type family Drop n xs where ...
- type family At n xs where ...
- data Kind
- data NBits
- data Typ = Typ Kind NBits
- type Flt t = Typ Float t
- type Float32 = Typ Float B32
- type Int32 = Typ Int B32
- type Int64 = Typ Int B64
- type TFBool = Typ Bool B1
- type Scalar t = T '[] t
- showTyp :: forall t. KnownTyp t => DOC
- type Shape = [Nat]
- type UntypedExpression = DOC
- data T shape t = T {}
- data SNat n where
- class (KnownLen s, All KnownNat s) => KnownShape s
- class KnownTyp t where
- class KnownBits t where
- class KnownKind t where
- type SList = SList' Proxy
- data SList' f s where
- type family PeanoLength xs :: Peano where ...
- withKnownNat :: forall k. Int -> (forall n. KnownNat n => Proxy n -> k) -> k
- class KnownLen s where
- shapeSListProxy :: KnownLen xs => proxy xs -> SList xs
- shapeToList' :: All KnownNat s => SList s -> [Integer]
- shapeToList :: forall s. KnownShape s => [Integer]
- showShape' :: [Integer] -> DOC
- showShape :: forall s. KnownShape s => DOC
- showShapeMinus :: forall s. KnownShape s => DOC
- showShapeLen :: forall s. KnownLen s => DOC
- rememberNat :: SNat n -> (KnownNat n => r) -> r
- type None = 514229
- showDim' :: String -> Integer -> DOC
- showDimM :: forall n. KnownNat n => DOC
- showDim :: forall n. KnownNat n => DOC
- str :: Show a => a -> DOC
- data ParamInfo = ParamInfo {
- paramName :: String
- paramShape :: [Integer]
- paramDType :: Typ
- paramVar :: forall s t. (KnownShape s, KnownTyp t) => Tensor s t
- data GState = GState {}
- newtype Gen x = Gen {}
- newParameter :: MonadState GState m => ParamInfo -> m ()
- peekAtAny :: String -> UntypedExpression -> Gen ()
- newVar :: Gen DOC
- gen :: DOC -> Gen ()
- setGen :: DOC -> Gen ()
- withDOC :: forall a. (DOC -> DOC) -> Gen a -> Gen a
- type Tensor shape = T shape
- (<--) :: DOC -> UntypedExpression -> Gen ()
- tuple :: [DOC] -> DOC
- dict :: [(String, DOC)] -> DOC
- funcall :: String -> [DOC] -> DOC
- funcall' :: DOC -> [DOC] -> DOC
- binOp :: forall s1 s2 s3 t1 t2 t3. String -> Tensor s1 t1 -> Tensor s2 t2 -> Tensor s3 t3
- unOp :: forall s1 s2 t1 t2. String -> Tensor s1 t1 -> Tensor s2 t2
- assign :: forall s t. T s t -> Gen (T s t)
- genFun :: forall b. String -> [DOC] -> Gen b -> Gen b
- lambda :: (T s t -> T s' t') -> Gen UntypedExpression
- generate :: Gen () -> (String, [ParamInfo])
- generateFile :: String -> Gen () -> IO ()
- named :: String -> DOC -> DOC
Documentation
knownProduct :: forall s k. KnownShape s => (KnownNat (Product s) => k) -> k Source #
splitApp' :: forall ys xs k. SList xs -> ((Take (PeanoLength xs) (xs ++ ys) ~ xs, Drop (PeanoLength xs) (xs ++ ys) ~ ys) => k) -> k Source #
splitApp :: forall xs ys k. KnownLen xs => ((Take (PeanoLength xs) (xs ++ ys) ~ xs, Drop (PeanoLength xs) (xs ++ ys) ~ ys) => k) -> k Source #
knownAppend' :: forall t s k. (All KnownNat s, KnownShape t) => SList s -> (KnownShape (s ++ t) => k) -> k Source #
knownAppend :: forall s t k. (KnownShape s, KnownShape t) => (KnownShape (s ++ t) => k) -> k Source #
V [a] |
(KnownTyp Typ t, All [Nat] KnownShape ys) => KnownTensors (HTV t ys) Source # | |
pattern VecPair :: forall s t s'. Tensor s t -> Tensor s' t -> HTV t ((:) Shape s ((:) Shape s' ([] Shape))) Source #
pattern VecTriple :: forall s t s' s3. Tensor s t -> Tensor s' t -> Tensor s3 t -> HTV t ((:) Shape s ((:) Shape s' ((:) Shape s3 ([] Shape)))) Source #
type family All (c :: k -> Constraint) (xs :: [k]) :: Constraint where ... Source #
Flip at type level
(KnownTyp Typ t, All [Nat] KnownShape ys) => KnownTensors (HTV t ys) Source # | |
htmap :: forall f ss t u. (forall s. Tensor s t -> Tensor (Ap f s) u) -> HTV t ss -> HTV u (Ap (FMap f) ss) Source #
KnownPeano Peano Zero Source # | |
KnownPeano Peano n => KnownPeano Peano (Succ n) Source # | |
class KnownPeano n where Source #
KnownPeano Peano Zero Source # | |
KnownPeano Peano n => KnownPeano Peano (Succ n) Source # | |
type UntypedExpression = DOC Source #
(KnownTyp Typ t, KnownShape shape) => KnownTensors (T shape t) Source # | |
(KnownTyp Typ t, All [Nat] KnownShape ys) => KnownTensors (HTV t ys) Source # | |
class (KnownLen s, All KnownNat s) => KnownShape s Source #
KnownShape ([] Nat) Source # | |
(KnownNat x, KnownShape xs) => KnownShape ((:) Nat x xs) Source # | |
type family PeanoLength xs :: Peano where ... Source #
PeanoLength '[] = Zero | |
PeanoLength (x ': xs) = Succ (PeanoLength xs) |
class KnownLen s where Source #
shapePeano :: SPeano (PeanoLength s) Source #
shapeSList :: SList s Source #
shapeSListProxy :: KnownLen xs => proxy xs -> SList xs Source #
shapeToList :: forall s. KnownShape s => [Integer] Source #
showShape' :: [Integer] -> DOC Source #
showShape :: forall s. KnownShape s => DOC Source #
showShapeMinus :: forall s. KnownShape s => DOC Source #
Show a shape, but None is replaced by "-1"
showShapeLen :: forall s. KnownLen s => DOC Source #
rememberNat :: SNat n -> (KnownNat n => r) -> r Source #
ParamInfo | |
|
newParameter :: MonadState GState m => ParamInfo -> m () Source #