Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type family AllC (c :: x -> Constraint) (ts :: [x]) :: Constraint where ...
- type family NestedLists (dims :: [Nat]) a where ...
- chunkVector :: forall a. Int -> Vector a -> [Vector a]
- class (AllC KnownNat dims, SingI dims, Enum (Coord dims), Bounded (Coord dims)) => Dimensions (dims :: [Nat]) where
- nestLists :: Proxy dims -> Vector a -> NestedLists dims a
- unNestLists :: Proxy dims -> NestedLists dims a -> [a]
Documentation
type family AllC (c :: x -> Constraint) (ts :: [x]) :: Constraint where ... Source #
type family NestedLists (dims :: [Nat]) a where ... Source #
Computes the level of nesting requried to represent a given grid dimensionality as a nested list
NestedLists [2, 3] Int == [[Int]] NestedLists [2, 3, 4] Int == [[[Int]]]
NestedLists '[] a = a | |
NestedLists (_ ': xs) a = [NestedLists xs a] |
class (AllC KnownNat dims, SingI dims, Enum (Coord dims), Bounded (Coord dims)) => Dimensions (dims :: [Nat]) where Source #
Represents valid dimensionalities. All non empty lists of Nats have an instance
nestLists :: Proxy dims -> Vector a -> NestedLists dims a Source #
unNestLists :: Proxy dims -> NestedLists dims a -> [a] Source #
Instances
(KnownNat x, Bounded (Coord xs), SingI xs, Dimensions (y ': xs)) => Dimensions (x ': (y ': xs)) Source # | |
Defined in Data.Grid.Internal.NestedLists nestLists :: Proxy (x ': (y ': xs)) -> Vector a -> NestedLists (x ': (y ': xs)) a Source # unNestLists :: Proxy (x ': (y ': xs)) -> NestedLists (x ': (y ': xs)) a -> [a] Source # | |
KnownNat x => Dimensions (x ': ([] :: [Nat])) Source # | |
Defined in Data.Grid.Internal.NestedLists nestLists :: Proxy (x ': []) -> Vector a -> NestedLists (x ': []) a Source # unNestLists :: Proxy (x ': []) -> NestedLists (x ': []) a -> [a] Source # |