[Haskell-cafe] Is it a bug in haskell-src-meta package?
bob zhang
bobzhang1988 at gmail.com
Thu Sep 1 04:18:08 CEST 2011
于 11-8-31 下午10:01, Ivan Lazar Miljenovic 写道:
> On 1 September 2011 11:19, bob zhang<bobzhang1988 at gmail.com> wrote:
>> Hi, all
>>
>> parseExp "(,) 3 4 " =>
>>
>> Right (AppE (AppE (ConE GHC.Unit.(,)) (LitE (IntegerL 3))) (LitE
>> (IntegerL 4)))
>>
>> where's GHC.Unit.(,) ?
> GHC.Unit (like all GHC.* modules) is an internal module used by GHC to
> implement base, containers, etc. The actual definitions of tuples in
> the Prelude "come" from Data.Unit, which for GHC are just re-exported
> from GHC.Unit: http://haskell.org/ghc/docs/latest/html/libraries/base/src/Data-Tuple.html
>
Thanks for your quick-reply.
I tried this does not work.(simplified) in quasiquoter.
import Control.Arrow
import Control.Applicative
import Prelude hiding ((.), id)
import Control.Monad
import Control.Category
import Data.Derive.All
import Data.DeriveTH
import Test.QuickCheck
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Lib
import Language.Haskell.Meta
hs = QuasiQuoter { quoteExp = either fail return . parseExp }
---- top-level-------
[hs| (,) 3 4 |] will not compile
do you know how to fix it ?
Thank you !
Best, bob
More information about the Haskell-Cafe
mailing list