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

Pages: 1-4041-

Suck it

Name: Anonymous 2007-08-09 15:23 ID:wDfRb0TX

fac n = foldr (*) 1 (take n [1..])

Suck it

Name: Anonymous 2007-08-09 15:24 ID:q4viz/A4

fac u

Name: Anonymous 2007-08-09 15:25 ID:Heaven

Cute. But doesn't memoize!

Name: Anonymous 2007-08-09 15:36 ID:pDl+4U+8

>>3
DRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

The compiler does.

Name: Anonymous 2007-08-09 15:38 ID:wDfRb0TX

3 fails.

Name: Anonymous 2007-08-09 16:20 ID:Wp8AcJA1

>>1
  YOU
FUCKING
S U C K


fac = product . enumFromTo 1

Name: Anonymous 2007-08-09 18:10 ID:Heaven

>>6
When you're too EXPERT PROGRAMMER to do:
fac n = product [1..n]

Name: Anonymous 2007-08-09 18:30 ID:AKgIEBvD

>>7
Point-free style is superior

Name: Anonymous 2007-08-09 19:11 ID:wWgruhbF

fac = product [1..]

Name: Anonymous 2007-08-09 19:19 ID:HUEWYzmh

Prelude> let fac = product [1..]
Prelude> fac 4

<interactive>:1:0:
    Couldn't match `Integer' against `t -> t1'
      Expected type: Integer
      Inferred type: t -> t1
    Probable cause: `fac' is applied to too many arguments in the call (fac 4)
    In the definition of `it': it = fac 4
Prelude>


Phail.

Name: Anonymous 2007-08-09 19:29 ID:AKgIEBvD

>>9
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUCKIGNDAMN
FIRST OF ALL, YOU DONT FUQIN KNOW WHAT A MAN PAGE IS
SECONDLY, THIS IS /prog/ DO NOT DEMAND USEFUL ANSWERS THE WAY YOU WANT THEM TO BE
THIRDLY PROGRAMMING IS ALL ABOUT PHILOSOPHY AND ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
AND FUQIN LASTLY, FUCK OFF WITH YOUR BULLSHYT
EVERYTHING HAS ALREADY BEEN ANSWERED IN
>>6,7,8

Name: Anonymous 2007-08-09 19:52 ID:Heaven

(define (fac n)
  (apply * (range 1 n)))

Name: Anonymous 2007-08-09 22:29 ID:wWgruhbF

>>10
lool idiot

>>11
hahahahah

>>12
WAT?????

Name: Anonymous 2007-08-09 22:39 ID:aNT+HqN1

>>12
Is apply some kind of fold? (I don't know Lisp yet)

>>13
Sorry, but you're the idiot. The function you posted doesn't take any arguments and will just attempt to calculate the product of the infinite list [1..]. Did you think any given parameter would somehow magically be injected as a right bound into the syntactic sugar? You clearly don't have a very good understanding of eta reduction.

Name: Anonymous 2007-08-09 23:10 ID:wWgruhbF

>>14
1) its called BETA reduction faggot
2) POINTLESS FUNCTIONS IN POINTLESS STYLE
3) Haskell is lazy, discussion over
4) NO U!
5) I invented the [sup] and [sub] tags, you are ETERNALLY IN DEBT TO ME.

Name: Anonymous 2007-08-09 23:11 ID:Heaven

>>14
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUCKIGNDAMN
FIRST OF ALL, YOU DONT FUQIN KNOW WHAT A MAN PAGE IS
SECONDLY, THIS IS /prog/ DO NOT DEMAND USEFUL ANSWERS THE WAY YOU WANT THEM TO BE
THIRDLY PROGRAMMING IS ALL ABOUT PHILOSOPHY AND ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
AND FUQIN LASTLY, FUCK OFF WITH YOUR BULLSHYT
EVERYTHING HAS ALREADY BEEN ANSWERED IN >>15

Name: Anonymous 2007-08-09 23:15 ID:/fqA7NlS

>>15,16
Potentially the same person, proceed with caution.

Name: Anonymous 2007-08-09 23:19 ID:wWgruhbF

>>17
Oh, that could be true

You are a giant faggot

Name: Anonymous 2007-08-09 23:30 ID:Heaven

: fac ( n -- n! ) [ 1+ ] map product ;

Name: Anonymous 2007-08-09 23:32 ID:BS5bcu77

>>14
no, not really. apply receives a function and a list, then makes the list the arguments of the function. So (apply * '(1 2 3)) is equivalent to (* 1 2 3). range n m returns a list (n n+1 ... m). so we get (* n n+1 n+2 ... m). * takes multiple arguments. actually, I'm not sure (*) returns 1, so this does not handle the base case correctly. other options are (reduce * 1 lst), reduce being equal to fold, or consing a 1. this makes it more or less equivalent to the haskell version, since product is probably something like product = foldr (*) 1

Name: Anonymous 2007-08-09 23:38 ID:JuIjVnEO

: fac ( n -- n! ) 1+ 1 tail product ;

Name: Anonymous 2007-08-10 0:00 ID:6UxIbwif

>>15
1) BETA REDUCTION IS FUNCTION APPLICATION, THIS IS NOT WHAT I AM TALKING ABOUT
2) POINTFREE STYLE IS ELEGANT AND YOU ARE MADE OF FAIL
3) LAZINESS HAS NOTHING TO DO WITH THIS. PRODUCT WILL FAIL TO TERMINATE WHEN GIVEN AN INFINITE LIST
4) NEIN DU
5) SUP AND SUB HAVE BEEN (AB)USED ON DQN FOR MONTHS ALREADY

GET THE FUCK OUT

Name: Anonymous 2007-08-10 1:11 ID:zu0/65CA

(((ok bitch)
  (
you asked for it)
  (
here goes))
 (
im taking out the fucking
     (
bold paranthesis on you))
 (
you fuqing angered an expert programmer)
 (
ive been here for (expt 3 88888000) years longer than you)
 (
ive read sicp twice)
 (
i know every programming language in the world
    including apl
)
 (
if u wanna batl (lets do it))
 (
ill crush you like a bean))

Name: Anonymous 2007-08-10 1:26 ID:em4J9rOF

fac = foldr (*) . enumFromTo 1

Name: Anonymous 2007-08-10 1:59 ID:PPrnF8K7

it's
fac n = product [1..n]
you haskell niggers.

Name: Anonymous 2007-08-10 2:01 ID:xrQSvt5E


[b]([/b][b]([/b][b]([/b]ok bitch[b])[/b]
  [b]([/b]you asked for it[b])[/b]
  [b]([/b]here goes[b])[/b][b])[/b]
 [b]([/b]im taking out the fucking
     [b]([/b]bold paranthesis on you[b])[/b][b])[/b]
 [b]([/b]you fuqing angered an expert programmer[b])[/b]
 [b]([/b]ive been here for [b]([/b]expt 3 88888000[b])[/b] years longer than you[b])[/b]
 [b]([/b]ive read sicp twice[b])[/b]
 [b]([/b]i know every programming language in the world
    including apl[b])[/b]
 [b]([/b]if u wanna batl [b]([/b]lets do it[b])[/b][b])[/b]
 [b]([/b]ill crush you like a bean[b])[/b][b])[/b]

Name: Anonymous 2007-08-10 2:02 ID:xrQSvt5E

(((ok bitch)
  (you asked for it)
  (here goes))
 (im taking out the fucking
     (bold paranthesis on you))
 (you fuqing angered an expert programmer)
 (ive been here for (expt 3 88888000) years longer than you)
 (ive read sicp twice)
 (i know every programming language in the world
    including apl)
 (if u wanna batl (lets do it))
 (ill crush you like a bean))

Name: Anonymous 2007-08-10 2:02 ID:xrQSvt5E


[b]([/b][b]([/b][b]([/b]ok bitch[b])[/b]
  [b]([/b]you asked for it[b])[/b]
  [b]([/b]here goes[b])[/b][b])[/b]
 [b]([/b]im taking out the fucking
     [b]([/b]bold paranthesis on you[b])[/b][b])[/b]
 [b]([/b]you fuqing angered an expert programmer[b])[/b]
 [b]([/b]ive been here for [b]([/b]expt 3 88888000[b])[/b] years longer than you[b])[/b]
 [b]([/b]ive read sicp twice[b])[/b]
 [b]([/b]i know every programming language in the world
    including apl[b])[/b]
 [b]([/b]if u wanna batl [b]([/b]lets do it[b])[/b][b])[/b]
 [b]([/b]ill crush you like a bean[b])[/b][b])[/b]

Name: Anonymous 2007-08-10 2:18 ID:zu0/65CA

>>26
>>27
>>28
LOLx3
M-m-m-m-m-m-mega fail

Name: Anonymous 2007-08-10 2:25 ID:xrQSvt5E

Can someone tlel me how to bold text inside [code] tags

Name: Anonymous 2007-08-10 2:27 ID:Heaven

>>30
By not FAILING.

Name: Anonymous 2007-08-10 2:34 ID:xrQSvt5E

tes[b]t[/b]

Name: Anonymous 2007-08-10 2:51 ID:zu0/65CA

>>30
haha if you can't work it yourself PLEASE GTFO

Name: Anonymous 2007-08-10 4:07 ID:zu0/65CA

>>30
>Can someone tlel me how to bold text inside [code] tags
>someone tlel me
>tlel
>T L E L

Name: Anonymous 2007-08-10 4:07 ID:zu0/65CA

>>30
Can someone tlel me how to bold text inside [code] tags
someone tlel me
tlel
T L E L

Name: Anonymous 2007-08-10 4:16 ID:Heaven

>>34
>Can someone tlel me how to bold text inside [code] tags
>Can someone tlel me
>Can
[b]>[/b]

Name: Anonymous 2007-08-10 4:32 ID:dbzfBUqK



[b]>([/b]display "hello"[b]>)[/b]

Name: Anonymous 2007-08-10 4:47 ID:zu0/65CA

>

Name: Anonymous 2007-08-10 4:47 ID:zu0/65CA

>>38
HAH!

Name: Anonymous 2007-08-10 6:11 ID:Heaven

This thread is now BBCode testing grounds.
>(display "hello">)

Name: Anonymous 2007-08-10 6:20 ID:xrQSvt5E

>>35
yer so what I made a typo. Deal with it.

Name: Anonymous 2007-08-10 6:36 ID:zu0/65CA

>>41
If I say god doesn't exist, then you say "Deal with it".. that doesn't make god exist.

Name: Anonymous 2007-08-10 7:02 ID:I2bEbs80

<b>bold</b>

Name: Anonymous 2007-08-10 7:07 ID:xrQSvt5E

>>42
how do I bold text inside code tags?? It's as if you're trying to anger me, but I'm not sure why. Just answre me, FFS.

Name: Anonymous 2007-08-10 7:15 ID:Heaven

>>44
There's a lesson to be learned here. You have to, then you'll get your answer.

Name: Anonymous 2007-08-10 7:16 ID:Heaven

>>44
FAGGOT

Name: Anonymous 2007-08-10 7:21 ID:6UxIbwif

>>24

YOU ARE FUCKING RETARDED
AT THE VERY LEAST
FUCKING
TEST YOUR CODE BEFORE YOU POST IT
FOLDR TAKES THREE ARGUMENTS
MAYBE YOU MEANT
``foldr (*) 1''
WHICH CAN ALSO BE WRITTEN AS 
``product''
HOW ABOUT FUCKING
READING THE THREAD BEFORE POSTING
SEE FOR EXAMPLE:
>>6

Name: Anonymous 2007-08-10 7:21 ID:Heaven

>>44
YOU ARE AFAGGOT.

Name: Anonymous 2007-08-10 7:36 ID:xrQSvt5E

test

Name: Anonymous 2007-08-10 7:40 ID:xrQSvt5E

(((ok bitch)
  (you asked for it)
  (here goes))
 (im taking out the fucking
     (bold paranthesis on you))
 (you fuqing angered an expert programmer)
 (ive been here for (expt 3 88888000) years longer than you)
 (ive read sicp twice)
 (i know every programming language in the world
    including apl)
 (if u wanna batl (lets do it))
 (ill crush you like a bean))

Name: Anonymous 2007-08-10 7:43 ID:Heaven

>>49
test

Name: Anonymous 2007-08-10 7:45 ID:xrQSvt5E

Here's my source code for this precious kopipe (which I invented) released to public domain:
[b][code]([/code][/b][b][code]([/code][/b][b][code]([/code][/b][code]ok bitch[/code][b][code])[/code][/b]
  [b][code]([/code][/b][code]you asked for it[/code][b][code])[/code][/b]
  [b][code]([/code][/b][code]here goes[/code][b][code])[/code][/b][b][code])[/code][/b]
 [b][code]([/code][/b][code]im taking out the fucking[/code]
     [b][code]([/code][/b][code]bold paranthesis on you[/code][b][code])[/code][/b][b][code])[/code][/b]
 [b][code]([/code][/b][code]you fuqing angered an expert programmer[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]ive been here for[/code] [b][code]([/code][/b][code]expt 3 88888000[/code][b][code])[/code][/b] [code]years longer than you[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]ive read sicp twice[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]i know every programming language in the world[/code]
    [code]including apl[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]if u wanna batl[/code] [b][code]([/code][/b][code]lets do it[/code][b][code])[/code][/b][b][code])[/code][/b]
 [b][code]([/code][/b][code]ill crush you like a bean[/code][b][code])[/code][/b][b][code])

Name: Anonymous 2007-08-10 7:45 ID:xrQSvt5E

(((ok bitch)
  (you asked for it)
  (here goes))
 (im taking out the fucking
     (bold paranthesis on you))
 (you fuqing angered an expert programmer)
 (ive been here for (expt 3 88888000) years longer than you)
 (ive read sicp twice)
 (i know every programming language in the world
    including apl)
 (if u wanna batl (lets do it))
 (ill crush you like a bean)[b][code])

Name: Anonymous 2007-08-10 7:46 ID:xrQSvt5E

>>52 here
Sorry about that, there was a bug in my source. Here's the patched, copy-pastable version:

[b][code]([/code][/b][b][code]([/code][/b][b][code]([/code][/b][code]ok bitch[/code][b][code])[/code][/b]
  [b][code]([/code][/b][code]you asked for it[/code][b][code])[/code][/b]
  [b][code]([/code][/b][code]here goes[/code][b][code])[/code][/b][b][code])[/code][/b]
 [b][code]([/code][/b][code]im taking out the fucking[/code]
     [b][code]([/code][/b][code]bold paranthesis on you[/code][b][code])[/code][/b][b][code])[/code][/b]
 [b][code]([/code][/b][code]you fuqing angered an expert programmer[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]ive been here for[/code] [b][code]([/code][/b][code]expt 3 88888000[/code][b][code])[/code][/b] [code]years longer than you[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]ive read sicp twice[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]i know every programming language in the world[/code]
    [code]including apl[/code][b][code])[/code][/b]
 [b][code]([/code][/b][code]if u wanna batl[/code] [b][code]([/code][/b][code]lets do it[/code][b][code])[/code][/b][b][code])[/code][/b]
 [b][code]([/code][/b][code]ill crush you like a bean[/code][b][code])[/code][/b][b][code])[/code][/b]

Name: Anonymous 2007-08-10 7:47 ID:xrQSvt5E

(((ok bitch)
  (you asked for it)
  (here goes))
 (im taking out the fucking
     (bold paranthesis on you))
 (you fuqing angered an expert programmer)
 (ive been here for (expt 3 88888000) years longer than you)
 (ive read sicp twice)
 (i know every programming language in the world
    including apl)
 (if u wanna batl (lets do it))
 (ill crush you like a bean))

Name: Anonymous 2007-08-10 8:27 ID:zu0/65CA

>>55
you're getting close, but still not managed it FOOL!

Name: Anonymous 2009-01-14 15:17

WTF

Name: Anonymous 2009-03-06 9:17

The same manner that   the head had   earlier The long   RUN MY PRODUCT   IS SHITTIER BY.

Name: Anonymous 2010-12-25 1:40

<

Name: Anonymous 2011-02-04 18:29

Name: Anonymous 2013-07-15 2:59

(((ok bitch)
  (you asked for it)
  (here goes))
 (im taking out the fucking
     (bold paranthesis on you))
 (you fuqing angered an expert programmer)
 (ive been here for (expt 3 88888000) years longer than you)
 (ive read sicp twice)
 (i know every programming language in the world
    including apl)
 (if u wanna batl (lets do it))
 (ill crush you like a bean))

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