{-# LANGUAGE GADTs, KindSignatures, DataKinds, FlexibleInstances #-}

import Data.Thrist -- cabal install thrist-0.3

data Nat = Zt | St Nat

data At :: * -> Nat -> Nat -> * where
  HoldChar :: Char -> At Char n (St n)

instance Show (Thrist (At Char) m n) where
  show t = '"' : go t ('"':[])
    where -- go :: Thrist (At Char) m' n' -> String -> String
          go Nil acc = acc
          go (Cons (HoldChar c) rest) acc = c : go rest acc

{-

Results in:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.7.20121114 for x86_64-unknown-linux):
        tcTyVarDetails
<<details unavailable>>

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug


When the type declaration of 'go' is present,
this compiles.

-}
