News for hackers. Stuff that matters.
Re:The Haskell job market has been growing steaily since 2008 by embwbam on Sunday July 16, 2023 @01:33PM (#36749526)
Yes that’s exactly what the Maybe monad does! It would look like this in Haskell code

    doStuff :: Maybe X
    doStuff = do
      r1 <- cmd1
      r2 <- cmd2 r1
      …
      return rX
Which is syntactic sugar for:

    doStuff = cmd1 >>= cmd2 >>= …
Re:The Haskell job market has been growing steaily since 2008 by dllthomas on Thursday July 20, 2023 @06:52PM (#36807852)
A sometimes important difference is that every process in the pipeline is spawned at the start, and may operate on partial input. A function returning Maybe needs to complete before we know whether it returns Just or Nothing, and we can't start the next function until we have the Just in hand, as that's the input to the function.