Skip to content

Lenses for pandoc api (e.g. for Opts) #3923

@dbaynard

Description

@dbaynard

Hello,

It would be helpful to have lenses to change options when using the pandoc api.
This would not have to incur a dependency on lens, as these simple lenses can be defined using the microlens-th package, or just the microlens package and defining lenses manually as follows:

_optFilters :: Opts `Lens'` [FilePath]
_optFilters f Opt{..} = (\optFilters -> Opt{optFilters, ..}) <$> f optFilters
{-# INLINE _optFilters #-}

This could even be done with a DIY definition of Lens', and no new dependencies.

As a workaround, one can define lenses in programs or libraries that consume the pandoc api (as above), though this then scales poorly.

Would that be welcome?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions