Skip to content

[ refactor ] Make Data.Irrelevant.Irrelevant a proper Monad#2977

Merged
jamesmckinna merged 2 commits intoagda:masterfrom
jamesmckinna:irrelevant-Monad
Apr 20, 2026
Merged

[ refactor ] Make Data.Irrelevant.Irrelevant a proper Monad#2977
jamesmckinna merged 2 commits intoagda:masterfrom
jamesmckinna:irrelevant-Monad

Conversation

@jamesmckinna
Copy link
Copy Markdown
Collaborator

@jamesmckinna jamesmckinna commented Apr 11, 2026

This is prompted by this comment and @gallais 's introduction of the λ∙ operator which shifts irrelevant application to ordinary application. In some sense, this PR offers the converse operation, provided the codomain is Irrelevant.

Rationale:

  • type of Data.Irrelevant._>>=_ now has that of a 'proper' monadic bind operator, which increases the range of its applicability wrt its type, but also permits the use of do-notation etc. downstream

Details:

  • irrelevant-recompute moves (as recompute) to Data.Irrelevant
  • is (currently) re-exported with its old name from Relation.Nullary.Recomputable
  • but could be deprecated, although to do so might introduce awkward dependency mangling

Badged as v2.4, because AFAICT this is a backwards-compatible (if fiddly) change.

Potential consequences: downstream, we can reconsider all (?) uses of the . modality in favour of the Irrelevant modality, and otherwise leave it encapsulated in Data.Irrelevant?

@Taneb
Copy link
Copy Markdown
Member

Taneb commented Apr 11, 2026

This looks very useful!

Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Collaborator

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to naming, I think this is a great change.

Copy link
Copy Markdown
Member

@gallais gallais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not like the original names but could not think of any fix.
The new ones make a lot of sense!

@jamesmckinna
Copy link
Copy Markdown
Collaborator Author

Thanks everyone!

@jamesmckinna jamesmckinna added this pull request to the merge queue Apr 20, 2026
Merged via the queue into agda:master with commit a5d4a19 Apr 20, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants