Add a more general satisfyMaybe helper
authorMoritz Kiefer <moritz.kiefer@purelyfunctional.org>
Sat, 10 Aug 2019 08:08:02 +0000 (10:08 +0200)
committerMoritz Kiefer <moritz.kiefer@purelyfunctional.org>
Sat, 10 Aug 2019 08:08:02 +0000 (10:08 +0200)
commit1294a1fbb1578d87cc1fb4c10bc5f91e54cf9904
tree94a34a3a0ee582ff253536f5702fe0639698c7e7
parent84da82290f9d2527400b62af36db85fd639d0965
Add a more general satisfyMaybe helper

`satisfy` is a bit akward to use for the same reasons that `filter`
can sometimes be a bit awkward to use: You often have to repeat the
same check on the result you get from `satisfy`.

This PR adds a `satisfyMaybe` wrapper that acts a bit like `mapMaybe`
and avoids that issue. This also allows us to remove `castMsg`.
src/Language/Haskell/LSP/Test/Parsing.hs