[Haskell-cafe] Haskell is a declarative language? Let's see how easy it is to declare types of things.

Albert Y. C. Lai trebla at vex.net
Sat Apr 6 23:14:48 CEST 2013


On 13-04-05 04:56 AM, Tom Ellis wrote:
> "any" is very ambiguous.  Doesn't the problem go away if you replace it with
> "all"?

Yes, that is even better.

The world would be simple and elegant if it did things your way, and 
would still be not too shabby if it did things my way, no?

«Learn You a Haskell for Great Good!» by Miran Lipovača:
http://learnyouahaskell.com/types-and-typeclasses#type-variables

"Because it's not in capital case it's actually a type variable. That 
means that a can be of any type."

«The Haskell School of Expression» by Paul Hudak:
page 57

"Intuitively, what we'd like to say is that, for any type a, the type of 
length is [a] -> Integer."

"So length can be applied to a list containing elements of any type."
(Does [True, 'x'] count as a list containing elements of any type?)

At this point, you may be rightful to accuse me of taking sentences out 
of context. I acknowledge it. The contexts have examples and other words 
on using this new freedom of "any"; hopefully, readers pick up the 
unsaid message: who has that freedom.

It is correct to say: the accompanying examples and words make it 
sufficiently clear. The flip side is: look how many examples and words 
you have to set up to make it sufficiently clear.

This thread began with the omission vs inclusion of syntax "forall t" or 
equivalent. It also, clearly, set the beginner classroom context.

If someone replied, "since it is a rank-1 language, the omission is 
syntactically simpler, the inclusion would be syntactically repetitive", 
I would agree. In fact I hold that opinion. But that has not been the reply.

The reply has been, "the omission is semantically simpler", and that's 
what I object to. All I see is evidence against it. Look how many 
examples and words you have to set up to teach it. Their length 
testifies the semantic complexity or complication. You have saved 
teaching syntax, but you haven't saved teaching semantics, semantics of 
something unrepresented by syntax.

As for what mathematicians self-inflict on themselves, I should have, 
right at the beginning, just dismissed them and said: the context is 
beginner classroom, I don't care what happens between grad students and 
their thesis supervisors, it's their own business. If they just needed 
to wink-wink nudge-nudge and that finished transmitting a proof of P=NP, 
good for them.




More information about the Haskell-Cafe mailing list