[Haskell-cafe] Need help to get started
Jim Tyrer
tech at jimtyrerrobotics.ca
Sun Oct 18 15:40:51 UTC 2020
Thanks for all the input.
Honestly I was expecting to be curtly told to go and RTFM.
So very pleasantly surprised thank you.
On 2020-10-17 6:18 p.m., Henning Thielemann wrote:
>
> On Sat, 17 Oct 2020, Jack Kelly via Haskell-Cafe wrote:
>
>> 3. At this stage, we have a parsing problem. We want a function like
>> `parseEntry :: Text -> Either Text Entry`, where the `Left` side would
>> be an error message (if that line fails to parse), or the `Entry`
>> describing that line. I can see a couple of ways to attack this:
>>
>> a) Use Text.words and continue with ad-hoc parsing. You may find
>> yourself reinventing wheels that are in the library ecosystem, but for
>> learning that might be fine?
>> b) Use a library like megaparsec and write a full-blown parser. You
>> will get more for free, but the learning curve may be steeper.
>
> The text file looks like space-separated values. Thus, the cassava
> library may help parsing stuff into the data type.
More information about the Haskell-Cafe
mailing list