fpco / ide-backend

ide-backend drives the GHC API to build, query, and run your code
120 stars 17 forks source link

Obfuscated types for GADT constructors #68

Open edsko opened 11 years ago

edsko commented 11 years ago

Given

{-# LANGUAGE GADTs, KindSignatures, RankNTypes #-}

data Expr :: * -> * where
  Num  :: Int -> Expr Int
  Bool :: Bool -> Expr Bool
  Add  :: Expr Int -> Expr Int -> Expr Int
  Cond :: forall a. Expr Bool -> Expr a -> Expr a -> Expr a

the type reported for Num is

ghc-prim:GHC.Prim.~# * ($a) Int -> Int -> Expr ($a)

which is technically accurate but not very readable. Awaiting prioritization before trying to fix this (@snoyberg?).

snoyberg commented 11 years ago

@edsko Please provide me with an estimate of how long you think it will take to resolve this issue.