Reputation
1,327
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
1 5 8
Newest
 Nice Answer
Impact
~24k people reached

  • 0 posts edited
  • 0 helpful flags
  • 6 votes cast
Oct
7
comment Is Node.js a framework?
Ah, ah, I see where that might have been a tripping point.
Oct
7
comment Is Node.js a framework?
@slebetman What's the "other" meaning of interpreter? I didn't realize there was a debate there too! :S
Oct
7
awarded  Nice Answer
Oct
6
answered Is Node.js a framework?
Sep
26
comment What exactly makes the Haskell type system so revered (vs say, Java)?
"High School Mathematics" is actually sort of a term of art referring to the idea of mathematics involving +, *, -, /, solving for x, simple derivatives, etc. With the exceptions of - and / all those operations work great on ADTs.
Aug
8
awarded  Great Answer
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat Yes, Haskell disallows this. Every call to a constructor (not that they exist) would produce a structurally equivalent object. They may not have any equality at all, but if one is defined it can be no more fine than one which respects referential transparency.
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat sorry, I should have been explicit, in this example mk is a pure function. It returns identical objects by virtue of computing them identically, but they're different objects by virtue of them not necessarily being at the same memory address. Equational semantics must respect the first (indeed that is more or less definitional) but must ignore the second. If f can detect sharing then it violates referential transparency and violates equational reasoning.
Aug
7
awarded  Commentator
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat Sure, if f is a function which potentially examines its arguments to see that they're they have reference equality then the operation f(mk(), mk()) ===> let x = mk() in f(x, x) is an invalid transformation.
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat If you throw away referential transparency it's not that you lose power (in fact you gain it, certainly) but instead that you lose the ability to reason equationally. This is important for human faculties but also for compiler transforms and optimizations.
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
I wrote a series of blog posts on this actually a little while back: jspha.com/posts/mutable_algorithms_in_immutable_languges_part_1
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
This isn't to say that such algorithms are impossible to write or use in Haskell... it's just that the base semantics doesn't offer them. Instead, you need to use monadically augmented semantics via something like ST.
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat Additionally, there's no way to have referential transparency and allow for analysis of self-referential graphs. If you can identify whether two references point to the same place then you are exactly violating referential transparency.
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat As Paul notes there is no sense of object equality ("reference equality") in Haskell excepting where you explicitly create your own via tags (and then are personally responsible for ensuring equality behaves properly). In fact, there are types in Haskell which have no (internal) notion of equality at all!
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat I'm not confident that I understand your terminology. I'd suggest that many mutual reference situations are handled in Haskell through laziness and "tying the knot", but it is true that some mutual references are more clearly stated by explicit mutation. The ST monad can be used to accomplish this.
Aug
7
comment What exactly makes the Haskell type system so revered (vs say, Java)?
@supercat Haskell lacks reference semantics entirely (this is the notionn of referential transparency which entails that everything is preserved by replacing references with their referents). Thus, I think your question is ill-posed.
Aug
7
awarded  Yearling
Apr
24
awarded  Guru
Apr
22
awarded  Yearling