4 ms·
Kind of but the important difference is that Ruby checks that at runtime instead of giving a compile time error.
by ufo 12y ago
Kind of but the important difference is that Ruby checks that at runtime instead of giving a compile time error.
- okasaki 12y agoso like this? import Control.Monad.ST import Data.STRef main = do let n = runST $ do n <- newSTRef 5 modifySTRef n (+ 10) readSTRef n modifySTRef n (+ 10) {- ^^^^^^ Couldn't match expected type IO t0 with actual type ST s0 () In the expression: main When checking the type of the IO action main -} print n
- ufo 12y agoYes, more like that. There are some extra wrinkles they could add with subtyping, record types, etc but its still going to be a silly thing to patent.