[Haskell-cafe] Strafunski

2006-04-03 Thread Christopher Brown

Hi,

I am trying to use Strafunski with GHC 6.5 and was wondering if  
someone could help me. I have all the instances for Term and Typeable  
defined for my data types, but when I try to compile with GHC 6.5 I  
get lots of overlapping instance errors. In particular, it seems  
the instances I am using (generated by DrIFT) are clashing with the  
ones in Data.Typeable. Is there a way I can fix this?


Also I have heard that it is possible to add deriving Typeable to  
each data type and I don't need to use the instances I have created.  
However, now it complains that it can't find instances for Term - but  
I can't derive from Term. Does anyone have any ideas how I can get  
Strafunski working with GHC 6.5?


Thanks.

Chris.



Christopher Brown
PhD Student, University of Kent.
http://www.cs.kent.ac.uk/people/rpg/cmb21/
[EMAIL PROTECTED]



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


Re: [Haskell-cafe] Strafunski

2006-04-03 Thread Joost Visser

Hi Chris,

Changes in the libraries of GHC have broken Strafunski compatibility  
in the past. I have not upgraded to GHC 6.5 myself so I'm not sure if  
this is the case again. Which versions of DrIFT and Strafunski are  
you using?


Based on what you write, it seems new instances for Typeable have  
been added to the libs (possibly using deriving), which means some of  
your own instances are now redundant. You'll have to remove them  
(which will then break compatibility of your code with 6.4.1, sigh).


Alternatively, you may consider to switch from the drift-default  
mode of Strafunski to the deriving mode. This means that you will  
be relying on the Typeable+Data classes rather than on the Typeable 
+Term classes. You make the switch simply by changing the search  
path, all your strategic functions should work like before. I guess  
GHC 6.5 supports deriving both for Typeable and Data (personally, I  
prefer to use DriFT rather than the deriving clause, because it gives  
me a bit more control over visibility of instances). For details, see  
the section Supported models of functional strategies in the README  
file of StrategyLib.


Regards,
Joost

--
Dr. ir. Joost Visser   | Departamento de Informática
phone  +351-253-604461 | Universidade do Minho
fax+351-253-604471 | mailto:[EMAIL PROTECTED]
mobile +351-91-6253618 | http://www.di.uminho.pt/~joost.visser


On Apr 3, 2006, at 3:41 PM, Christopher Brown wrote:


Hi,

I am trying to use Strafunski with GHC 6.5 and was wondering if  
someone could help me. I have all the instances for Term and  
Typeable defined for my data types, but when I try to compile with  
GHC 6.5 I get lots of overlapping instance errors. In particular,  
it seems the instances I am using (generated by DrIFT) are clashing  
with the ones in Data.Typeable. Is there a way I can fix this?


Also I have heard that it is possible to add deriving Typeable to  
each data type and I don't need to use the instances I have  
created. However, now it complains that it can't find instances for  
Term - but I can't derive from Term. Does anyone have any ideas how  
I can get Strafunski working with GHC 6.5?


Thanks.

Chris.



Christopher Brown
PhD Student, University of Kent.
http://www.cs.kent.ac.uk/people/rpg/cmb21/
[EMAIL PROTECTED]



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


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


Re: [Haskell-cafe] Strafunski

2006-04-03 Thread Christopher Brown

Joost,

Thanks very much - this solved my problem!

Cheers

Chris.

On 3 Apr 2006, at 17:03, Joost Visser wrote:


Hi Chris,

Changes in the libraries of GHC have broken Strafunski  
compatibility in the past. I have not upgraded to GHC 6.5 myself so  
I'm not sure if this is the case again. Which versions of DrIFT and  
Strafunski are you using?


Based on what you write, it seems new instances for Typeable have  
been added to the libs (possibly using deriving), which means some  
of your own instances are now redundant. You'll have to remove them  
(which will then break compatibility of your code with 6.4.1, sigh).


Alternatively, you may consider to switch from the drift-default  
mode of Strafunski to the deriving mode. This means that you will  
be relying on the Typeable+Data classes rather than on the Typeable 
+Term classes. You make the switch simply by changing the search  
path, all your strategic functions should work like before. I guess  
GHC 6.5 supports deriving both for Typeable and Data (personally, I  
prefer to use DriFT rather than the deriving clause, because it  
gives me a bit more control over visibility of instances). For  
details, see the section Supported models of functional  
strategies in the README file of StrategyLib.


Regards,
Joost

--
Dr. ir. Joost Visser   | Departamento de Informática
phone  +351-253-604461 | Universidade do Minho
fax+351-253-604471 | mailto:[EMAIL PROTECTED]
mobile +351-91-6253618 | http://www.di.uminho.pt/~joost.visser


On Apr 3, 2006, at 3:41 PM, Christopher Brown wrote:


Hi,

I am trying to use Strafunski with GHC 6.5 and was wondering if  
someone could help me. I have all the instances for Term and  
Typeable defined for my data types, but when I try to compile with  
GHC 6.5 I get lots of overlapping instance errors. In  
particular, it seems the instances I am using (generated by DrIFT)  
are clashing with the ones in Data.Typeable. Is there a way I can  
fix this?


Also I have heard that it is possible to add deriving Typeable  
to each data type and I don't need to use the instances I have  
created. However, now it complains that it can't find instances  
for Term - but I can't derive from Term. Does anyone have any  
ideas how I can get Strafunski working with GHC 6.5?


Thanks.

Chris.



Christopher Brown
PhD Student, University of Kent.
http://www.cs.kent.ac.uk/people/rpg/cmb21/
[EMAIL PROTECTED]



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




Christopher Brown
PhD Student, University of Kent.
http://www.cs.kent.ac.uk/people/rpg/cmb21/
[EMAIL PROTECTED]



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