tag:blogger.com,1999:blog-6028449519062514692.post6159329689615253281..comments2023-09-11T12:02:42.908-04:00Comments on ha4: Hacking Type Classes in F#Anonymoushttp://www.blogger.com/profile/08313802559573057206noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6028449519062514692.post-36629921518118054292011-12-29T18:31:12.376-05:002011-12-29T18:31:12.376-05:00Thanks for your interest, Bryan. Erm, can you make...Thanks for your interest, Bryan. Erm, can you make the question a bit more specific? The general answer would be that the sample works by using method overload resolution rules during the F# inline expansion phase. So, for example, ToJson applied to a list of Person objects resolves to `ToJson(_: Json, x: list<_>)` which in turn calls another `ToJson` that resolves to `ToJson` method on Person.Anonymoushttps://www.blogger.com/profile/08313802559573057206noreply@blogger.comtag:blogger.com,1999:blog-6028449519062514692.post-50415113040222287542011-12-25T20:19:15.903-05:002011-12-25T20:19:15.903-05:00Hi Anton!
Could you blog about how exactly your s...Hi Anton!<br /><br />Could you blog about how exactly your sample works? I read the stuff at Gustavo's blog, but your sample looks simpler and would be a great explanatory tool!Bryan Eddshttps://www.blogger.com/profile/12521672412958609065noreply@blogger.comtag:blogger.com,1999:blog-6028449519062514692.post-71376018243645600012011-12-23T14:43:37.257-05:002011-12-23T14:43:37.257-05:00That indeed would be very nice :) Or perhaps someo...That indeed would be very nice :) Or perhaps someone will come up with an F# contender language that would work on .NET but give more priority to either TC or a proper module system, even at at the cost of other things.Anonymoushttps://www.blogger.com/profile/08313802559573057206noreply@blogger.comtag:blogger.com,1999:blog-6028449519062514692.post-87551159622152808932011-12-23T14:40:16.123-05:002011-12-23T14:40:16.123-05:00It's fairly elegant still... I wish I was impo...It's fairly elegant still... I wish I was imposed to do idiomatic F# all the time.<br /><br />Type Classes are clearly one of the most requested feature, let's hope they'll roll their sleeve yet again and deliver there as well... F# 3.5??Davidhttps://www.blogger.com/profile/09835386915394787925noreply@blogger.com