fcf-containers-0.6.0: Data structures and algorithms for first-class-families
Copyright(c) gspia 2020-
LicenseBSD
Maintainergspia
Safe HaskellSafe
LanguageHaskell2010

Fcf.Data.MapC

Description

Fcf.Data.MapC

MapC provides an interface to mapping keys to values, which is similar to that given by the containers-package. Note that the this module still misses some of the methods that can be found in containers. If you need some, please do open up an issue or better, make a PR.

Many of the examples are from containers-package.

We call this MapC because name Map is reserved to the map-function in Fcf-package. The internal representation is type-level list. We hope that one day the internal representation is based on balanced trees similar to the one used in the containers.

Synopsis

MapC type

data MapC k v Source #

A type corresponding to Map in the containers. We call this MapC because name Map is reserved to the map-function in Fcf-package.

The representation is based on type-level lists. Please, do not use that fact but rather use the exposed API. (We hope to change the internal data type to balanced tree similar to the one used in containers. See TODO.md.)

Constructors

MapC [(k, v)] 

Instances

Instances details
type Eval (Empty :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Empty :: MapC k v -> Type) = 'MapC ('[] :: [(k, v)])
type Eval (FromList lst :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (FromList lst :: MapC k v -> Type) = 'MapC lst
type Eval (Partition f ('MapC lst) :: (MapC k v, MapC k v) -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Partition f ('MapC lst) :: (MapC k v, MapC k v) -> Type)
type Eval (Singleton k2 v2 :: MapC k1 v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Singleton k2 v2 :: MapC k1 v1 -> Type) = 'MapC '['(k2, v2)]
type Eval (Delete k2 ('MapC lst) :: MapC k1 v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Delete k2 ('MapC lst) :: MapC k1 v -> Type) = 'MapC (Eval (Filter (Not <=< ((TyEq k2 :: k1 -> Bool -> Type) <=< (Fst :: (k1, v) -> k1 -> Type))) lst))
type Eval (Union ('MapC lst1) ('MapC lst2) :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Union ('MapC lst1) ('MapC lst2) :: MapC k v -> Type)
type Eval (Filter f ('MapC lst) :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Filter f ('MapC lst) :: MapC k v -> Type) = 'MapC (Eval (Filter (f <=< (Snd :: (k, v) -> v -> Type)) lst))
type Eval (FilterWithKey f ('MapC lst) :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (FilterWithKey f ('MapC lst) :: MapC k v -> Type) = 'MapC (Eval (Filter (Uncurry f) lst))
type Eval (Intersection mp1 mp2 :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Intersection mp1 mp2 :: MapC k v -> Type)
type Eval (Difference mp1 mp2 :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Difference mp1 mp2 :: MapC k v -> Type)
type Eval (Insert k2 v2 ('MapC lst) :: MapC k1 v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Insert k2 v2 ('MapC lst) :: MapC k1 v1 -> Type) = If (Eval (Elem k2 =<< Map (Fst :: (k1, v1) -> k1 -> Type) lst)) ('MapC lst) ('MapC ('(k2, v2) ': lst))
type Eval (Adjust f k2 ('MapC lst) :: MapC k1 v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Adjust f k2 ('MapC lst) :: MapC k1 v -> Type)
type Eval (MapWithKey f mp :: MapC k v2 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (MapWithKey f mp :: MapC k v2 -> Type)
type Eval (Map f mp :: MapC k v2 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Map f mp :: MapC k v2 -> Type) = 'MapC (Eval ((Map (Second f :: (k, v1) -> (k, v2) -> Type) :: [(k, v1)] -> [(k, v2)] -> Type) =<< Assocs mp))
type Eval (InsertWith f k2 v2 ('MapC lst) :: MapC k1 v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (InsertWith f k2 v2 ('MapC lst) :: MapC k1 v1 -> Type)

Query

data Null :: MapC k v -> Exp Bool Source #

Null

Example

Expand
>>> :kind! Eval (Null =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Null =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool
= 'False
>>> :kind! Eval (Null =<< Empty)
Eval (Null =<< Empty) :: Bool
= 'True

Instances

Instances details
type Eval (Null ('MapC (_1 ': _2)) :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Null ('MapC (_1 ': _2)) :: Bool -> Type) = 'False
type Eval (Null ('MapC ('[] :: [(k, v)])) :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Null ('MapC ('[] :: [(k, v)])) :: Bool -> Type) = 'True

data Size :: MapC k v -> Exp Nat Source #

Size

Example

Expand
>>> :kind! Eval (Size =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Size =<< FromList '[ '(5,"a"), '(3,"b")]) :: Nat
= 2

Instances

Instances details
type Eval (Size ('MapC lst) :: Nat -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Size ('MapC lst) :: Nat -> Type) = Eval (Length lst)

data Lookup :: k -> MapC k v -> Exp (Maybe v) Source #

Lookup

Example

Expand
>>> :kind! Eval (Lookup 5 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Lookup 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Maybe Symbol
= 'Just "a"
>>> :kind! Eval (Lookup 7 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Lookup 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Maybe Symbol
= 'Nothing

Instances

Instances details
type Eval (Lookup k2 ('MapC ('(k3, v2) ': rst)) :: Maybe v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Lookup k2 ('MapC ('(k3, v2) ': rst)) :: Maybe v1 -> Type) = Eval (If (Eval (TyEq k2 k3)) (Pure ('Just v2)) (Lookup k2 ('MapC rst)))
type Eval (Lookup k2 ('MapC ('[] :: [(k1, v)])) :: Maybe v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Lookup k2 ('MapC ('[] :: [(k1, v)])) :: Maybe v -> Type) = 'Nothing :: Maybe v

data Member :: k -> MapC k v -> Exp Bool Source #

Member

Example

Expand
>>> :kind! Eval (Member 5 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Member 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool
= 'True
>>> :kind! Eval (Member 7 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Member 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool
= 'False

Instances

Instances details
type Eval (Member k2 mp :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Member k2 mp :: Bool -> Type) = Eval (Elem k2 =<< Keys mp)

data NotMember :: k -> MapC k v -> Exp Bool Source #

NotMember

Example

Expand
>>> :kind! Eval (NotMember 5 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (NotMember 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool
= 'False
>>> :kind! Eval (NotMember 7 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (NotMember 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: Bool
= 'True

Instances

Instances details
type Eval (NotMember k2 mp :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (NotMember k2 mp :: Bool -> Type) = Eval (Not =<< (Elem k2 =<< Keys mp))

data Disjoint :: MapC k v -> MapC k v -> Exp Bool Source #

Disjoint

Example

Expand
>>> :kind! Eval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")])))
Eval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")]))) :: Bool
= 'False
>>> :kind! Eval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(2,"B"), '(7,"C")])))
Eval (Disjoint (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(2,"B"), '(7,"C")]))) :: Bool
= 'True
>>> :kind! Eval (Disjoint (Eval Empty) (Eval Empty))
Eval (Disjoint (Eval Empty) (Eval Empty)) :: Bool
= 'True

Instances

Instances details
type Eval (Disjoint mp1 mp2 :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Disjoint mp1 mp2 :: Bool -> Type) = Eval ((Null :: MapC k v -> Bool -> Type) =<< Intersection mp1 mp2)

data Elems :: MapC k v -> Exp [v] Source #

Elems

Example

Expand
>>> :kind! Eval (Elems =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Elems =<< FromList '[ '(5,"a"), '(3,"b")]) :: [Symbol]
= '["a", "b"]
>>> :kind! Eval (Elems =<< Empty)
Eval (Elems =<< Empty) :: [v]
= '[]

Instances

Instances details
type Eval (Elems ('MapC lst) :: [b] -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Elems ('MapC lst) :: [b] -> Type) = Eval (Map (Snd :: (a, b) -> b -> Type) lst)

data Keys :: MapC k v -> Exp [k] Source #

Keys

Example

Expand
>>> :kind! Eval (Keys =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Keys =<< FromList '[ '(5,"a"), '(3,"b")]) :: [Nat]
= '[5, 3]
>>> :kind! Eval (Keys =<< Empty)
Eval (Keys =<< Empty) :: [k]
= '[]

Instances

Instances details
type Eval (Keys ('MapC lst) :: [b1] -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Keys ('MapC lst) :: [b1] -> Type) = Eval (Map (Fst :: (b1, b2) -> b1 -> Type) lst)

data Assocs :: MapC k v -> Exp [(k, v)] Source #

Assocs

Example

Expand
>>> :kind! Eval (Assocs =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Assocs =<< FromList '[ '(5,"a"), '(3,"b")]) :: [(Nat, 
                                                       Symbol)]
= '[ '(5, "a"), '(3, "b")]
>>> :kind! Eval (Assocs =<< Empty)
Eval (Assocs =<< Empty) :: [(k, v)]
= '[]

Instances

Instances details
type Eval (Assocs ('MapC lst) :: [(k, v)] -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Assocs ('MapC lst) :: [(k, v)] -> Type) = lst

Construction

data Empty :: Exp (MapC k v) Source #

Empty

Example

Expand
>>> :kind! (Eval Empty :: MapC Nat Symbol)
(Eval Empty :: MapC Nat Symbol) :: MapC Nat Symbol
= 'MapC '[]
>>> :kind! (Eval Empty :: MapC Int String)
(Eval Empty :: MapC Int String) :: MapC Int [Char]
= 'MapC '[]

See also the other examples in this module.

Instances

Instances details
type Eval (Empty :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Empty :: MapC k v -> Type) = 'MapC ('[] :: [(k, v)])

data Singleton :: k -> v -> Exp (MapC k v) Source #

Singleton

Example

Expand
>>> :kind! Eval (Singleton 1 "haa")
Eval (Singleton 1 "haa") :: MapC Nat Symbol
= 'MapC '[ '(1, "haa")]

Instances

Instances details
type Eval (Singleton k2 v2 :: MapC k1 v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Singleton k2 v2 :: MapC k1 v1 -> Type) = 'MapC '['(k2, v2)]

data Insert :: k -> v -> MapC k v -> Exp (MapC k v) Source #

Insert

Example

Expand
>>> :kind! Eval (Insert 3 "hih" =<< FromList '[ '(1,"haa"), '(2,"hoo")])
Eval (Insert 3 "hih" =<< FromList '[ '(1,"haa"), '(2,"hoo")]) :: MapC 
                                                                   Nat Symbol
= 'MapC '[ '(3, "hih"), '(1, "haa"), '(2, "hoo")]

Instances

Instances details
type Eval (Insert k2 v2 ('MapC lst) :: MapC k1 v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Insert k2 v2 ('MapC lst) :: MapC k1 v1 -> Type) = If (Eval (Elem k2 =<< Map (Fst :: (k1, v1) -> k1 -> Type) lst)) ('MapC lst) ('MapC ('(k2, v2) ': lst))

data InsertWith :: (v -> v -> Exp v) -> k -> v -> MapC k v -> Exp (MapC k v) Source #

InsertWith if old there, map if no old, add

Example

Expand
>>> :kind! Eval (InsertWith Append 5 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (InsertWith Append 5 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapC
                                                                          Nat Symbol
= 'MapC '[ '(5, "xxxa"), '(3, "b")]
>>> :kind! Eval (InsertWith Append 7 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (InsertWith Append 7 "xxx" =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapC
                                                                          Nat Symbol
= 'MapC '[ '(5, "a"), '(3, "b"), '(7, "xxx")]
>>> :kind! Eval (InsertWith Append 7 "xxx" =<< Empty)
Eval (InsertWith Append 7 "xxx" =<< Empty) :: MapC Nat Symbol
= 'MapC '[ '(7, "xxx")]

Instances

Instances details
type Eval (InsertWith f k2 v2 ('MapC lst) :: MapC k1 v1 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (InsertWith f k2 v2 ('MapC lst) :: MapC k1 v1 -> Type)

data Delete :: k -> MapC k v -> Exp (MapC k v) Source #

Delete

Example

Expand
>>> :kind! Eval (Delete 5 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Delete 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapC
                                                         Nat Symbol
= 'MapC '[ '(3, "b")]
>>> :kind! Eval (Delete 7 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Delete 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapC
                                                         Nat Symbol
= 'MapC '[ '(5, "a"), '(3, "b")]
>>> :kind! Eval (Delete 7 =<< Empty)
Eval (Delete 7 =<< Empty) :: MapC Nat v
= 'MapC '[]

Instances

Instances details
type Eval (Delete k2 ('MapC lst) :: MapC k1 v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Delete k2 ('MapC lst) :: MapC k1 v -> Type) = 'MapC (Eval (Filter (Not <=< ((TyEq k2 :: k1 -> Bool -> Type) <=< (Fst :: (k1, v) -> k1 -> Type))) lst))

Combine

data Union :: MapC k v -> MapC k v -> Exp (MapC k v) Source #

Union

Example

Expand
>>> :kind! Eval (Union (Eval (FromList '[ '(5,"a"), '(3,"b")])) (Eval (FromList '[ '(5,"A"), '(7,"c")])) )
Eval (Union (Eval (FromList '[ '(5,"a"), '(3,"b")])) (Eval (FromList '[ '(5,"A"), '(7,"c")])) ) :: MapC 
                                                                                                     Nat 
                                                                                                     Symbol
= 'MapC '[ '(7, "c"), '(5, "a"), '(3, "b")]

Instances

Instances details
type Eval (Union ('MapC lst1) ('MapC lst2) :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Union ('MapC lst1) ('MapC lst2) :: MapC k v -> Type)

data Difference :: MapC k v -> MapC k v -> Exp (MapC k v) Source #

Difference

Example

Expand
>>> :kind! Eval (Difference (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")])))
Eval (Difference (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")]))) :: MapC 
                                                                                                         Nat 
                                                                                                         Symbol
= 'MapC '[ '(3, "a")]

Instances

Instances details
type Eval (Difference mp1 mp2 :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Difference mp1 mp2 :: MapC k v -> Type)

data Intersection :: MapC k v -> MapC k v -> Exp (MapC k v) Source #

Intersection

Example

Expand
>>> :kind! Eval (Intersection (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")])))
Eval (Intersection (Eval (FromList '[ '(3,"a"), '(5,"b")])) (Eval (FromList '[ '(5,"B"), '(7,"C")]))) :: MapC 
                                                                                                           Nat 
                                                                                                           Symbol
= 'MapC '[ '(5, "b")]

Instances

Instances details
type Eval (Intersection mp1 mp2 :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Intersection mp1 mp2 :: MapC k v -> Type)

Modify

data Adjust :: (v -> Exp v) -> k -> MapC k v -> Exp (MapC k v) Source #

Adjust

Example

Expand
>>> :kind! Eval (Adjust (Append "new ") 5 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Adjust (Append "new ") 5 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapC
                                                                         Nat Symbol
= 'MapC '[ '(5, "new a"), '(3, "b")]
>>> :kind! Eval (Adjust (Append "new ") 7 =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (Adjust (Append "new ") 7 =<< FromList '[ '(5,"a"), '(3,"b")]) :: MapC
                                                                         Nat Symbol
= 'MapC '[ '(5, "a"), '(3, "b")]
>>> :kind! Eval (Adjust (Append "new ") 7 =<< Empty)
Eval (Adjust (Append "new ") 7 =<< Empty) :: MapC Nat Symbol
= 'MapC '[]

Instances

Instances details
type Eval (Adjust f k2 ('MapC lst) :: MapC k1 v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Adjust f k2 ('MapC lst) :: MapC k1 v -> Type)

data Map :: (v -> Exp w) -> MapC k v -> Exp (MapC k w) Source #

Instances

Instances details
type Eval (Map f mp :: MapC k v2 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Map f mp :: MapC k v2 -> Type) = 'MapC (Eval ((Map (Second f :: (k, v1) -> (k, v2) -> Type) :: [(k, v1)] -> [(k, v2)] -> Type) =<< Assocs mp))

data MapWithKey :: (k -> v -> Exp w) -> MapC k v -> Exp (MapC k w) Source #

Instances

Instances details
type Eval (MapWithKey f mp :: MapC k v2 -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (MapWithKey f mp :: MapC k v2 -> Type)

data Foldr :: (v -> w -> Exp w) -> w -> MapC k v -> Exp w Source #

Foldr

Fold the values in the map using the given right-associative binary operator, such that 'foldr f z == foldr f z . elems'.

Note: the order of values in MapC is not well defined at the moment.

Example

Expand
>>> :kind! Eval (Fcf.Data.MapC.Foldr (+) 0  =<< (FromList '[ '(1,1), '(2,2)]))
Eval (Fcf.Data.MapC.Foldr (+) 0  =<< (FromList '[ '(1,1), '(2,2)])) :: Nat
= 3

Instances

Instances details
type Eval (Foldr f w mp :: a -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Foldr f w mp :: a -> Type) = Eval ((Foldr f w :: [v] -> a -> Type) =<< Elems mp)

data Filter :: (v -> Exp Bool) -> MapC k v -> Exp (MapC k v) Source #

Filter

Example

Expand
>>> :kind! Eval (Filter ((>=) 35) =<< FromList '[ '(5,50), '(3,30)])
Eval (Filter ((>=) 35) =<< FromList '[ '(5,50), '(3,30)]) :: MapC 
                                                               Nat Nat
= 'MapC '[ '(3, 30)]

Instances

Instances details
type Eval (Filter f ('MapC lst) :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Filter f ('MapC lst) :: MapC k v -> Type) = 'MapC (Eval (Filter (f <=< (Snd :: (k, v) -> v -> Type)) lst))

data FilterWithKey :: (k -> v -> Exp Bool) -> MapC k v -> Exp (MapC k v) Source #

FilterWithKey

Example

Expand
>>> :kind! Eval (FilterWithKey (>=) =<< FromList '[ '(3,5), '(6,4)])
Eval (FilterWithKey (>=) =<< FromList '[ '(3,5), '(6,4)]) :: MapC
                                                               Nat Nat
= 'MapC '[ '(6, 4)]

Instances

Instances details
type Eval (FilterWithKey f ('MapC lst) :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (FilterWithKey f ('MapC lst) :: MapC k v -> Type) = 'MapC (Eval (Filter (Uncurry f) lst))

data Partition :: (v -> Exp Bool) -> MapC k v -> Exp (MapC k v, MapC k v) Source #

Partition

Example

Expand
>>> :kind! Eval (Partition ((>=) 35) =<< FromList '[ '(5,50), '(3,30)])
Eval (Partition ((>=) 35) =<< FromList '[ '(5,50), '(3,30)]) :: (MapC 
                                                                   Nat Nat, 
                                                                 MapC Nat Nat)
= '( 'MapC '[ '(3, 30)], 'MapC '[ '(5, 50)])

Instances

Instances details
type Eval (Partition f ('MapC lst) :: (MapC k v, MapC k v) -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (Partition f ('MapC lst) :: (MapC k v, MapC k v) -> Type)

List

data FromList :: [(k, v)] -> Exp (MapC k v) Source #

Use FromList to construct a MapC from type-level list.

Example

Expand
>>> :kind! Eval (FromList '[ '(1,"haa"), '(2,"hoo")])
Eval (FromList '[ '(1,"haa"), '(2,"hoo")]) :: MapC Nat Symbol
= 'MapC '[ '(1, "haa"), '(2, "hoo")]

Instances

Instances details
type Eval (FromList lst :: MapC k v -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (FromList lst :: MapC k v -> Type) = 'MapC lst

data ToList :: MapC k v -> Exp [(k, v)] Source #

ToList

Example

Expand
>>> :kind! Eval (ToList =<< FromList '[ '(5,"a"), '(3,"b")])
Eval (ToList =<< FromList '[ '(5,"a"), '(3,"b")]) :: [(Nat, 
                                                       Symbol)]
= '[ '(5, "a"), '(3, "b")]
>>> :kind! Eval (ToList =<< Empty)
Eval (ToList =<< Empty) :: [(k, v)]
= '[]

Instances

Instances details
type Eval (ToList ('MapC lst) :: [(k, v)] -> Type) Source # 
Instance details

Defined in Fcf.Data.MapC

type Eval (ToList ('MapC lst) :: [(k, v)] -> Type) = lst