News for hackers. Stuff that matters.
Re:OCamlers' critiques of Haskell by GregBuchholz on Thursday August 27, 2015 @02:55PM (#10131302)
>I don't know a way of doing that in any of the C style languages

http://www.boost.org/doc/libs/1_49_0/libs/optional/doc/html/...

https://www.google.com/#q=maybe+in+c%2B%2B

...and also I couldn't resist...

    char* response(messy* message) {
        body* b = message->body;
        return b && (b->text) && b->linecount < 11 && b->text[10];
    }
...for a C-ish like language. And that's without creating a "do-notation" macro to erase the &&, as the Haskell do-notation erases the >>=.
Re:OCamlers' critiques of Haskell by evincarofautumn on Thursday August 27, 2015 @06:57PM (#10132675)
These aren’t quite the same. With “x && x->y”, you’re using a boolean to encode the assumption that “x” is valid, but with “x >>= getY”, the type system has a proof, which makes refactoring safer.