[Haskell] "Never" GADT Function?

Ashley Yakeley ashley at semantic.org
Sat Jan 8 00:48:21 EST 2005


OK, so I've been playing around with GADTs in the CVS GHC. Consider this:

  data T a where
    BoolT :: T Bool
    IntT :: T Int

  neverT :: T Char -> x

Is it possible to write neverT without using undefined? Such functions 
are occasionally useful, especially when GADTs are being used as type 
witnesses.

Then again, I suppose it's the same situation for types with no 
constructors.

-- 
Ashley Yakeley, Seattle WA



More information about the Haskell mailing list