HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleconformance-0.1.0.0Haskell2010

Conformance

  • 4 types
  • 21 values
newtypenewtype ConformT ue fe w (m :: Type -> Type) a
#

A conforming monad transformer to compute a result according to a spec.

RFC 2119 describes these terms:

  1. MUST and MUST NOT: These describe absolute requirements or absolute prohibitions. However, some implementations still do not adhere to these. Some of those situations are fixable, and some are not.

If the situation is fixable, we error with an error of type ue.

If the situation is fixable, we can either error out (a strict implementation) with an error of type fe or apply the fix. The fe parameter represents fixable errors, which can either be emitted as warnings, or errored on. A predicate (fe -> Bool) decides whether to fix the error. (The predicate returns True if the fixable error is to be fixed.) 2. SHOULD and SHOULD NOT: These describe weaker requirements or prohibitions. The w parameter represents warnings to represent cases where requirements or prohibitions were violated.

Constructors

Instances7MonadError, MonadReader, MonadWriter, MonadTrans, Monad, Functor, …
datadata HaltReason ue fe
#
Instances4Eq, Show, Exception, MonadError
datadata Notes fe w
#

Constructors

Instances5Eq, Show, Semigroup, Monoid, MonadWriter
valuerunConformStrict :: Conform ue fe w a -> Either (Either ue (Notes fe w)) a
#

Don't fix any fixable errors, and don't allow any warnings either

This is standard-compliant, but potentially more strict than necessary.

valuetryConform
  1. :: Monad m
  2. => ConformT ue fe w m a
  3. -> ConformT ue fe w m (Maybe a)
#

Try to run a conform function, return Nothing if there were unfixable errors or unfixed fixable errors.