News for hackers. Stuff that matters.
Re:Building a tiny little broken calculator with parser comb... by 2143 on Monday July 25, 2022 @12:40AM (#32220535)
To the original author:

Under "Parser Generator":

```

   const parseChar = char =>
  input => [
    input[0] === char,
    input.slice(1, input.length)
  ];

   const parseA = parseChar('A');
   const parseA = parseChar('B');

   parseA(testString) // [ true, 'bcd123' ]
   parseB(testString) // [ false, 'Abcd123' ]
```

There seems to be a typo: the 2nd "parseA" should really be a "parseB"?

Re:Building a tiny little broken calculator with parser comb... by jfo on Monday July 25, 2022 @03:21AM (#32221453)
Thanks, I have fixed it