Search Haskell Channel Logs

Saturday, February 25, 2017

#haskell channel featuring Aku, bollu,

bollu 2017-02-25 06:45:41
the parser doesn't _actually_ consume input
bollu 2017-02-25 06:45:45
but it still needs to produce output
bollu 2017-02-25 06:45:49
so what output should it produce?
bollu 2017-02-25 06:45:56
you need to _tell_ it what output to produce
bollu 2017-02-25 06:45:58
that is the "a"
bollu 2017-02-25 06:46:01
you return a Parser a
bollu 2017-02-25 06:46:11
which takes no input and produces the output you asked it t
bollu 2017-02-25 06:46:13
to*
Aku 2017-02-25 06:46:40
ohhkay
Aku 2017-02-25 06:46:44
got it
bollu 2017-02-25 06:47:05
which is why pEmpty a = \tok -> [(a, tok)]
bollu 2017-02-25 06:47:12
you simply accept the input stream
bollu 2017-02-25 06:47:20
and the "put" the a on the output stream
bollu 2017-02-25 06:47:26
while consuming none of the "tok"
bollu 2017-02-25 06:47:29
cool?
Aku 2017-02-25 06:47:38
Cool!
bollu 2017-02-25 06:47:39
so, I gotta run
Aku 2017-02-25 06:47:45
ya fine
bollu 2017-02-25 06:47:46
if you have questions, ping me when I am back
bollu 2017-02-25 06:47:47
or ask the channel
Aku 2017-02-25 06:47:51
Sure Thanks