
24 Mar
2020
24 Mar
'20
12:26 p.m.
Hello Max, On Tue, Mar 24, 2020 at 04:06:03PM +0100, Max Gautier wrote:
Is there a way to factor out that boilerplate, in such a way that I could simply write a type like parser :: Parser <Type to parse> ?
The farther I've been is : type Parser s = ParsecT s () Identity type St = Stream s Identity Char (using ConstraintKinds) parser :: St s => Parser s <Type to Parse>
But that still feels tedious to write every time...
Is there any reason you are using `St s => s ...` rather than a concrete type? If not, type MyPar a = ParsecT Char () Identity a p :: MyPar Int could be useful. Does that work for you? -F