Comment

Comment by seles

This kind of feels like using continuations, here is a Haskell demo of the concept:

    myMap = myMapHelper id
    
    myMapHelper cont f [] = cont []
    myMapHelper cont f (x:xs) = myMapHelper (cont . (f x :)) f xs
Of course this actually makes things slower in Haskell, either due to the growing continuation or existing optimizations in Haskell
parent seles 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton