logoalt Hacker News

whateveracct11/07/20240 repliesview on HN

Technically, Haskell laziness is just mutability under the hood :)

And the "difference list" mentioned in the article is also in Haskell - although framed differently (more "functionally")

    type DList a = [a] -> [a]

    concat :: DList a -> DList a -> DList a
    concat = (.)

    toList :: DList a -> [a]
    toList d = d []

    fromList :: [a] -> DList a
    fromList = (++)