Comment

Comment by munchler

> I’ve also heard that functional languages lend themselves especially well to parsing tasks, and I’ve never understood why, so it’s a good opportunity to learn.

This is mainly due to a technique called "parser combinators", which can be expressed very cleanly in functional languages. The idea is to start with a standard set of primitive general-purpose parsers and combine them into more complex parsers that are specific to the task at hand. If you have an interest in either functional programming or parsing in general, parser combinators are good to have in your toolkit.

It looks like Gleam has at least two parser combinator packages that you might be able to use:

    • party (https://hexdocs.pm/party/)
    • parser_gleam (https://hexdocs.pm/parser_gleam/)
parent munchler 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton