Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Generic.Data.Wrappers
Description
Wrappers for "free" generics, where the base case is handled for you.
Documentation
data EmptyRec0 (a :: k) Source #
Free generic wrapper where every field does "nothing" (e.g. mempty
.)
Maybe useful for testing?
Instances
Free generic wrapper where any field emits a type error.
Useful for generic functions on void or enum types.
Note that the type you use here must still fulfill any requirements e.g. for
generic foldMap
, it must be a Monoid
, even though the instance won't be
used. We could perhaps falsify these requirements with some dictionary
cleverness, which would make using this a little easier. But I think it would
be in bad taste.
Consider it a further-limited EmptyRec0
.