Get the latest tech news

Haskelling My Python


Reimplementing Haskell lazy infinite lists using Python generators

A few years ago, Pleng showed me a really cool trick you can do with lazy infinite lists in Haskell. That means our integral is some leading constant plus all the terms of the original Taylor series shifted over by one and divided by $n+1$. Also, Isaac noted that this trick also works using Python’s fractions module to get the answer as a rational number instead of a float.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of python

python

Related news:

News photo

Python’s new t-strings

News photo

Regular Expression Derivatives in Python [pdf] [video]

News photo

15,000 lines of verified cryptography now in Python