A realization I had tonight: the monadic IO construct Haskell uses to enforce purity does not require static types—it works perfectly fine in a dynamically-typed language, too. This seems obvious in retrospect but clearly isn’t, given that I hadn’t thought about it until now!
-
-
A mixed functional/imperative language with eager or lenient evaluation and effects-typing instead of monads extends more naturally to an untyped interpreter. There, the worst that can happen is running effects in a context intended to be pure.
-
When I first saw your tweets, I agreed, but… you can still do let _ = putStrLn "hello" in putStrLn "goodbye" in Haskell. If you do something like let x = getLine in x ++ "!" then it’ll fail faster in Haskell, but it’d still be a runtime error in a dynamically typed lang.
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.