Re: [Haskell-cafe] The Read Class

2006-10-29 Thread Tiago Veloso
Yes pleaseI wold like some examples (no importance how interesting) Maybe i can work my way from there.On 28 Oct 2006, at 23:32, Daniel Fischer wrote:Hi,probably the best way is to write a parser using ReadP/ReadPrec and theninstance Read SomeType where	readPrec = yourParserIf you wish, I could send you a few examples (not very interesting, but they might help getting you going).Cheers,DanielAm Samstag, 28. Oktober 2006 23:49 schrieb Tiago Veloso: Hi,I am trying to find out how to work with the Read Class for a schoolproject, i need to declare instances of Read for a few data types.My problem is that i do not know how to do it, i mean i do not knowhow to build a Read instance, i do know about it for the Show Class.Can some one help?ThanksTiago Veloso   Tiago Veloso ___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Read Class

2006-10-28 Thread Daniel Fischer
Hi,

probably the best way is to write a parser using ReadP/ReadPrec and then

instance Read SomeType where
readPrec = yourParser

If you wish, I could send you a few examples (not very interesting, but they 
might help getting you going).

Cheers,
Daniel


Am Samstag, 28. Oktober 2006 23:49 schrieb Tiago Veloso:
 Hi,

 I am trying to find out how to work with the Read Class for a school
 project, i need to declare instances of Read for a few data types.

 My problem is that i do not know how to do it, i mean i do not know
 how to build a Read instance, i do know about it for the Show Class.

 Can some one help?

 Thanks

 Tiago Veloso

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Read Class

2006-10-28 Thread Misha Aizatulin
Tiago Veloso wrote:
 I am trying to find out how to work with the Read Class for a school
 project, i need to declare instances of Read for a few data types.
 
 My problem is that i do not know how to do it, i mean i do not know how
 to build a Read instance, i do know about it for the Show Class.

  if you run ghc with -ddump-deriv, you will see the instances that get
generated when you use derive.

Cheers,
  Misha
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe