From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <4C1F05E7-B327-480A-91F3-055076377C99@fastmail.fm> <3633bacf2efc9da1b911893b4029531b@coraid.com> <4C2BAED2.5010104@authentrus.com> <7B526717-D990-4029-8221-A0AA5C78B224@fastmail.fm> <20100701174329.D776A5B67@mail.bitblocks.com> Date: Fri, 2 Jul 2010 11:45:24 +0100 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] xml Topicbox-Message-UUID: 3c53974a-ead6-11e9-9d60-3106f5b1d025 On 1 July 2010 20:34, Jorden M 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.