Re: ghc7 typing problem

2010-10-25 Thread Christian Maeder
Again thanks, it works with ghc 7.1.20101024

C.

Am 18.10.2010 18:16, schrieb Simon Peyton-Jones:
 Thanks.  We knew about this -- in flight changes happening now -- but I've 
 added it as a new regression test even so.
 
 Simon
 
 | -Original Message-
 | From: Christian Maeder [mailto:christian.mae...@dfki.de]
 | Sent: 15 October 2010 17:53
 | To: GHC Users Mailing List
 | Cc: Simon Peyton-Jones
 | Subject: ghc7 typing problem
 | 
 | Hi,
 | 
 | I've looked at:
 | http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7
 | 
 | but still have a problem with the attached program that fails with:
 | 
 | GHCi, version 7.1.20101010: http://www.haskell.org/ghc/  :? for help 
 Loading package
 | ghc-prim ... linking ... done.
 | Loading package integer-gmp ... linking ... done.
 | Loading package base ... linking ... done.
 | Loading package ffi-1.0 ... linking ... done.
 | [1 of 1] Compiling Main ( HasKey.hs, interpreted )
 | 
 | HasKey.hs:17:10:
 | Couldn't match type `key' with `key1'
 |   because this skolem type variable would escape: `key1'
 | This skolem is bound by the instance declaration
 | In the instance declaration for `Ord (Keyed x)'
 | 
 | at the final instance for Ord.
 | 
 | The original code comes from
 | http://hackage.haskell.org/packages/archive/uni-util/2.2.0.0/doc/html/Util-
 | VariableSet.html
 | 
 | Cheers Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: ghc7 typing problem

2010-10-18 Thread Simon Peyton-Jones
Thanks.  We knew about this -- in flight changes happening now -- but I've 
added it as a new regression test even so.

Simon

| -Original Message-
| From: Christian Maeder [mailto:christian.mae...@dfki.de]
| Sent: 15 October 2010 17:53
| To: GHC Users Mailing List
| Cc: Simon Peyton-Jones
| Subject: ghc7 typing problem
| 
| Hi,
| 
| I've looked at:
| http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7
| 
| but still have a problem with the attached program that fails with:
| 
| GHCi, version 7.1.20101010: http://www.haskell.org/ghc/  :? for help Loading 
package
| ghc-prim ... linking ... done.
| Loading package integer-gmp ... linking ... done.
| Loading package base ... linking ... done.
| Loading package ffi-1.0 ... linking ... done.
| [1 of 1] Compiling Main ( HasKey.hs, interpreted )
| 
| HasKey.hs:17:10:
| Couldn't match type `key' with `key1'
|   because this skolem type variable would escape: `key1'
| This skolem is bound by the instance declaration
| In the instance declaration for `Ord (Keyed x)'
| 
| at the final instance for Ord.
| 
| The original code comes from
| http://hackage.haskell.org/packages/archive/uni-util/2.2.0.0/doc/html/Util-
| VariableSet.html
| 
| Cheers Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


ghc7 typing problem

2010-10-15 Thread Christian Maeder
Hi,

I've looked at:
http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7

but still have a problem with the attached program that fails with:

GHCi, version 7.1.20101010: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main ( HasKey.hs, interpreted )

HasKey.hs:17:10:
Couldn't match type `key' with `key1'
  because this skolem type variable would escape: `key1'
This skolem is bound by the instance declaration
In the instance declaration for `Ord (Keyed x)'

at the final instance for Ord.

The original code comes from
http://hackage.haskell.org/packages/archive/uni-util/2.2.0.0/doc/html/Util-VariableSet.html

Cheers Christian
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}

class Ord key = HasKey x key | x - key where
   toKey :: x - key

newtype Keyed x = Keyed { unKey :: x }

lift :: (HasKey x1 key1,HasKey x2 key2)
   = (key1 - key2 - a) - (Keyed x1 - Keyed x2 - a)
lift f x1 x2 = f (toKey . unKey $ x1) (toKey . unKey $ x2)

instance HasKey x key = Eq (Keyed x) where
   (==) = lift (==)

instance HasKey x key = Ord (Keyed x)
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users