type-machine-0.1.0.1: Type-level functions for record types
Safe HaskellNone
LanguageHaskell2010

TypeMachine.TM

Synopsis

Monad

type TM a = WriterT [TypeMachineLog] Q a Source #

The TM (*TypeMachine*) monad can:

  • Emit warning messages (e.g. when omitting that does not exist)
  • Take advantage of the Q monad's features

runTM :: TM a -> Q a Source #

Execute a TM computation and issue logs using the Q monad

execTM :: TM a -> Q (a, [TypeMachineLog]) Source #

Runs a TM, returns the logs to issue and the computation result

Logging

addLog :: TypeMachineLog -> TM () Source #

Add a log message to issue

Utils

toType :: Name -> TM Type Source #

Takes an ADT name, returns the Type for that ADT

A utilitary function to use reifyType in the TM monad