Hacker News new | ask | show | jobs
by munchler 830 days ago
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.

1 comments

F# actually does have a good solution for pattern matching here, which is Active Patterns.