[Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Giuseppe Maggiore
Hi! Can anyone tell me why this code does not work? I cannot seem to figure why it is broken... {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances #-}

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Ivan Lazar Miljenovic
Giuseppe Maggiore giuseppe...@gmail.com writes: Hi! Can anyone tell me why this code does not work? I cannot seem to figure why it is broken... The error message (and how you got it) would help... {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances,

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Giuseppe Maggiore
The error message (obtained by loading the file with ghci) is: GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Chris Eidhof
What about this? {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances #-} data Data k = Pair Integer (() - k) data RecData = RecData (Data RecData)

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Giuseppe Maggiore
Well, first of all thanks! Second, why the need for explicit quantification? On Tue, Mar 16, 2010 at 2:39 AM, Chris Eidhof ch...@eidhof.nl wrote: What about this? {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts,

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Chris Eidhof
On 16 mrt 2010, at 10:58, Giuseppe Maggiore wrote: Well, first of all thanks! Second, why the need for explicit quantification? I'm not sure, but I think it has to do with ambiguity. I think it's similar to the problem: readShow :: (Read a, Show a) - String - String readShow = show . read