Replies: 1 comment
-
There are plans to support a form of ad-hoc polymorphism. Daan has started work on a prototype here: https://github.com/koka-lang/koka/tree/dev-implicit We will see if the prototype turns out to fit Koka well, Daan is in charge, so maybe we will end up with typeclasses eventually. However, implicit parameters seems to work well for ad-hoc polymorphism in Scala, and we believe that our design for implicits works even better for Koka with it's static overloading. See the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I've been playing around with some of the examples from the (completely mindblowing 🤩) fully in place paper. I wanted to make the
stree
generic on the value type, and quickly ran into trouble. I would want to constrain the allowable types to those that have a total order defined, is there an idiomatic way to do this in koka?I saw that there was some discussion in #16. Has there been any progress since that issue? I tried defining a
total-cmp
effect and using that as described in this comment from that thread, but ran into warnings relating to potential allocation in effects other thanexn
anddiv
.It this possible to do in koka at the moment? If not, are there plans to add features supporting ad hoc polymorphism?
Beta Was this translation helpful? Give feedback.
All reactions