Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Adding 2 + 2

by mrborisguy (Hermit)
on Jul 24, 2005 at 02:21 UTC ( #477539=note: print w/ replies, xml ) Need Help??


in reply to Adding 2 + 2

use Language::Haskell; print Language::Haskell->new->eval('foldr (+) 0 [2,2]');

(Hey, I saw somebody do it with C, so I can do it in Haskell)

use Language::Functional qw(foldr); print foldr { $_[0] + $_[1] } 0, [2,2];

    -Bryan


Comment on Re: Adding 2 + 2
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://477539]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-11-27 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (178 votes), past polls