Re: [Haskell-cafe] Problems instancing a class

2006-02-18 Thread Stefan Holdermans
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Illegal instance declaration for `MyClass (HashTable String String)' (The instance type must be of form (T a b c) where T is not a synonym, and a,b,c are distinct type variables) In the instance declaration for `MyClass (HashTable String Str

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Benjamin Franksen
On Friday 17 February 2006 21:03, Juan Carlos Arevalo Baeza wrote: >What really got me is that if I don't use a type synonym: > > instance MyClass (HT.HashTable String String) where > htLookup h var = > do result <- HT.lookup h var > case result of > Not

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Juan Carlos Arevalo Baeza
Gerrit van den Geest wrote: Mark Mark Jones has (some time ago) also written a very detailed e-mail about this topic: http://www.haskell.org/pipermail/haskell/2000-October/006128.html I really don't understand anything spoken about in this message. I guess I need it translated into plain

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Gerrit van den Geest
Mark Mark Jones has (some time ago) also written a very detailed e-mail about this topic: http://www.haskell.org/pipermail/haskell/2000-October/006128.html Grt "type" introduce a type synonym, and Haskell98 forbids these in instances, so GHC complains. GHC also lifts this restriction when i

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Jared Updike
> "type" introduce a type synonym, and Haskell98 forbids these in > instances, so GHC complains. GHC also lifts this restriction when > invoked with -fglasgow-exts . > http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#type-synonyms > Flexible Instances will probably be a

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Roberto Zunino
Juan Carlos Arevalo Baeza wrote: > type Context = HT.HashTable String String [snip] > Illegal instance declaration for `MyClass Context' >(The instance type must be of form (T a b c) > where T is not a synonym, and a,b,c are distinct type variables) > In the instance declaration for `MyCl

[Haskell-cafe] Problems instancing a class

2006-02-17 Thread Juan Carlos Arevalo Baeza
So, consider this code: import Data.HashTable as HT class MyClass a where htLookup :: a -> String -> IO String type Context = HT.HashTable String String instance MyClass Context where htLookup h var = do result <- HT.lookup h var case result of Nothing