Create a new Wanted constraint with the given CtLoc.
Moduleghc-tcplugins-extra-0.5Haskell2010
GHC.TcPluginM.Extra
- Cpp
Synopsis
- value newWanted
- value newGiven
- value evByFiatWithDependencies
- value evByFiat
- value lookupModule
- value lookupName
- value tracePlugin
- value flattenGivens
- value mkSubst
- value mkSubst'
- value substType
- value substCt
- Packageghc-tcplugins-extra-0.5
- Exports12
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourcePlugin.hs
Create new constraints
Create a new [G]iven constraint, with the supplied evidence. This must not
be invoked from tcPluginInit or tcPluginStop, or it will panic.
Creating evidence
The EvTerm equivalent for Unsafe.unsafeCoerce
evByFiat Deprecated. evByFiat creates proofs that can lead to unsoundness, use evByFiatWithDependencies instead. See also https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12037
The EvTerm equivalent for Unsafe.unsafeCoerce
Lookup
lookupModule :: ModuleNameName of the module
-> FastStringName of the package containing the module. NOTE: This value is ignored on ghc>=8.0.
-> TcPluginM Module
Find a module
Trace state of the plugin
Print out extra information about the initialisation, stop, and every run
of the plugin when -ddump-tc-trace is enabled.
Substitutions
Flattens evidence of constraints by substituting each others equalities.
NB: Should only be used on [G]iven constraints!
NB: Doesn't flatten under binders
Create simple substitution from type equalities
Create flattened substitutions from type equalities, i.e. the substitutions have been applied to each others right hand sides.
Apply substitutions in Types
NB: Doesn't substitute under binders
Apply substitution in the evidence of Cts