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

I really donot know how to use `newtype` ?

Name: Anonymous 2009-11-27 13:53

then how to use `newtype` ?  Would you mind explaining the newtype in detail ?

Sinerely!

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

Name: Anonymous 2009-11-27 14:25

>>5
Your signature is unclever and mathematically incorrect and doesn't conform to Prague standards.

_________________________________________________
fact n = product $ takeWhile (/= 0) [n, n - 1 ..]

Name: Anonymous 2009-11-27 14:26

>>5
They're both unoptimized. foldl' (*) 1 [2..n] would be faster and use more space-efficient.

Name: Anonymous 2009-11-27 14:36

fac = product . enumFromTo 2

Name: Anonymous 2009-11-27 15:35

>>6
>>7
>>8
proof that /prog/ is populated by #haskell

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