Pattern synonyms and view pattern arguments
In my code, I had a few complicated patterns involving view patterns that depended on local arguments, i.e.
foo env (someView env -> Just x) = ...
I was hoping to be able to use PatternSynonyms to abstract and simplify this:
pattern Pat env x <- (someView env -> Just x) foo env (Pat env x) = ...
but it says
Not in scope: env.
It would be nice if I could use pattern synonyms here as well.