Skip to content

[#69] Replace `Wrapped` with custom typeclass that allows `deriving anyclass`

Moremi Vannak requested to merge rinn7e/#69-replace-wrapped into master

Description

Problem: Wrapped is a thing from lens which allows understanding newtype content. It would be nice to replace it with a custom typeclass for a couple of reasons:

  1. Wrapped cannot be used within deriving anyclass clause, one has to declare a standalone instance, and if we make a copy of Wrapped with the type family but without methods, then the problem will be resolved.

  2. Our custom typeclass can be documented, it would be nice to have exact use cases for it described.

Solution: Replace Wrapped with custom typeclass that is the same as Wrapped without its method.

Related issue(s)

Resolves #69 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Moremi Vannak

Merge request reports