Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Error messages.
Warning
This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.
If something here seems useful, please report it or create a pull request to export it from an external module.
Synopsis
- type family HasSum f where ...
- class Assert (pred :: Bool) (msg :: ErrorMessage)
- type AssertNoSum (constraint :: Type -> Constraint) a = Assert (Not (HasSum (Rep a))) (((('Text "Cannot derive " ':<>: 'ShowType constraint) ':<>: 'Text " instance for ") ':<>: 'ShowType a) ':<>: 'Text " due to sum type")
Documentation
class Assert (pred :: Bool) (msg :: ErrorMessage) Source #
type AssertNoSum (constraint :: Type -> Constraint) a = Assert (Not (HasSum (Rep a))) (((('Text "Cannot derive " ':<>: 'ShowType constraint) ':<>: 'Text " instance for ") ':<>: 'ShowType a) ':<>: 'Text " due to sum type") Source #
>>>
:set -XDeriveGeneric -XDerivingVia
>>>
import Generic.Data (Generically(..))
>>>
:{
data AB = A | B deriving stock Generic deriving Semigroup via Generically AB :} ... • Cannot derive Semigroup instance for AB due to sum type • When deriving the instance for (Semigroup AB)