Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type family NestedLists (dims :: [Nat]) a where ...
- chunkVector :: forall a. Int -> Vector a -> [Vector a]
- class Sizable (dims :: [Nat]) where
- nestLists :: Proxy dims -> Vector a -> NestedLists dims a
- unNestLists :: Proxy dims -> NestedLists dims a -> [a]
- gridSize :: Proxy dims -> Int
Documentation
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 Sizable (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 #
gridSize :: Proxy dims -> Int Source #
Get the total size of a Grid
of the given dimensions
gridSize (Proxy @'[2, 2]) == 4