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-19 17:17 ID:z1u9R+Kb

>>2
Haskell is insane. Anybody could understand this
(define (compose f g)
     (lambda x (f (apply g x))))

without having even heard of LISP. Yet what the fuck is (.).(.)? Some kind of ASCII art? And what about (== 0) `dot` mod? It looks like some bizarre shell programming.

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