Open Icelandjack opened 7 years ago
The classic
instance Key Natural where
data TotalMap Natural val = NaturalMap (S.Stream val) deriving (Show, Functor)
(¡) :: TotalMap Natural val -> (Natural -> val)
NaturalMap str ¡ nat = str S.!! fromIntegral nat
tab :: (Natural -> val) -> TotalMap Natural val
tab f = NaturalMap (S.map f (S.iterate succ 0))
is a Comonad
if we define instance Key (Sum Natural)
. What is the best way to make TotalMap (key1, key2) val
an instance of Show
?
Is there a home for this class + associated data family?
A common example of data families
with some modification
can form a
Representable
functor for any instance ofKey
Since
TotalMap key
can be made an instance of all these nice classesAnd we can get any of these instances of
Key
automatically gets us all these nice things