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

Haskell

Name: Anonymous 2013-07-29 5:27


Prelude> \x -> x x

<interactive>:2:9:
    Occurs check: cannot construct the infinite type: t1 = t1 -> t0
    In the first argument of `x', namely `x'
    In the expression: x x
    In the expression: \ x -> x x

Prelude> let y f = \x -> f f x

<interactive>:2:19:
    Occurs check: cannot construct the infinite type:
      t1 = t1 -> t2 -> t0
    In the first argument of `f', namely `f'
    In the expression: f f x
    In the expression: \ x -> f f x



​> (lambda (x) (x x))
#<CLOSURE <anon> (x) (x x)>
​> (define (y f) (lambda (x) (f f x)))
#<unspecified>
​> (define factorial (y (lambda (f n) (if (= n 0) 1 (* n (f f (- n 1)))))))
#<unspecified>
​> (factorial 5)
120

Name: Anonymous 2013-07-29 10:50

>>7
EBIG GWODE /G/RO XDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD LEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEL

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