[Haskell-cafe] :i and :t give different types

Chad Scherrer chad.scherrer at gmail.com
Thu Feb 7 13:40:47 EST 2008


Hello haskell-cafe,

In ghci, I tried to get info for Data.Stream.Stream:

$ ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> :m Data.Stream
Prelude Data.Stream> :i Stream
data Stream a where
  Stream :: forall a s.
            (Data.Stream.Unlifted s) =>
            !s -> Step a s -> !s -> Stream a
        -- Defined in Data.Stream
instance Functor Stream -- Defined in Data.Stream

This didn't seem right to me, so I asked tried this:

Prelude Data.Stream> :t Stream
Stream :: (Data.Stream.Unlifted s) => (s -> Step a s) -> s -> Stream a

What's going on here?

forall a s. (Data.Stream.Unlifted s) => !s -> Step a s -> !s -> Stream a
 and
(Data.Stream.Unlifted s) => (s -> Step a s) -> s -> Stream a

are completely different, right? And really, neither one makes much
sense to me. I would have expected

forall s. (Data.Stream.Unlifted s) => (s -> Step a s) -> s -> Stream a

-- 

Chad


More information about the Haskell-Cafe mailing list