-
- Downloads
Generalize functor expression parser
This allows to parser more complex expressions in a single functor (like the polynomial functor), instead of only unary and binary parsers. The downside is that implementing a functor parser got more complex: Each functor now has to call the `inner` parser by itself and also handle the case where the inner parser succeeds and the outer parser fails separately. This design doesn't sound particularly elegant, but there is no obvious other solution.
Showing
- src/MA/FunctorExpression/Parser.hs 44 additions, 47 deletionssrc/MA/FunctorExpression/Parser.hs
- src/MA/Functors/Bag.hs 1 addition, 1 deletionsrc/MA/Functors/Bag.hs
- src/MA/Functors/Distribution.hs 1 addition, 1 deletionsrc/MA/Functors/Distribution.hs
- src/MA/Functors/FixedProduct.hs 1 addition, 1 deletionsrc/MA/Functors/FixedProduct.hs
- src/MA/Functors/MonoidValued.hs 2 additions, 2 deletionssrc/MA/Functors/MonoidValued.hs
- src/MA/Functors/Powerset.hs 1 addition, 1 deletionsrc/MA/Functors/Powerset.hs
- src/MA/Functors/Product.hs 1 addition, 1 deletionsrc/MA/Functors/Product.hs
- src/MA/Parser.hs 2 additions, 2 deletionssrc/MA/Parser.hs
- tests/MA/FunctorExpression/ParserSpec.hs 5 additions, 4 deletionstests/MA/FunctorExpression/ParserSpec.hs
Loading
Please register or sign in to comment