Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Inline::Haskell

by sleepingsquirrel (Chaplain)
on Jun 24, 2004 at 04:11 UTC ( [id://369242]=note: print w/replies, xml ) Need Help??


in reply to RFC: A Perlesque Introduction to Haskell, Part One (DRAFT)

I've always wanted to see an implementation of Inline::Haskell (a la Inline::C). And I figured functions could return references to tied file handles to take care of (possibly infinite) lazy lists.
$fh=haskell_func(); while(<$fh>) { ...etc... } @foo=map $_*2, <$fh>; __HASKELL__ haskell_func = primes [2..] where primes [x:xs] = x:primes (filter (\n->(mod n x)/=0) xs)


-- All code is 100% tested and functional unless otherwise noted.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2024-04-23 11:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found