-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Type-indexed maps -- -- Maps where keys are types and values can have types depending on their -- keys. -- --
-- index @a (v :: TypeMap d) :: b ---- --
-- >>> let v = (0 :: Int) <| True <| "Hello" <| empty :: TypeMap '[ '("a", Int), '("b", Bool), '("c", String)]
--
-- >>> index @"c" v
-- "Hello"
--
index :: forall a d. KnownNat (Index a d) => TypeMap d -> Lookup a d
-- | Add an element to the beginning of a map. O(log n)
cons :: forall a d b. b -> TypeMap d -> TypeMap ('(a, b) : d)
infixr 5 `cons`
-- | Synonym of cons.
(<|) :: forall a d b. b -> TypeMap d -> TypeMap ('(a, b) : d)
infixr 5 <|
-- | Add an element to the end of a list. O(log n)
snoc :: forall a d b. (Last d ~ '(a, b)) => TypeMap (Init d) -> b -> TypeMap d
infixl 5 `snoc`
-- | Synonym of snoc.
(|>) :: forall a d b. (Last d ~ '(a, b)) => TypeMap (Init d) -> b -> TypeMap d
infixl 5 |>
module Data.TypeMap.Internal.List
-- | List-backed type-map.
newtype TypeList d
TypeList :: [Any] -> TypeList d
-- | Empty list.
empty :: TypeList '[]
-- | Access an element indexed by its type a. O(n)
--
-- If a is associated to b in the type list d:
--
-- -- index @a (l :: TypeList d) :: b ---- --
-- >>> let l = (0 :: Int) <| True <| "Hello" <| empty :: TypeList '[ '("a", Int), '("b", Bool), '("c", String)]
--
-- >>> index @"c" l
-- "Hello"
--
index :: forall a d. KnownNat (Index a d) => TypeList d -> Lookup a d
-- | Add an element to the beginning of a list. O(1)
cons :: forall a d b. b -> TypeList d -> TypeList ('(a, b) : d)
infixr 5 `cons`
-- | Synonym of cons.
(<|) :: forall a d b. b -> TypeList d -> TypeList ('(a, b) : d)
infixr 5 <|
-- | Add an element to the end of a list. O(n)
snoc :: forall a d b. (Last d ~ '(a, b)) => TypeList (Init d) -> b -> TypeList d
infixr 5 `snoc`
-- | Synonym of snoc.
(|>) :: forall a d b. (Last d ~ '(a, b)) => TypeList (Init d) -> b -> TypeList d
infixr 5 |>
module Data.TypeMap.Internal.Vector
-- | Vector-backed type-map.
newtype TypeVector d
TypeVector :: (Vector Any) -> TypeVector d
-- | Empty vector.
empty :: TypeVector '[]
-- | Access an element indexed by type a. O(1)
--
-- If a is associated to b in the type list d:
--
-- -- index @a (v :: TypeVector d) :: b ---- --
-- >>> let v = (0 :: Int) <| True <| "Hello" <| empty :: TypeVector '[ '("a", Int), '("b", Bool), '("c", String)]
--
-- >>> index @"c" v
-- "Hello"
--
index :: forall a d. KnownNat (Index a d) => TypeVector d -> Lookup a d
-- | Add an element to the beginning of a vector. O(n)
cons :: forall a d b. b -> TypeVector d -> TypeVector ('(a, b) : d)
infixr 5 `cons`
-- | Synonym of cons.
(<|) :: forall a d b. b -> TypeVector d -> TypeVector ('(a, b) : d)
infixr 5 <|
-- | Add an element to the end of a vector. O(n)
snoc :: forall a d b. (Last d ~ '(a, b)) => TypeVector (Init d) -> b -> TypeVector d
infixr 5 `snoc`
-- | Synonym of snoc.
(|>) :: forall a d b. (Last d ~ '(a, b)) => TypeVector (Init d) -> b -> TypeVector d
infixr 5 |>
module Data.TypeMap.List
-- | List-backed type-map.
data TypeList d
-- | Empty list.
empty :: TypeList '[]
-- | Access an element indexed by its type a. O(n)
--
-- If a is associated to b in the type list d:
--
-- -- index @a (l :: TypeList d) :: b ---- --
-- >>> let l = (0 :: Int) <| True <| "Hello" <| empty :: TypeList '[ '("a", Int), '("b", Bool), '("c", String)]
--
-- >>> index @"c" l
-- "Hello"
--
index :: forall a d. KnownNat (Index a d) => TypeList d -> Lookup a d
-- | Add an element to the beginning of a list. O(1)
cons :: forall a d b. b -> TypeList d -> TypeList ('(a, b) : d)
infixr 5 `cons`
-- | Synonym of cons.
(<|) :: forall a d b. b -> TypeList d -> TypeList ('(a, b) : d)
infixr 5 <|
-- | Add an element to the end of a list. O(n)
snoc :: forall a d b. (Last d ~ '(a, b)) => TypeList (Init d) -> b -> TypeList d
infixr 5 `snoc`
-- | Synonym of snoc.
(|>) :: forall a d b. (Last d ~ '(a, b)) => TypeList (Init d) -> b -> TypeList d
infixr 5 |>
-- | Convert from a list to a vector.
toVector :: TypeList d -> TypeVector d
module Data.TypeMap.Map
-- | IntMap-backed type-map.
data TypeMap d
-- | Empty vector.
empty :: TypeMap '[]
-- | Access an element indexed by type a. O(log n)
--
-- If a is associated to b in the type list d:
--
-- -- index @a (v :: TypeMap d) :: b ---- --
-- >>> let v = (0 :: Int) <| True <| "Hello" <| empty :: TypeMap '[ '("a", Int), '("b", Bool), '("c", String)]
--
-- >>> index @"c" v
-- "Hello"
--
index :: forall a d. KnownNat (Index a d) => TypeMap d -> Lookup a d
-- | Add an element to the beginning of a map. O(log n)
cons :: forall a d b. b -> TypeMap d -> TypeMap ('(a, b) : d)
infixr 5 `cons`
-- | Synonym of cons.
(<|) :: forall a d b. b -> TypeMap d -> TypeMap ('(a, b) : d)
infixr 5 <|
-- | Add an element to the end of a list. O(log n)
snoc :: forall a d b. (Last d ~ '(a, b)) => TypeMap (Init d) -> b -> TypeMap d
infixl 5 `snoc`
-- | Synonym of snoc.
(|>) :: forall a d b. (Last d ~ '(a, b)) => TypeMap (Init d) -> b -> TypeMap d
infixl 5 |>
module Data.TypeMap.Static
-- | Index of type key a in association list d.
-- | Type associated with a in d. If the key a
-- occurs multiple times, the first one is used.
-- | Last element of a list.
-- | All elements except the last one.
module Data.TypeMap.Vector
-- | Vector-backed type-map.
data TypeVector d
-- | Empty vector.
empty :: TypeVector '[]
-- | Access an element indexed by type a. O(1)
--
-- If a is associated to b in the type list d:
--
-- -- index @a (v :: TypeVector d) :: b ---- --
-- >>> let v = (0 :: Int) <| True <| "Hello" <| empty :: TypeVector '[ '("a", Int), '("b", Bool), '("c", String)]
--
-- >>> index @"c" v
-- "Hello"
--
index :: forall a d. KnownNat (Index a d) => TypeVector d -> Lookup a d
-- | Add an element to the beginning of a vector. O(n)
cons :: forall a d b. b -> TypeVector d -> TypeVector ('(a, b) : d)
infixr 5 `cons`
-- | Synonym of cons.
(<|) :: forall a d b. b -> TypeVector d -> TypeVector ('(a, b) : d)
infixr 5 <|
-- | Add an element to the end of a vector. O(n)
snoc :: forall a d b. (Last d ~ '(a, b)) => TypeVector (Init d) -> b -> TypeVector d
infixr 5 `snoc`
-- | Synonym of snoc.
(|>) :: forall a d b. (Last d ~ '(a, b)) => TypeVector (Init d) -> b -> TypeVector d
infixr 5 |>
-- | Convert from a vector to a list.
toList :: TypeVector d -> TypeList l