Safe Haskell | None |
---|---|
Language | GHC2021 |
Rerefined.Simplify
Description
Primitive predicate simplifier.
The simplifier may not be expectected to consistently implement any transformations whatsoever. The only guarantees are
- the output has the same or fewer operations
- the output meaning is identical to the input
See Core
(internal module) for more details.
Synopsis
- type Simplify p = Simplify' p
- type TrySimplify p = TrySimplifyLoop p (SimplifyStep p)
- type AssertSimplified p = AssertSimplified' p (TrySimplify p)
Documentation
type Simplify p = Simplify' p Source #
Simplify the given predicate.
Returns the input predicate if we were unable to simplify.
type TrySimplify p = TrySimplifyLoop p (SimplifyStep p) Source #
Try to simplify the given predicate.
Returns Nothing
if we were unable to simplify.
type AssertSimplified p = AssertSimplified' p (TrySimplify p) Source #
Assert that a predicate may not be trivially simplified.
Returns the empty constraint on success, else emits a pretty type error.
Useful e.g. if you'd like to make sure a user isn't writing silly predicates.