Hi,
I declared a multi param type class as below:
*class MyString m c where
zIndex :: m - Int - c
zLength :: m - Int
zPack :: [c] - m
zEquals :: c -c - Bool
zWrap :: [c] - (m,AnExistingDataType)*
In the end I did not needed it for my program, but for those few
Hello Sai,
Monday, May 5, 2008, 7:52:29 PM, you wrote:
class MyString m c where
it should be
class MyString m c | m-c where
so ghc will realize that same m means the same c. read about
functional dependencies in ghc user manual
--
Best regards,
Bulat
On 5/5/08, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
The functional dependency MyString m c | m - c tells GHC that any
specific m determines a specific c. It doesn't matter what the type is
here, since it's not used in the definition of compareStr; but it must be
possible to know that
On 08-Jul-1998, Johannes Waldmann [EMAIL PROTECTED] wrote:
...
how would you resolve ambiguities?
probably by requiring an explicit type signature
at the point of usage.
fine, but then i'd like to have this in other cases as well,
finally arriving at Ada-style overloading
(a name may have
On 08-Jul-1998, Mariano Suarez Alvarez [EMAIL PROTECTED] wrote:
On Wed, 8 Jul 1998 [EMAIL PROTECTED] wrote:
Each expression then has a set of possible types, and the ambiguity is
resolved by an explicit type signature.
At present it is quite frustrating in Haskell that when a name
Ralf,
you want to lift this restriction:
The type of each class operation
must mention all of the class type variables.
how would you resolve ambiguities?
probably by requiring an explicit type signature
at the point of usage.
fine, but then i'd like to have this in other cases as well,
you want to lift this restriction:
The type of each class operation
must mention all of the class type variables.
how would you resolve ambiguities?
probably by requiring an explicit type signature
at the point of usage.
No longer ;-). I find SPJ's summary on
I think Simon or Alastair promised this in 2.0 (though it doesn't appear
on the list for 2.0...)
-Alex-
On Thu, 9 Jul 1998, Fergus Henderson wrote:
On 08-Jul-1998, Johannes Waldmann [EMAIL PROTECTED] wrote:
...
how would you resolve ambiguities?
probably by requiring an explicit type
Hello,
I decided to try and get my old multi-param. parser to work,
and got told-off by Haskell's parser:
Please tell me what I am doing wrong. The following program:
module A where
class (Monad m, Monad (t m)) = AMonadT t m where
lift :: m a - t m a
Gives me:
(lambda o) ghc
Dear Jon, dear Simon,
class (Monad m, Monad (t m)) = AMonadT t m where
lift :: m a - t m a
I'm frankly unsure of the consequences of lifting the
restriction. Can you give a compact summary of why you want
to? Our multi-parameter type-class paper gives none, and if
you've got one
A.hs:3:23: parse error on input: "("
I should have said that I've implemented the choices given
on the Standard Haskell web discussion page. In particular:
===
Choice 7a
~
The context in a class declaration (which introduces superclasses)
must constrain
I decided to try and get my old multi-param. parser to work,
and got told-off by Haskell's parser:
Please tell me what I am doing wrong. The following program:
module A where
class (Monad m, Monad (t m)) = AMonadT t m where
lift :: m a - t m a
Gives me:
(lambda o) ghc
12 matches
Mail list logo