Re: lazy file reading in H98

2000-09-08 Thread Marcin 'Qrczak' Kowalczyk
5 Sep 2000 07:17:00 GMT, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> pisze: > There is a chance that it was not garbage collected yet but it's dead, > and reading a whole 10 megs of file when the user losed its interest > after first bytes is unnecessary. So this is not a sufficient rule. But

Inferring types

2000-09-08 Thread Jan Carlson
Hi! I'm intrigued by the following Haskell behaviour: The type of (+) is (+) :: (Num a) => a -> a -> a Now, if I define p = (+) the type of p is inferred to be p :: Integer -> Integer -> Integer How come? I guess the answer can be found somewhere in the Haskell report, but I'd really appr

Re: Inferring types

2000-09-08 Thread Fergus Henderson
On 08-Sep-2000, Jan Carlson <[EMAIL PROTECTED]> wrote: > I'm intrigued by the following Haskell behaviour: > > The type of (+) is > > (+) :: (Num a) => a -> a -> a > > Now, if I define > > p = (+) > > the type of p is inferred to be > > p :: Integer -> Integer -> Integer > > How come? > >

Re: Inferring types

2000-09-08 Thread Jon Fairbairn
> If you define `p' as a syntactic function, e.g. > > p x y = x + y > or > > p x = (+) x > > rather than via > > p = (+) > > then the monomorphism restriction does not apply, and so the type inferred > for `p' will be the correct polymorphic type `Num a => a -> a -> a'. Ma

Re: Inferring types

2000-09-08 Thread Marcin 'Qrczak' Kowalczyk
Sat, 9 Sep 2000 00:56:46 +1100, Fergus Henderson <[EMAIL PROTECTED]> pisze: > If you define `p' as a syntactic function, e.g. > then the monomorphism restriction does not apply, and so the type inferred > for `p' will be the correct polymorphic type `Num a => a -> a -> a'. Also when an explicit

Patterns Catalog

2000-09-08 Thread Doug Ransom
I have worked through "Haskell: The craft of functional programming". Learning the language is one thing, applying FP is another. The next thing I would like to study would be a catalog of patterns for lazy functional programming. In the Object-oriented world, there are some catalogs of useful p