Neil Mitchell a écrit :
Use Derive, which does support Generics:
http://www-users.cs.york.ac.uk/~ndm/derive/
If you care about portability, and are not using some of the more
advanced features of Generics, then you might want to take a look at
Uniplate: http://www-users.cs.york.ac.uk/~ndm/unipl
Hi
> I have just discovered Generics in Haskell and, writing some code with
> GHC, I wondered about the portability of my code.
If you use Data.Generics, your code is not portable - no other Haskell
implementation supports the necessary bits.
> I can use the -fgenerics to automatically derive in
Hi,
I have just discovered Generics in Haskell and, writing some code with
GHC, I wondered about the portability of my code. It is possible I
overlooked something in the GHC documentation but I did not found a way
to obtain, let say, the haskell code for the derived classes. I mean,
having th
just try to compile it with
ghc -fallow-overlapping-instances -Wall --make Main.hs
or inseart sth. like this at the first line:
{-# OPTIONS -fglasgow-exts -fffi -fallow-undecidable-instances
-fallow-overlapping-instances #-}
- marc
Am Montag, 29. August 2005 05:25 schrieb Juan Carlos Arev
David Menendez wrote:
Juan Carlos Arevalo Baeza writes:
The way Haskell type classes
work, the overlap is determined without looking at the context, so "Show
a" will overlap with every possible instance for Show, including Show
Int, which is predefined.
Ah. :-P Bummer.
I'm not sure
Juan Carlos Arevalo Baeza writes:
>(BCC'ing the GHC bugs list)
>
>It seems like there's something very funky going on with GHC (6.4)
> and automatically deriving instances. Consider this code:
>
> ---8<--
> 1: class MyClass a
> 2:
> 3:instance MyClass
(BCC'ing the GHC bugs list)
It seems like there's something very funky going on with GHC (6.4)
and automatically deriving instances. Consider this code:
---8<--
1: class MyClass a
2:
3:instance MyClass a => Show a
4:
5:newtype Type1 = Type1 { unType1 ::
Hi Simon!
On Wed, Oct 13, 2004 at 01:21:26PM +0100, Simon Peyton-Jones wrote:
> Two fixes suggest themselves
>
> 1. Separate 'deriving' from the data type decl, so you can say
> derive( Data TA, Typeable TA )
> anywhere. People sometimes ask for this for other reasons.
Good thing. Plu
On Wed, 13 Oct 2004 13:21:26 +0100, Simon Peyton-Jones
<[EMAIL PROTECTED]> wrote:
> 1. Separate 'deriving' from the data type decl, so you can say
> derive( Data TA, Typeable TA )
> anywhere. People sometimes ask for this for other reasons.
>
> 2. Allow instances in hi-boot files
>
> Y
| If I have two modules which are mutually recursive;
|
| module A where
| import B
| data TA = TA TB deriving (Data, Typeable)
|
| module B where
| import A
| data TB = TB TA deriving (Data, Typeable)
|
| How do I go about writing a hi-boot that will work in GHC?
Good question. At the moment
Hi,
If I have two modules which are mutually recursive;
module A where
data TA = TA String deriving (Data, Typeable)
module B where
data TB = TB TA deriving (Data, Typeable)
How do I got about writing a hi-boot that will work in GHC? The problem
is that to do proper XML Schema mappi
11 matches
Mail list logo