Felipe S. S. Schneider
Felipe S. S. Schneider
[FEATURE] Strongly-typed user data (or: implementing generic traits for Cursive based on user data)
Hi @gyscos! I would like thank you for this nice library and ask you a question regarding extending `cursive` for more structured data/state management. It seems that user data is...
I can't currently provide the code, but the rest of the information is below. I'll try to provide a minimal example when I'm able to. Please let me know if...
[Basics](https://www.w3schools.com/js/js_json_datatypes.asp). [Specification](https://www.json.org/json-en.html).
Or find alternatives: - [x] `oneOf` - [x] `noneOf` - [x] `spaces` - [x] `space` - [x] `newline` - [x] `crlf` - [x] `endOfLine` - [ ] `tab` - [...
EDIT: avoid reinventing the wheel: - [parseutils](https://nim-lang.org/docs/parseutils.html) - [strutils](https://nim-lang.org/docs/strutils.html) Related to #6, #33 and #43.
And implement `choice` as well. EDIT: the following is what we need: - [ ] `empty` - [ ] `` - [ ] `some` - [ ] `many` [See here](https://hackage.haskell.org/package/base-4.6.0.1/docs/Control-Applicative.html#g:2).
Implement the relevant parsers from [`Text.Megaparsec.Char.Lexer`](https://hackage.haskell.org/package/megaparsec-9.0.1/docs/Text-Megaparsec-Char-Lexer.html#g:4). By the way, the following does *not* work ```nim import parseutils import microparsec let p = many1(digit).map(parseInt) echo p.parse("1234") + 1 # should be...
[Follow this idea](https://markkarpov.com/tutorial/megaparsec.html).
Like `satisfy`, which we can provide, but also provide (and use internally) a template called `satisfyIt`, which receives an *expression*.
The do-notation is the way to go in Haskell but might be the best solution in Nim. We could find an intermediate solution and [encourage smaller, composable parsers](https://stackoverflow.com/a/16726740/4039050) at the...