Re: [Haskell-cafe] Deriving with generics without values

2013-07-14 Thread Roman Cheplyaka
Forgot to mention — a good explanation of GHC Generics is the paper A Generic Deriving Mechanism for Haskell. Roman * Roman Cheplyaka r...@ro-che.info [2013-07-14 18:21:58+0300] Hi, (Redirecting this back to cafe to keep it discoverable — hope you don't mind.) * JP Moresmau

Re: [Haskell-cafe] Deriving with generics without values

2013-07-14 Thread Roman Cheplyaka
Hi, (Redirecting this back to cafe to keep it discoverable — hope you don't mind.) * JP Moresmau jpmores...@gmail.com [2013-07-14 16:02:56+0200] Hello, sorry to bother you after you've been kind enough to answer me on the list! I've looked a the smallcheck code but I don't see how to apply it

[Haskell-cafe] Deriving with generics without values

2013-07-12 Thread JP Moresmau
Hello all, My problem is the following: I have my own data types, and I'd like to derive automatically instances of some type class from them. I've started looking at GHC.Generics, which offer tools to do exactly that. However, some functions of my typeclass do not take my data type as a

Re: [Haskell-cafe] Deriving with generics without values

2013-07-12 Thread Roman Cheplyaka
Well, in your case, you need not 'from', but 'to', in order to convert from a generic representation to yours. Take a look at how a similar task is done in SmallCheck: https://github.com/feuerbach/smallcheck/blob/master/Test/SmallCheck/Series.hs#L180

Re: [Haskell-cafe] Deriving with generics without values

2013-07-12 Thread JP Moresmau
Yes, this looks like a similar task, thanks a million! JP On Fri, Jul 12, 2013 at 10:57 AM, Roman Cheplyaka r...@ro-che.info wrote: Well, in your case, you need not 'from', but 'to', in order to convert from a generic representation to yours. Take a look at how a similar task is done in