1{-# LANGUAGE NoImplicitPrelude #-}
3-- | A version of 'Data.TMap.TMap' parametrized by an interpretation @f@. This
4-- sort of parametrization may be familiar to users of @vinyl@ records.
6-- @'TypeRepMap' f@ is a more efficient replacement for @DMap
7-- 'Type.Reflection.TypeRep' f@ (where @DMap@ is from the @dependent-map@
10-- Here is an example of using 'Prelude.Maybe' as an interpretation, with a
11-- comparison to 'Data.TMap.TMap':
14-- 'Data.TMap.TMap' 'TypeRepMap' 'Prelude.Maybe'
15-- -------------- -------------------
16-- Int -> 5 Int -> Just 5
17-- Bool -> True Bool -> Nothing
18-- Char -> \'x\' Char -> Just \'x\'
21-- In fact, a 'Data.TMap.TMap' is defined as 'TypeRepMap'
22-- 'Data.Functor.Identity'.
24-- Since 'Type.Reflection.TypeRep' is poly-kinded, the interpretation can use
25-- any kind for the keys. For instance, we can use the 'GHC.TypeLits.Symbol'
26-- kind to use 'TypeRepMap' as an extensible record:
29-- newtype Field name = F (FType name)
31-- type family FType (name :: Symbol) :: Type
32-- type instance FType "radius" = Double
33-- type instance FType "border-color" = RGB
34-- type instance FType "border-width" = Double
37-- --------------------------------------
39-- "border-color" -> F (rgb 148 0 211)
40-- "border-width" -> F 0.5
71import Data.TypeRepMap.Internal
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list