logo       

implicit defs: msg#00440

lang.scala

Subject: implicit defs

I made the mistake of emphasizing type-coercion as the
main objective of implicit defs, but now I understand
its role related to type-classes. I thought traits
correspond to type-classes.

let me guess. traits are like type classes, and
implicit defs are instance declarations.

www.scala-lang.org has a page
http://www.scala-lang.org/intro/views.html
and the example was pretty clear. the GADT example was
clear as well. but I am mostly interested in:

- rules of resolving ambiguity
- interaction with/between subclassing, generics, view
bounds

if you guys recently had an experience of thinking
through these, please share.

I understand (mostly) Haskell type classes, and their
inheritance. but their interaction with subclassing
scares me. an expression in Haskell has a unique
(polymorphic, at most) type, but subclassing destroys
that. as far as I get it, this is the single most
important difference between OOP and FP. let's bring
forward thorniest issues we can think of, I will
document it in the end and save it in the wiki so that
later on we can just redirect questions there.



____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise