3 ms·
Sorry to go tangential, I was reading your blog posts following the link from your post. The monoid example is possible without static interface methods: you co
by ctenb 1y ago
Sorry to go tangential, I was reading your blog posts following the link from your post. The monoid example is possible without static interface methods: you could use the new() constraint and have the empty constructor act as identity element. Kudos on the posts, very nice to read.
- louthy 1y agoTrue! (Although that requires an allocation) The technique works best for encoding higher-kinded traits and, as you say, Monoid doesn’t need any of that, but it was an easy way to introduce the ideas.