News for hackers. Stuff that matters.
Re:I'm Switching to Python and Actually Liking It by internet_points on Thursday July 17, 2025 @03:35AM (#44590709)
> Haskell doesn't really have "loops"

weeell, you can still do stuff like this in Haskell:

     import Data.Vector.Mutable
     ...
     let n = length vec
     forM_ [0 .. n-1] $ \i -> do
       next <- if i < n-1 then read vec (i+1) else pure 0
       modify vec (+ next) i -- increase this value by next value
it's just in many cases the functional machinery is so accessible that you don't need to reach for for-loops.

There are no comments on this comment yet.