[Haskell] simulating dependent types; ghc/ghci discrepancy

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Wed Apr 14 19:29:38 EDT 2004


On Wed, Apr 14, 2004 at 10:13:51AM -0400, John D. Barnett wrote:
> 
> *DepTest> :t Show' True
> Show' True :: Show'
> *DepTest> Show' x <- return $ Show' True
> *DepTest> :t x
> x :: forall a. a
> *DepTest> x
> getTcTyVar a {- tv aXJ -}
> getTcTyVar a {- tv aXJ -}
> getTcTyVar a {- tv aXJ -}
> getTcTyVar a {- tv aXJ -}
> getTcTyVar a {- tv aXJ -}
> getTcTyVar a {- tv aXJ -}
> Interrupted.
> 
> First, the type of x seems like it should be either Bool or (forall a. 
> Show a => a), but not (forall a.a). Second, egads, what did I do?
> 
> Is it possible to unwrap an existential type in ghci?

For me this seems to be a bug in GHCi.

BTW, this works:

*Exist> do Show' x <- return (Show' True); print x
True

I wonder if there a type in Haskell-with-extensions that could be
assigned to x?

Best regards,
Tom

-- 
.signature: Too many levels of symbolic links


More information about the Haskell mailing list