Skip to content

Comment on C# almost has implicit interfaces

Comments

F# has an interesting way to achieve a similar function in Statically Resolved Type Parameters (SRTP)

Palatable blog post: https://www.compositional-it.com/news-blog/static-duck-typin...

Official docs: https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

That's an interesting feature I didn't know F# had. It sounds similar to row polymorphism (which I found a good description of here: https://news.ycombinator.com/item?id=7829766 ).

I sort of wish the defaults were flipped in F# - everything is inline by default.

Could you clarify that? Are you saying you wish everything could be inline by default? (It's not true that things are currently inline by default.)

Yes I would prefer compile-time duck-typing everywhere by default.

Well, I think that I would! It probably has unintended consequences.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.