-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
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
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
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
> "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
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
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