G'day all.
On Wed, Jun 25, 2003 at 08:48:12AM -0700, Hal Daume wrote:
> I'm not sure this is really necessary (at least syntax-wise).
Well, of course, no extension is absolutely necessary in a Turing-hard
language. :-)
For the record, here are a couple of other solutions which avoid the
problem
Hi
I did a Web application for the visualization of the type inference process for
the Simple Type System and pure ML. You can "play" with it at:
http://www.ncc.up.pt/typetool
I think it can be useful to Haskell programmers.
Comments are welcome,
Best regards
Hugo Simões
_
I'm not sure this is really necessary (at least syntax-wise).
We can do something like:
> data T a
> class Trait a where { trait :: T a -> Int }
>
> instance Trait Int where { trait _ = 0 }
> instance Trait Char where { trait _ = 1 }
As far as I can tell with the various --ddump-* flags, the c
Hi!
Keith Wansbrough wrote:
instance Op_plus MyInt MyInt where
instance (Num a) => Op_plus a MyInt where
instance (Num a) => Op_plus MyInt a where
[..]
Overlapping instance declarations:
multi.hs:9: Op_plus a MyInt
multi.hs:12: Op_plus MyInt a
Failed, modules loaded: none.
The GHC manual talk
Hi!
Koen Claessen wrote:
| instance (Num a) => Op_plus a MyInt where
| i `plus` (MyInt b) = i + b
Remember that b is of type Int, but you also say that i is
of any Num type. This clashes, since + requires both if its
arguments to hve the same types.
You are right! I did't notice that error.
| instance (Num a) => Op_plus a MyInt where
| i `plus` (MyInt b) = i + b
Remember that b is of type Int, but you also say that i is
of any Num type. This clashes, since + requires both if its
arguments to hve the same types.
/K
___
Haskell mail
> instance Op_plus MyInt MyInt where
> instance (Num a) => Op_plus a MyInt where
> instance (Num a) => Op_plus MyInt a where
[..]
> Overlapping instance declarations:
>multi.hs:9: Op_plus a MyInt
>multi.hs:12: Op_plus MyInt a
> Failed, modules loaded: none.
The GHC manual talks about this
Johannes Waldmann <[EMAIL PROTECTED]> writes:
>> x :: Foo <- [ .. ]
>
> A related point: the Haskell definition states that
For any type that is an instance of class Bounded as well as
Enum, the following should hold:
>
>> enumFrom and enumFromThen should be defined with an implicit bound, thus:
Hi!
Can somebody explain to me why ghc/hugs fails to compile the following
Haskell program? As long as MyInt is not an instance of Num the
compilations should succed... but it don't. :-( Why?
$ cat multi.hs
data MyInt = MyInt Int deriving Show
class Op_plus a b where
plus :: a -> b -> Int
i
CALL FOR PAPERS
Special Issue of Theory and Practice of Logic Programming on
Multiparadigm Languages and Constraint Programming
Guest Editors: Moreno Falaschi and Michael Maher
Following up on a series of 11 workshops (WFLP) on multiparadigm
languages and constraint programming, the journal on Th
Announcing the release of buddha version 0.8
www.cs.mu.oz.au/~bjpop/buddha
Buddha is a declarative debugger for Haskell 98. It is based on program
transformation and relies on GHC version 5.04 or greater (but not version 6
yet). It also needs GHC's
> PS: and enumFromThenTo should just be removed, alongside n+k patterns :-)
Even though enumFromThenTo is useful for Integral types and Rational?
[1,3 ..]
[0,1/2 .. 10] :: [Rational]
The only problems with enumFromThenTo come from providing Float and Double
instances (and are the same pr
Some thoughts on Enum, Bounded, and [ x .. y ] notation.
Sometimes I want to write
> x :: Foo <- [ .. ]
that is, an enumeration with both implicit lower and upper bound.
This is useful if the type is both an instance of Enum and Bounded.
Example: in module Foo, you have
> data Foo = A | B |
13 matches
Mail list logo