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

Pages: 1-

I suck at Haskell :(

Name: Anonymous 2009-08-11 14:05


ints [1] -eval-> [1,2,3,4,5..]
ints [3] -eval-> [1,4,7,10,13..]
ints [1,2] -eval-> [1,2,4,5,7,8,10,11..]
ints [1,1,3] -eval-> [1,2,3,6,7,8,11..]


I hope you know what I mean. How do I write ints in terms of foldl/r and zipWith?

Name: Anonymous 2009-08-11 14:31

ints xs = scanl1 (+) (1 : cycle xs)

Or, if you like pointless style, ints = scanl1 (+) . (1:) . cycle.

Name: Anonymous 2009-08-11 14:35

itym ints = scanl (+) 1.cycle

Name: Anonymous 2009-08-11 14:39

what is the OP trying to accomplish in an ENTERPRISE CLASS language?

Name: Anonymous 2009-08-11 14:45

>>3
That would indeed make more sense.

I guess I suck at Haskell too ;_;

Name: Anonymous 2009-08-11 23:27

YOU MENA HASKAL

Name: Anonymous 2009-08-12 3:37

>>6
XD XD XD XD XD

No I mean Pascal, double nigger.

Name: Anonymous 2009-08-12 4:29

i suck at sucking my own, dick that is

Name: Anonymous 2011-02-03 4:07

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