Note [Invertible view patterns]
For some view patterns, such as those that arise from expansion of overloaded patterns (as detailed in Note [Handling overloaded and rebindable patterns]), we are able to explicitly write out an inverse (in the sense of the previous Note [Builder for a bidirectional pattern synonym]). For instance, the inverse to the pattern (toList -> [True, False]) is the expression (fromListN 2 [True,False]) Keeping track of the inverse for such view patterns fixed #14380.
References 2
- Handling overloaded and rebindable patterns GHC.Rename.Pat
- Builder for a bidirectional pattern synonym GHC.Tc.TyCl.PatSyn
Referenced by 5
- GHC.Hs.Pat call site
- Desugaring overloaded list patterns GHC.Rename.Pat
- GHC.Rename.Pat call site
- GHC.Tc.TyCl.PatSyn call site
- Builder for a bidirectional pattern synonym GHC.Tc.TyCl.PatSyn