Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type constraints and patterns for strict types.
Synopsis
- pattern Strict :: Strict a => a -> a
- pattern Rnf :: NFData a => a -> a
- type family Strict a :: Constraint where ...
- class StrictType (seen :: [*]) a
Documentation
pattern Rnf :: NFData a => a -> a Source #
A pattern that matches NFData
types only and forces values to rigid normal form
type family Strict a :: Constraint where ... Source #
A constraint that is satisfied only by strict types.
A type T is strict if
∀x :: T . rnf x = ⊥ <=> rwhnf x = ⊥
Mutually recursive types are experimentally supported but non regular types are not.
Strict d = StrictType '[d] d |
class StrictType (seen :: [*]) a Source #
An empty class to constrain strict types. An instance is an unchecked promise that a type is fully strict. No instances are needed for generic non-nested datatypes.
Define an instance as follows:
instance StrictType seen Foo