Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Inline::Haskell

by sleepingsquirrel (Hermit)
on Jun 24, 2004 at 04:11 UTC ( #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
Node Status?
node history
Node Type: note [id://369242]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2020-02-20 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (86 votes). Check out past polls.

    Notices?