1. 16
  1. 2

    In Gleam, could you constrain the Currency phantom type to require a formatting interface?

    1. 2

      Gleam doesn’t have type classes or other forms of implicit interfaces, so no. You could however explicitly pass in an implentation of the format function for the given type, which is what type classes desugar to.

    2. 2

      Gleam aside this is a very clear introduction to phantom types, thanks!