id summary reporter owner description type status priority milestone component version resolution keywords cc os architecture failure testcase blockedby blocking related differential
1849 Template Haskell: reify is not consistent with the special constructors ListT and TupleT guest "While reify provides consistent type information for arrows (i.e. returns the special ArrowT constructor and not ConT ""GHC.Prim.(->)""), that doesn't happen with ListT and TupleT.
{{{
Prelude> :m +Language.Haskell.TH
Prelude Language.Haskell.TH> let seeType n = do {VarI _ t _ _ <- reify n; runIO $ putStrLn $ show t; [|1|]}
Prelude Language.Haskell.TH> let {f = undefined :: Int -> Int; g = undefined :: [Int]; h = undefined :: (Int, Int)}
Prelude Language.Haskell.TH> $(seeType (mkName ""f""))
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
1
Prelude Language.Haskell.TH> $(seeType (mkName ""g""))
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
1
Prelude Language.Haskell.TH> $(seeType (mkName ""h""))
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
1
}}}
For g and h the expected returned types are:
{{{
AppT ListT (ConT GHC.Base.Int)
AppT (AppT (TupleT 2) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
}}}
" bug closed normal ⊥ Template Haskell 6.8.1 fixed alfonso.acosta@… eir@… Unknown/Multiple Unknown/Multiple None/Unknown T1849