I'm advocating that fromListN should be able to do basically anything if you violate its contract. It is in GHC.Exts, it isn't in a place marked Safe or Trustworthy, and it is designed to make _fast_ literals. Anything that compromises that mission to do other things, seems ill considered to me, as then you'd have to make the fast thing anyways under another and would lose the ability to get the notation which was the very reason why the class was created in the first place. When used by GHC for desugaring overloaded list literals fromListN
never has its contract violated.
If you want something safer for manual use where the length is a mere hint, build something safer, then put it in a subclass of IsList. There there are multiple semantics you might want. Do you truncate the list if it is longer than the number of elements supplied? Do you give fewer elements than the number specified if not enough are given to you? Do you just throw an error on length disagreement? Either way you are counting down twice, once on the list, once on the counter, doing potentially twice as much work as you go, possibly walking the list twice like how fromList can delegate to fromListN by computing a length.
Giving the hint-at-best, crash-at-worst version that at least doesn't segfault its own method name means fromListN and overloaded list literals do not pay for extra protection they do not need, and you can grab your safer version, which unlike fromListN could actually be (re)exported from a Trustworthy module along with the safe parts of IsList. The nice thing about this is that by importing that module the user could use your safer version, and use of OverloadedLists syntax doesn't care about fromListN being in scope.
The other caveat I had was just that I don't like the fact that IsList mashes toList and fromList together in one class, preventing its use in the case where a list is just one case of several, but this is completely orthogonal to the issue at hand, and if it were ever to be solved would need an issue/proposal in its own right.
-Edward