RE: [Haskell] Ambiguous type variable when using Data.Generic

2006-05-20 Thread Ralf Lammel
Subject: [Haskell] Ambiguous type variable when using Data.Generic > > Hello, > > I'm writing a function 'preProcess' that simplifies the AST that comes out > of > Language.Haskell.Parser.parseModule. Simplifying means rewriting infix > applications to normal p

Re: [Haskell] Ambiguous type variable when using Data.Generic

2006-05-20 Thread Taral
On 5/20/06, Bas van Dijk <[EMAIL PROTECTED]> wrote: simplifyExp (HsLeftSection e op)= HsApp (opToExp op) e simplifyExp (HsRightSection op e) = HsApp (opToExp op) e By the way, I think this looks wrong. One of these needs to create a lambda expression. -- Taral <[EMAIL PROTECTED]>

Re: [Haskell] Ambiguous type variable when using Data.Generic

2006-05-20 Thread Taral
On 5/20/06, Bas van Dijk <[EMAIL PROTECTED]> wrote: How can I make this work? As far as I know, you can't. To see the problem, rewrite it using dictionaries: data Simplify a = Simplify { simplify :: a -> a } simplify_HsExp (HsInfixApp e1 op e2) = HsApp (HsApp (opToExp op) e1) e2 simplify_HsEx

Re: [Haskell] Ambiguous type variable when using Data.Generic

2006-05-20 Thread Neil Mitchell
Hi Bas, I had a requirement to do something similar as part of one of my projects, essentially reduce full Haskell to a small and manageable subset. Unfortunately I think you'll find that this task is a lot bigger than you first realise, and in particular that case-of is probably the expression y

[Haskell] Ambiguous type variable when using Data.Generic

2006-05-20 Thread Bas van Dijk
Hello, I'm writing a function 'preProcess' that simplifies the AST that comes out of Language.Haskell.Parser.parseModule. Simplifying means rewriting infix applications to normal prefix applications (in both patterns and expressions), removing parentheses, rewriting guards to if-then-else expr