--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To be clear, you can do this if you're willing to write a Native function and then give it a polymorphic type when wrapping/exposing it in the Elm level of your library. I had to do one or two of those tricks in elm-webgl. But it's relatively unsafe if you're not careful.
OCaml has a cool feature to make this more light-weight, but Elm does not have that yet.
Meta-comment: I was curious how folks would answer here so I waited a bit :) Generally speaking, I'd avoid saying "you can't do this!" and go with "how about this way?" If they already know about ADTs and cannot be persuaded, then dive into other options. Always be aware of XY problems!