Remove some incomplete pattern matches#299
Conversation
They only appear when linear-base with ghc HEAD (`ab5fd982`, slightly newer than GHC 9.0.1 release). Likely the recent pattern exhaustiveness checking are relevant, but I don't know why the released version throws these errors.
src/Data/List/Linear.hs
Outdated
| -- this branch is impossible since we know that 'as' has at least one | ||
| -- element inside. |
There was a problem hiding this comment.
But this is not as, this is the result of scanr1. Which, accordingly, is actually not empty.
There was a problem hiding this comment.
Right. I was thinking scanr1 returns a non-empty list because as is non-empty; which is unnecessarily indirect. I'll fix the comment.
|
It's probably too late to change this bit of API, indeed. Unless we really really want to. It could make some sense, but we'd have to carefully weigh the option. If I remember correctly, the Generic Scans paper gives scans a type like I guess that we'll probably keep returning lists. |
They only appear when linear-base with ghc HEAD (
ab5fd982, slightlynewer than GHC 9.0.1 release). Likely the recent pattern exhaustiveness
checking are relevant, but I don't know why the released version does not throw
these errors.
Anyhow, unfortunately they're only exhaustive because of the implementation
rather than the types, so I added other cases as bottoms.
(Making
scanrreturnNonEmptywould solve one of the problems, but I donot think it's worth diverging the API from
Data.Listand also we don't haveData.List.NonEmpty.Linear)