Re: [Haskell-cafe] Data.Generics: how do I get the type name of a value?

2007-12-14 Thread Alistair Bayley
On 14/12/2007, Neil Mitchell <[EMAIL PROTECTED]> wrote: > > > http://haskell.org/hoogle/?q=typeOf > > Another great thing is that this bit also works in Hugs, while the > Data.Generics stuff is GHC only. Great, thanks. Didn't occur to me to look further up the class hierarchy :-) Alistair ___

Re: [Haskell-cafe] Data.Generics: how do I get the type name of a value?

2007-12-14 Thread Neil Mitchell
Hi > http://haskell.org/hoogle/?q=typeOf > > C:\>ghci > GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help > Loading package base ... linking ... done. > Prelude> :m Data.Typeable > Prelude Data.Typeable> typeOf "neil" > [Char] Another great thing is that this bit also works in Hugs, w

Re: [Haskell-cafe] Data.Generics: how do I get the type name of a value?

2007-12-14 Thread Neil Mitchell
Hi Alistair, http://haskell.org/hoogle/?q=typeOf C:\>ghci GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> :m Data.Typeable Prelude Data.Typeable> typeOf "neil" [Char] Thanks Neil On 12/14/07, Alistair Bayley <[EMAIL PROTECTED]>

[Haskell-cafe] Data.Generics: how do I get the type name of a value?

2007-12-14 Thread Alistair Bayley
I've been learning/playing with Data.Generics a bit, and have a how-to question... If I say > dataTypeOf "" then I get > DataType {tycon = "Prelude.[]", datarep = AlgRep [[],(:)]} No surprises there. But I'd really like to know that I have a String, or [Char]. How do I get the name of the concret