feat(users/Profpatsch/netencode): Add initial Haskell parser

A simple categorical parser that does not implement Monad, and does
not contain an `m` and some rudementary error message handling.

In the future I’d probably want to wrap everything in an additional
`m`, so that subparsers can somehow use `Selective` to throw errors
from within `m` that contain the parsing context if at all possible.
Hard to do without Monad, I have to say. Not even stuff like `StateT`
works without the inner `m` implementing `Monad`.

Change-Id: I1366eda606ddfb019637b09c82d8b0e30bd4e318
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7797
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
Profpatsch 2023-01-08 23:41:17 +01:00
parent 8cdefc5b25
commit cd40585ea4
7 changed files with 169 additions and 45 deletions

View file

@ -5,7 +5,9 @@ author: Profpatsch
maintainer: mail@profpatsch.de
library
exposed-modules: Netencode
exposed-modules:
Netencode,
Netencode.Parse
build-depends:
base >=4.15 && <5,
@ -16,5 +18,8 @@ library
data-fix,
bytestring,
attoparsec,
text,
semigroupoids,
selective
default-language: Haskell2010