News for hackers. Stuff that matters.
Re:Hindley-Milner Type Inference (2012) by dependenttypes on Friday July 10, 2020 @04:56PM (#23796357)
In haskell you would do it like

    import System.Random
    x = do y <- randomIO :: IO Float -- note: this is before there are instances of randomIO for IO Int and other types
           if y > 0.5 then
             return (Left "abc")
           else
             return (Right 2.01)

There are no comments on this comment yet.