redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Tuesday 18 September 2018 21:02

Ask your IT question here

need help in converting haskell to python



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> Python programming forum
View previous topic :: View next topic  
Author Message
javanoobie
Guest Programmer




Haskell:

let fib =
1:1:(map (uncurry (+)) (zip fib (tail fib)))
in take 20 fib

I'm trying to convert this to python code. I have tried a direct translation and ended up with

def fib():
yield 1
yield 1
for i in imap(sum, izip(fib(), fib()[1:])):
yield i

i'm having problem converting the map part in haskell to python. Any one can point me in the right direction? Much appreciated.

Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> Python programming forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo