[Scala3] Get the type of container with wildcard type (i.e. List[?])

This page summarizes the projects mentioned and recommended in the original post on /r/scala

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Shapeless

    Generic programming for Scala

  • Well, that is sometimes possible, depending on a structure of Foo. If you have a List, for instance, you can iterate every element, and if every element is A, then it's safe to cast a list to List[A]. In fact, shapeless provides exactly that, in form of Typeable[List[A]], in a more generic form. I suppose shapeless also can derive a typeable instance for you, but I haven't dug into scala 3 version of it.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts