Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

names of things (vol. 94): Relation.Nullary.Reflects #2058

Open
jamesmckinna opened this issue Aug 15, 2023 · 0 comments
Open

names of things (vol. 94): Relation.Nullary.Reflects #2058

jamesmckinna opened this issue Aug 15, 2023 · 0 comments

Comments

@jamesmckinna
Copy link
Contributor

jamesmckinna commented Aug 15, 2023

In the course of #2055 (which has grown quite a bit, albeit in essentially trivial ways), I kept banging my head against Reflects.invert, and its friend of.

I'm loath to change already-chosen constructor names (though personally find ofʸ and ofⁿ annoying: why not ofᵗ and ofᶠ which at least correlate typography with semantics?), as they can be worked around with pattern synonyms, but functions are harder, requiring renaming/deprecation... (boo-hoo).

I don't find of at all helpful, even though it is, at least, derived from the above constructors. I find invert even worse, as it's not at all obvious what is even being inverted; in that respect, at a pinch, of⁻¹ might already be a better name.

But 'really', both these operations are the introduction and elimination forms of the Reflects view (there's a separate issue about it being called an 'idiom' in the stdlib, when from my perspective, it simply is a Set-indexed view of Bool), so custom and practice elsewhere in the library suggests the following renaming/deprecation:

  • of ↦ reflects⁺
  • invert ↦ reflects⁻

Yes? No! Maybe!? (See also #2155 for an alternative naming scheme)

Similarly, rather than the heavy and verbose toWitnessTrue etc., and going with the grain of Yes/No (types of values of answers to questions) instead of True, False (judgments of fact, much weightier epistemologically, cued by the scare quotes around "truth" in the comments), suggest instead for Relation.Nullary.Decidable.Core:

  • True ↦ Yes
  • False ↦ No
  • toWitness ↦ yes⁻
  • fromWitness ↦ yes⁺
  • toWitnessFalse ↦ no⁻
  • fromWitness ↦ no⁺
    etc. for From-yes... etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant