This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Why <: and not <=: ?

2 replies
DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.

If I understand typeclass with an upper boundery well then:

A <: B

means

A is a subtype of B or B itself (so B is inclusive)

Wouldn't

A<=: B

be more intuitive (I think the mathematical notation is : ∇t ⊆ τ. t →
t where t is A and τ is B (hopefully the unicode characters are
encoded well otherwise there is some mojibake in this post))

Donna Malayeri
Joined: 2009-10-21,
User offline. Last seen 42 years 45 weeks ago.
Re: Why <: and not <=: ?
In mathematics, yes, but in type systems, the less-than-equal sign or <: are used interchangeably, with the latter being far more common. It is understood that <: is a reflexive, transitive preorder and would therefore be equivalent to a symbol with an equal sign.

Donna
DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Why <: and not <=: ?

Thanks, Donna.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland