Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- keepRedundantConstraint ∷ c ⇒ proxy c → ()
- data Proxy (t ∷ k) = Proxy
Documentation
keepRedundantConstraint ∷ c ⇒ proxy c → () Source #
Can be used to silence individual "redundant constraint" warnings
foo :: ConstraintUsefulForDebugging => ... foo = .. where _ = keepRedundantConstraint (Proxy @ConstraintUsefulForDebugging))
Convenience re-export
Proxy
is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically,
is a safer alternative to the
Proxy
:: Proxy
a
idiom.undefined
:: a
>>>
Proxy :: Proxy (Void, Int -> Int)
Proxy
Proxy can even hold types of higher kinds,
>>>
Proxy :: Proxy Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy