Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / T13659.hs
1 {-# LANGUAGE GADTs, EmptyDataDecls, TypeFamilies, TypeOperators, DataKinds, FlexibleInstances #-}
2
3 {- Defines a C-like printf function using DataKinds extensions. -}
4
5 module T13659 where
6
7 import Data.Kind (Type)
8
9 -- format string parameterized by a list of types
10 data Format (fmt :: [Type]) where
11 X :: Format '[] -- empty string, i.e. ""
12 L :: a -> String -> Format '[] -- string literal, e.g. "hello"
13 S :: a -> Format '[String] -- "%s"
14 I :: Format a -> Format '[Int, a] -- "%d"