3 ms·
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 In
by dependenttypes 6y ago
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)