Safe Haskell | Safe-Infered |
---|
Anexperimental feature to override the Enumerable
instance for any type.
- type Override = DynMap Tag
- noOverride :: Override
- addOverride :: Enumerable a => Enumerate a -> Override -> Override
- override :: Enumerable a => Override -> Enumerate a
Documentation
addOverride :: Enumerable a => Enumerate a -> Override -> OverrideSource
override :: Enumerable a => Override -> Enumerate aSource
This function is best described with an example:
let e1 = override $ addOverride (unary printable
) noOverride :: Enumerate T
e1
enumerates values of type T
where all characters (accessed using
the Enumerable
instance for Char
) are printable. Sometimes this can save
you from placing lots of printable
modifiers in your instances or
newtypes in your data type definitions.
This works for any type (not just characters) as long as the instance does
not override the default definition of shared
so it does not use
tagShare
(no instance in the library does this).This function should not
be used for defining instances (doing so might increase memory usage).