Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Handy utilities for defining predicates.
Synopsis
- module Rerefined.Predicate
- newtype Typeably a = Typeably a
- class Typeable (a :: k)
- proxy# :: forall {k} (a :: k). Proxy# a
- validateFail :: forall p. Predicate p => Proxy# p -> String -> [RefineFailure String] -> Maybe (RefineFailure String)
- validateBool :: Predicate p => Proxy# p -> String -> Bool -> Maybe (RefineFailure String)
- predicateName1 :: forall p. Predicate p => String -> Int -> ShowS
- predicateName2 :: forall l r. (Predicate l, Predicate r) => String -> Int -> ShowS
Re-exports
module Rerefined.Predicate
Wrapper for using with DerivingVia
for instances which may be defined
using the data type's Typeable
instance.
The Typeable
version of Generically
.
Typeably a |
The class Typeable
allows a concrete representation of a type to
be calculated.
typeRep#
proxy# :: forall {k} (a :: k). Proxy# a #
Witness for an unboxed Proxy#
value, which has no runtime
representation.
Predicate validation
validateFail :: forall p. Predicate p => Proxy# p -> String -> [RefineFailure String] -> Maybe (RefineFailure String) Source #
Shortcut for returning a predicate validation failure.
validateBool :: Predicate p => Proxy# p -> String -> Bool -> Maybe (RefineFailure String) Source #
Shortcut for simply validating a Bool
.