typecheck-plugin-nat-simple-0.1.0.9: Simple type check plugin which calculate addition, subtraction and less-or-equal-than
Safe HaskellNone
LanguageHaskell2010

Plugin.TypeCheck.Nat.Simple

Contents

Synopsis

PLUGIN

plugin :: Plugin Source #

 type L = Log SDocStr Var

 plugin :: Plugin
 plugin = typeCheckWith @L "Plugin.TypeCheck.Nat.Simple" \gs _ w ->
	tell @L $ "givens: " .+. fromSDoc (ppr gs)
	tell @L $ "wanted: " .+. fromSDoc (ppr w)
	uncurry canDerive
		=<< (,) <$> (givens =<< decodeAll gs) <*> (wanted =<< decode w)