hpc 2017-02-06 13:45:12
ah
monochrom 2017-02-06 13:45:16
perhaps "neg"
erisco 2017-02-06 13:45:16
trying to give little names to this zoo of axioms and theorems
Ptival 2017-02-06 13:50:42
is there any parsing solution that lets the parser be extended with notations at run-time? (something like notations in Coq/Agda/Idris?)
ertes 2017-02-06 14:04:50
Ptival: csvHeadLine :: Parser (Parser Row) -- parse the head row and return a parser that parses future rows
ertes 2017-02-06 14:05:03
csvHeadLine >>= many
ertes 2017-02-06 14:05:06
something like that?
Koterpillar 2017-02-06 14:06:36
seems right; also, try and find out :P
Ptival 2017-02-06 14:27:35
well, I guess it could look like that, I was more thinking of an iterative process, where addNotation :: Parser Thing -> Notation -> Parser Thing
Ptival 2017-02-06 14:27:52
but with heavy machinery :\
ertes 2017-02-06 14:28:20
StateT (F (Parser Thing)) Parser
ertes 2017-02-06 14:28:24
with a suitable F
ertes 2017-02-06 14:29:42
any monadic parser combinator library can treat parsers as first-class, so parsers can result in parsers, and those resulting parsers can be integrated for the remainder of the grammar
Ptival 2017-02-06 14:30:06
I mean, I'm sure I can write one, I was more interested in knowing if this whole business of adding notations with different precedences/associativity, and generating a parser/printer from the existing known notations, was somewhere to be found
Ptival 2017-02-06 14:30:31
but it seems everyone just writes their own
ertes 2017-02-06 14:31:00
megaparsec and trifecta have ready-made infix expression parsers
Ptival 2017-02-06 14:31:02
I was testing Boomerang, but it hangs on nothing but basic input
ertes 2017-02-06 14:31:17
boomerang can't do it
ertes 2017-02-06 14:31:25
you need a monadic parser library
ertes 2017-02-06 14:32:09
boomerang sacrifices the flexibility of Monad to support constructing printers at the same time… that's something a monadic parser type can't do
Ptival 2017-02-06 14:32:23
yeah I noticed that, it's all Monoids
Welkin 2017-02-06 14:32:30
it's monoids all the way down
Ptival 2017-02-06 14:32:32
I guess I'll write the printers
Welkin 2017-02-06 14:32:59
but but
Welkin 2017-02-06 14:33:05
monads are monoids!
Welkin 2017-02-06 14:33:22
I suppose not in haskell though
Welkin 2017-02-06 14:34:10
I'm curious why there are so many parser libraries since I last looked
Welkin 2017-02-06 14:34:23
I remember megaparsec is a fork of parsec
Welkin 2017-02-06 14:34:27
never heard of boomerang
Welkin 2017-02-06 14:34:34
why did edwardk write trifecta?
jle` 2017-02-06 14:40:25
is there a newtype wrapper that gives the backwards Traversable instace?
jle` 2017-02-06 14:41:30
oh there's Backwards
erisco 2017-02-06 14:44:39
jle`, I am not sure a -> Void is going to work for negation always... it certainly seems wrong for this
erisco 2017-02-06 14:44:55
a :< b -> Not (a := b) where Not a = a -> Void