Hi,
you do realise that -fallow-incoherent-instances is enabling a hell.
What mostly happens is that the most general instance is chosen.
Which explains the error here: Say the confusing instance is chosen
(because it is generic) and hence the type checker tries to establish the
Confuse
read it, i.e., before a
first cup of coffee.
Sorry.
Regards,
Stefan
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
--
Ralf Laemmel
VU CWI, Amsterdam, The Netherlands
Hi Simon SD,
cc Simon PJ,
(Since the _evaluation_ does not terminate (rather than type checking),
this seems to imply that evaluation-time dictionary construction does
not terminate. Right?)
Anyhow, do this change, and your code works.
diff SDF.save SDF.hs
10c10
class (Data (DictClassA a) b,
Hi Simon (PJ),
cc Simon (DF),
I rather reckon we are facing a bug here.
The attached minimalised Foo.hs shows the offending code pattern.
With GHC 6.2 we get *** Exception: loop
With GHC 6.4 we get(still waiting for the rest of the string)
The scenario is about class/instance-head-level
It is called gunfold rather than gunfoldl
as you will see when you browse the Data.Generics.Basics.
Also, your gunfold code looks like it will not work.
Here is a simple example for Maybe:
gunfold k z con =
case constrIndex con of
1 - z Nothing -- no children
2 - k (z
I would like to see your code indeed ...
it seems the attachment was missing.
Anyway, I am not sure if it obvious or not,
but heterogenously typed lists can be nicely
modelled with Data.Typeable (!!!) I guess we
should add something like this to the module?
See
Hi Kean,
looks cool.
I get your point about static typing.
I guess that adding a fold operator would make your implementation more
complete.
Oleg has also encountered some of your operations (as you probably know):
http://www.haskell.org/pipermail/haskell/2003-August/012355.html
(Oleg also
MR K P SCHUPKE wrote:
Hi Oleg, I like the polymorphic list indexed by Ints... there
do seem to be a couple of differences between this and the list
indexed by natural numbers.
...
Agreed with these differences.
Another difference: it is initially a heterogeneous set
rather than list!
The problem is that constrFields is not included with 6.2.1.
You would need to build GHC from CVS.
It will be in 6.4 for sure.
And yes, you are right, there is no other way to get the names
of all fields of a constructor.
Ralf
Stefan Reich wrote:
In recent versions of the GHC libraries,
{-# OPTIONS -fglasgow-exts #-}
{-# OPTIONS -fallow-overlapping-instances #-}
{-
Hi Mike,
You might heterogeneous lists useful.
http://www.cwi.nl/~ralf/HList/
See the treatment of your example below.
Cheers,
Ralf
-}
import HList
import HTypeDriven
-- These are your two implementations.
10 matches
Mail list logo