RE: n+k patterns

2002-01-30 Thread Rijk J. C. van Haaften
At 03:27 30-01-02 -0800, Simon Peyton-Jones wrote: >| hbc is on the Integral side, if that counts. :-) >| Just because ghc doesn't follow the spec isn't a good reason >| to change the spec. :-) > >I absolutely didn't say that! All I'm saying is > >* Two of the four impls have to change regardless

Re: Problem with 'nested' pattern matching

2002-02-01 Thread Rijk J . C . van Haaften
carlos wrote: Hello. I'm having some trouble trying to understand exactly what's behind the rule for pattern-matching with data constructors. The code I'm having trouble with is similar to this: f (C p1 p2 (C2 p3 p4)) = ... f _ = False What happens is if f is called with (C p1 p2 (N

Re: Specifying Kinds of Types

2002-02-08 Thread Rijk J . C . van Haaften
Ashley Yakeley wrote: >I'd like to be able to declare the kinds of new types and synonyms, >because sometimes Haskell can't infer them. For instance: > > data CMap0 p q = MkCMap0; > >Without evidence, Haskell assumes that p and q have kind '*' (as per sec. >4.6), and therefore CMap0 has kind '

ANNOUNCE: Haskell support for JCreator update

2002-02-13 Thread Rijk J . C . van Haaften
Dear reader, I'm pleased to announce the availability of a release of the Haskell module for JCreator. You can get it, as usual, at http://www.students.cs.uu.nl/people/rjchaaft/JCreator The previous update lacks the documentation tool, and is quite restrictive concerning the location of Hugs,

Re: a universal printer for Haskell?

2002-02-18 Thread Rijk J . C . van Haaften
Hello, Bernard wrote: <> >But the problem is not solved (drum roll please). Even first time programmers >know the pitfalls of trying to show the empty list: > >show [] ---> kapow! > >But you ought to be able to print the empty list, >without having to make some bogus type qualification (which

Why is this function type-correct

2002-03-04 Thread Rijk J. C. van Haaften
Hello, Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a -> b x = x 42 is equally well accepted, though I can't see why this type would be corr

Why is this function type-correct

2002-03-04 Thread Rijk J. C. van Haaften
Hello, Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a -> b x = x 42 is equally well accepted, though I can't see why this type would be corr

Bug in Hugs Dec 2001: type inferencer incorrect!

2002-03-06 Thread Rijk J. C. van Haaften
Hello everybody, Although I didn't manage to reproduce the bug with a minimal example, I think it is still important enough to tell you (and especially the Hugs writers and maintainers). Yesterday evening, I tried to add some correct (!) code (by-hand-verifyable; by GHC accepted; just using plai

Rectification Hugs bug

2002-03-07 Thread Rijk J. C. van Haaften
Dear all, After intensive investication of several people here at Utrecht University, these are the results 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the curr

Rectification Hugs bug

2002-03-07 Thread Rijk J. C. van Haaften
Dear all, After intensive investication of several people at Utrecht University, these are the results: 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the current dist

Re: Haskell puzzles!

2002-03-21 Thread Rijk J. C. van Haaften
Zdenek Dvorak wrote: >>- >>1) Are e1 and e2 equal? >> >> > f (x:xs) y = x >> > g (x:xs)= \y -> x >> > >> > e1 = seq (f []) 1 >> > e2 = seq (g []) 1 > >Should not these be > >f (x:xs) y = y >g (x:xs)= \y -> y >? >Otherwise, both e1 and e

Re: Hugs Bug !

2002-03-21 Thread Rijk J. C. van Haaften
>but in windows 2000 > >Then suddnly interpreter fails and >the red (X) popup window pops up. > >hugs.exe - application programm error > > unknown software exception (0xc000fd) ... blabla Are you sure you have the very very very latest download? There have been some undocumented updates of t

Re: Typo: Hugs Bug ! >> it was +

2002-03-22 Thread Rijk J. C. van Haaften
Ahn Ki-yung wrote: >Prelude> f 1 where f x = x : f x >[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, >,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, >,1,1,{Interrupted!} > >Prelude> f 1 where f x = x + f x --> Immediate (!) crash Indeed, I could reproduce this on my

Re: ANNOUNCE: Object I/O released

2002-04-08 Thread Rijk J. C. van Haaften
Hello all, Peter Achten and Arjan van IJzendoorn wrote: >I <...> unfortunately could not open the .zip files and Peter asked >Could you check the formats of these files? After having tried to download the file a few times, I believe the problem is not in the zip file format, but download failur

Re: ANNOUNCE: Object I/O released

2002-04-09 Thread Rijk J. C. van Haaften
>The quick reference still gives problems. I managed to download the quick reference. Get it at http://www.students.cs.uu.nl/people/rjchaaft/ObjectIO/objectio-ref.zip This is a very temporarily available service, so if anyone has a suitable server (again, cvs.haskell.org?), please take over hos

3 `\x y -> x + y` 4 `\x y -> x + y` 5

2002-08-22 Thread Rijk J. C. van Haaften
Hello everybody, Every now and then I hear people complain that writing expressions like in the subject line is impossible, though desirable in some cases. Today, I ran into a situation where I really needed that feature, because I were working with a code generator (UU_AG) that allows just infi

RE: 3 `\x y -> x + y` 4 `\x y -> x + y` 5

2002-08-22 Thread Rijk J. C. van Haaften
>module InfixFunction where > >-- This is a flipped $ >infixl 0 $- >($-) :: a -> (a -> b) -> b >($-) x f = f x > >example1 :: Int >example1 = >-- 3`\x y -> x + y` 4 > 3 $- (\y x -> x + y) 4 > >example2 :: Int >example2 = >-- 1`\x y -> x + y` 2`\x y -> x` 3 > 1

RE: 3 `\x y -> x + y` 4 `\x y -> x + y` 5: Wrong version pasted

2002-08-22 Thread Rijk J. C. van Haaften
I pasted the wrong version into the mail. This is the final one: module InfixFunction where infixl 0 $- infixr 0 $+ -- for left-associative functions ($<) :: a -> (a -> b) -> b ($<) x f = f x -- for right-associative functions ($>) :: a -> (a -> b) -> b ($>) x f = f x example1 :: Int example1