type-interpreter-0.0.1: Interpreter for Template Haskell types

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeInterpreter

Synopsis

Documentation

fromType :: Type -> Q TypeExp Source #

Get the type expression for a Type. Attempts to reduce the resulting type expression.

fromName :: Name -> Q TypeExp Source #

Get the type expression for a Name. Attempts to reduce the resulting type expression.

substitute :: Name -> TypeExp -> TypeExp -> TypeExp Source #

substitute name typ exp replaces all occurences of name in exp with typ.

substituteAll :: Map Name TypeExp -> TypeExp -> TypeExp Source #

Just like substitute but for more variables.

reduce :: TypeExp -> TypeExp Source #

Try to reduce the given type expression as much as possible.

match :: TypeExp -> TypeExp -> Maybe (Map Name TypeExp) Source #

match pattern input pattern matches input against the given pattern.

familyExp :: Int -> ([TypeExp] -> TypeExp) -> TypeExp Source #

familyExp n impl creates a family expression with n parameters and implementation impl.