On 1 July 2010 20:34, Jorden M <jrm8...@gmail.com> wrote:
> Lack of polymorphism in the interfaces seems to limit
> the extent to which they can be compared to Haskell type classes, but
> it seems safe to say that they are definitely a subset.

it's not as safe as you think - that's not true. in some
ways, go's interfaces are more general than haskell's
type classes.

the two are pretty much orthogonal to one another, in fact.
go's interfaces are more equivalent to haskell's Type.Dynamic
except less restrictive (fromDynamic asserts a particular
type, which is like asserting a static type in go rather than
an interface type).

haskell's type classes work top down - one type identifier
always represents the same underlying type; whereas
in go each variable of interface type can hold a different
underlying type.

Reply via email to