Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: