{-# LANGUAGE TemplateHaskell, BlockArguments, DataKinds #-} module Test where import GHC.TypeLits (Nat) import Language.Haskell.TH (litT, numTyLit) class ValidINTn (n :: Nat) flip foldMap [1..32] \i -> [d| instance ValidINTn $(litT (numTyLit i)) |]