News for hackers. Stuff that matters.
Re:Another Scala rant on HN by pron on Tuesday December 03, 2013 @10:31AM (#6840805)
I am not saying one is absolutely necessary for the other. I'm just saying that Haskell uses its types for very strict type safety as well as for the control of side effects. I am no Haskell expert, but I believe side effects in Haskell are expressed in a function's return type. So the relative complexity of the Haskell type system is hopefully offset by its advantages of having fewer "type" bugs as well as fewer side-effect bugs, as well as better, more "pure", testing. There are other ways to control side effects through effect systems, but Haskell uses its ADTs for that.
Re:Another Scala rant on HN by jeremyjh on Tuesday December 03, 2013 @10:52AM (#6840963)
But it actually does not do so. The IO data type has a single value constructor: IO. Other monadic types do use ADTs - for example Either has both a Right and Left constructor - but ADTs are used extensively outside of any monadic type as well because the basic idea of composite types is actually very useful. So I cannot imagine how it is a bad thing that Scala has this useful feature, just because it does not also require an IO Monad? Does that mean ML is mistaken in its use of ADTs as well, even though it precedes Haskell?
Re:Another Scala rant on HN by asdasf on Tuesday December 03, 2013 @01:16PM (#6842015)
ADTs are algebraic data types. They are quite simple, and have nothing to do with the IO type which haskell uses to constrain side effects. An ADT is just a type made up of ORs and ANDs:

    data Bool = False | True
    data Tree a = Leaf a | Branch (Tree a) (Tree a)