mixed-types-num-0.5.9.1: Alternative Prelude with numeric and logic expressions typed bottom-up
Copyright(c) Michal Konecny
LicenseBSD3
Maintainermikkonecny@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Utils.TH.DeclForTypes

Description

Template Haskell utilities

Synopsis

Documentation

declForTypes :: [Q Type] -> (Q Type -> Q [Dec]) -> Q [Dec] Source #

A toy example of use:

class HasTT t where
  type TT t
  getTT :: t -> TT t

$(declForTypes
  [[t| Integer |], [t| Int |], [t| Rational |]]
  ( t -> [d|
    instance HasTT $t where
      type TT $t = ()
      getTT _ = ()
  |]))