Polyvariadic Y in pure Haskell98

2003-10-27 Thread oleg
Paul Hudak wrote: > Suppose you have a LET expression with a set of (possibly mutually > recursive) equations such as: > > let f1 = e1 > f2 = e2 > ... > fn = en > in e > > The following is then equivalent to the above, assuming that g is not > free in e or any of the ei: > > let

Re: Cast from and to CChar

2003-10-27 Thread John Meacham
On Mon, Oct 27, 2003 at 08:47:41PM +0100, Christian Buschmann wrote: > Hi! > I've got following problem. If I enter in ghci following line: > Prelude Foreign.C> castCCharToChar $ castCharToCChar 'ü' > I would expect that this returns 'ü', but it returns '\252'. Is this the > correct behaviour? O

Re: Cast from and to CChar

2003-10-27 Thread Marcin 'Qrczak' Kowalczyk
W liście z pon, 27-10-2003, godz. 20:47, Christian Buschmann pisze: >Prelude Foreign.C> castCCharToChar $ castCharToCChar 'ü' > I would expect that this returns 'ü', but it returns '\252'. This is the same - instance Show Char displays non-ASCII characters that way. You get the same effect if

Cast from and to CChar

2003-10-27 Thread Christian Buschmann
Hi! I've got following problem. If I enter in ghci following line: Prelude Foreign.C> castCCharToChar $ castCharToCChar 'ü' I would expect that this returns 'ü', but it returns '\252'. Is this the correct behaviour? Or am I doing something wrong? Or are there any problems with language specific

I/O multiplexing (repost)

2003-10-27 Thread Peter Simons
[ I'm posting this article here again, because the general ] [ mailing list seems to be closed to non-members, and I'm ] [ reading/posting through gmane.org. Pardon me, if you see ] [ this on both lists, please. -peter ] Hi, I have a question concerning "manual" I/O multipl

Re: fixed point

2003-10-27 Thread Paul Hudak
> Also, had a feeling the fix function was related to the "Y" > combinator; it seems they're the same thing! Yes, they're the same in effect, although historically fix is often defined recursively or taken as a primitive, whereas Y has its roots in the lambda calculus, where it is defined as:

Re: fixed point

2003-10-27 Thread Josef Svenningsson
On Mon, 27 Oct 2003, Paul Hudak wrote: > Thomas L. Bevan wrote: > > Is there a simple transformation that can be applied to all > > recursive functions to render them non-recursive with fix. > > Suppose you have a LET expression with a set of (possibly mutually > recursive) equations such as: >

Re: fixed point

2003-10-27 Thread Paul Hudak
Thomas L. Bevan wrote: > Is there a simple transformation that can be applied to all > recursive functions to render them non-recursive with fix. Suppose you have a LET expression with a set of (possibly mutually recursive) equations such as: let f1 = e1 f2 = e2 ... fn = en in e The f

RE: fixed point

2003-10-27 Thread Harris, Andrew
> > Notice that, (\x -> x) a reduces to a, so (\a b c -> a b c) x (y-z) z > reduces to x (y-z) z. You can therefore simplify your > function quite a > bit. > wierdFunc x y z = if y-z > z then x (y-z) z else (\d e -> d) (y-z) z > and you can still apply that lambda abstraction (beta-reduce) > wie