Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

haskell composition

Name: Anonymous 2007-06-19 14:08 ID:sxIr1ztw

how do I compose in haskell two functions when one of the two functions requires more than one parameter?
What I want to do is something like this*:

(defun compose (f g)
    (lambda (&rest x)
        (funcall f (apply g x))))


but the . operator in haskell doesn't work if I want to compose, say, not and >




*or, for the scheme crowd out there

(define (compose f g)
     (lambda x (f (apply g x))))

Name: Anonymous 2007-06-20 0:48 ID:zGyv9O2T

>>15
you failed it the same way >>7 did.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List