Programming languages enthusiast. Author of Learn Type Driven Development: https://www.packtpub.com/application-development/learn-type-driven-development
Try out a typo in the icons definition in my code sample, you'll see the error at compile time 🙂 In fact you even hinted as to why: because I didn't use a catch-all case. That's exactly what causes the polymorphic variant type to be inferred as 'less than these cases', as I mentioned before. Definitely agree though that these are subtleties that need to be understood for proper usage. Real World OCaml is a good resource to learn about those, for sure.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Try out a typo in the
icons
definition in my code sample, you'll see the error at compile time 🙂 In fact you even hinted as to why: because I didn't use a catch-all case. That's exactly what causes the polymorphic variant type to be inferred as 'less than these cases', as I mentioned before. Definitely agree though that these are subtleties that need to be understood for proper usage. Real World OCaml is a good resource to learn about those, for sure.