4 ms·
Haskell's type system catches a lot of bugs, and there are a lot of things right about it, but in practice, the type system often feels like a pain in the ass.
by pjscott 16y ago
Haskell's type system catches a lot of bugs, and there are a lot of things right about it, but in practice, the type system often feels like a pain in the ass. I'm tired of being hit with nigh-incomprehensible type errors. I'm very tired of not being able to do printf debugging without using the IO monad and changing all the type signatures, although judicious use of unsafePerformIO helps.
What I really want in a type system is for it to catch bugs, but get out of my way. Haskell is a little too stern for my liking.
- neutronicus 16y agoDebug.trace is the module for you, my friend. Debug.trace a b = a and b gets logged to the console. Or maybe it's backwards. I forget.
- lsb 16y agoIt's the opposite way: Debug.Trace.trace :: String -> a -> a and if you don't like debug.trace, you can make your own, via unsafePerformIO! hackyDebugTrace s v = unsafePerformIO (putStrLn s >>= \_ -> return v)