Re:Guile also supports the web at the programming language l...
by sedachv on Friday December 17, 2010 @05:11PM
(#2018061)
Try programming in Haskell. Pretty much all other statically typed programming languages (except ML etc.) get their type systems wrong because all types are really (or <x> null). That's useless for doing type checking, which is why there doesn't seem to be much of an advantage to static typing. Type classes and Hindley-Milner inference make things really nice to use. But it's really the lack of null that makes Haskell's type system actually useful for things other than catching trivial type bugs.
[ Parent
| on HN ]
Re:Guile also supports the web at the programming language l...
by pjscott on Friday December 17, 2010 @06:49PM
(#2018356)
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.
Re:Guile also supports the web at the programming language l...
by neutronicus on Friday December 17, 2010 @09:45PM
(#2018735)
Debug.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.
Re:Guile also supports the web at the programming language l...
by lsb on Friday December 17, 2010 @10:55PM
(#2018841)
It'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)
Re:Guile also supports the web at the programming language l...
by srean on Friday December 17, 2010 @05:24PM
(#2018121)
because all types are really (or <x> null).
Did you miss a word there ? It happens to me all the time.
Re:Guile also supports the web at the programming language l...
by jamie_ca on Friday December 17, 2010 @05:48PM
(#2018202)
Parse it as lisp.
It's haskell-type-system-speak for "If you declare something to be a String, it really means String or null."
Re:Guile also supports the web at the programming language l...
by pjscott on Friday December 17, 2010 @06:46PM
(#2018344)
The Haskell type for that would be "Maybe String". When you get a Maybe value, the compiler gives an error if you don't deal with the possibility that the value might be Nothing.
Re:Guile also supports the web at the programming language l...
by regularfry on Friday December 17, 2010 @05:37PM
(#2018169)
I don't think he did... took me a couple of passes, but it parsed in the end.