ekmett / ekmett/profunctors

Inverse of Forget

Open
#97 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
72
Forks
44
PR merge metrics
No merged PRs in 30d

Description

`optics` uses `Forget` for `view` and `Tagged` (the flip of `Const`, if anyone is curious) for `review`, but one can also define `review` using a profunctor that’s more clearly related to `Forget`:

```haskell
newtype Forget r a b = Forget { runForget :: a -> r }
newtype Recall s a b = Recall { runRecall :: s -> b }
```

I have defined such a creature for reasons, and, happily, it admits instances of (at least) `Costrong`, `Choice`, `Closed`, `Cosieve` _and_ `Sieve`, but only `Corepresentable`; and at a lower rank, `Distributive`, `Representable`, and so on.

If there’d be any interest in it living here I will be happy to submit a PR.

Contributor guide

No contributing guide indexed for this repository

Research direction

Review how optics currently uses Forget for view and Tagged for review, then determine where a Recall type and its stated profunctor instances would belong. Confirm the supported instances and their lower-rank variants, and consider the feature complete when the implementation and corresponding coverage are integrated into the profunctors library.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.