News for hackers. Stuff that matters.
Re:Typing Lists and Tuples in Elixir by munchler on Wednesday August 28, 2024 @10:30AM (#41379927)
Yes, this is exactly what I was getting at. One ends up needing an explicit `toList` helper function that converts a non-empty list into a plain list.

Pattern matching on a non-empty list is also inelegant, because it is implemented as a tuple, which creates a leaky abstraction.

Re:Typing Lists and Tuples in Elixir by greener_grass on Wednesday August 28, 2024 @10:38AM (#41380017)
F# actually does have a good solution for pattern matching here, which is Active Patterns.