Skip to content

Add a "Free" renderer implementation of IsBlock/IsInline #90

@lucasdicioccio

Description

@lucasdicioccio

I've recently embedded this library in my tool to generate my blog and I find it pretty cool as a user. So first-of all thanks.

Some context, the sort of things I want to do are vanity analytics about my content (much like the article<>topic graph on the homepage).

For such analytics, I realize I will have to run a number of statistics on the structure of the parsed blocks/inlines. Choices I have found so far are either:

  • one renderer per 'statistics' (e.g., collect the links so that I can draw a graph between articles, tell which website I link the most etc.)
  • one generic data-structure collector that I can then consume and pattern-match on

For the 2nd case, I think I'm about to implement the 'most mundane' implementation: a free implementation of IsBlock/IsInline/HasAttributes with a datatype that has one constructor per typeclass function, and wrapped in a newtyped list to get the Nonoid for free as well.

Do you foresee any issue with this approach? at first glance I think it's definitely approachable. Would you mind a PR adding it to this directory if needed (I've heard ZuriHac 2022 is approaching and it seems like a good project to hack on)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions