If I try to compile the above code with all warnings on, I get a pattern match non-exhaustive warning on safeHead because I'm not matching on Nil. This is pretty annoying. Is this the kind of thing that can easily be fixed? Can the compiler somehow magically recognise that if I've got a List x NonEmpty, then the only patterns to match on are Cons (because those are the only ones that return List x NonEmpty)? Or is there some theoretical barrier to this?