4 ms·
F# has an interesting way to achieve a similar function in Statically Resolved Type Parameters (SRTP) Palatable blog post: https://www.compositional-it.com/new
by banashark 2y ago
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-typing-in-f/ https://www.compositional-it.com/news-blog/static-duck-typin...
Official docs: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
- fire_lake 2y agoI sort of wish the defaults were flipped in F# - everything is inline by default.
- Smaug123 2y agoCould 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.)
- fire_lake 2y agoYes I would prefer compile-time duck-typing everywhere by default. Well, I think that I would! It probably has unintended consequences.
- zogrodea 2y agoThat'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 https://news.ycombinator.com/item?id=7829766 ).