With both Singletons 1.0 and github master (as of e8a7d6031c) against ghc 7.8.3 I get the following error testing out some simple singletons examples both from Richard Eisenberg's presentation and around the web from reasonably recent blog posts and github projects (one of them shown below):
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
import Data.Singletons
import Data.Singletons.TH
main :: IO ()
main = return ()
$(singletons [d|
data Nat = Zero | Succ Nat
plus :: Nat -> Nat -> Nat
plus Zero n = n
plus (Succ m) n = Succ (plus m n)
|])
all attempts result in the same errors:
The exact Name ‘t_a6fM’ is not in scope
Probable cause: you used a unique Template Haskell name (NameU),
perhaps via newName, but did not bind it
If that's it, then -ddump-splices might be useful
The exact Name ‘t_a6fN’ is not in scope
Probable cause: you used a unique Template Haskell name (NameU),
perhaps via newName, but did not bind it
If that's it, then -ddump-splices might be useful
I'm new to Template Haskell so this may be a painfully obvious error, but can anyone tell me what I'm doing wrong or point me in the right direction?
ddump-splices output from ghc: http://lpaste.net/2641476385360576512