agda-stdlib icon indicating copy to clipboard operation
agda-stdlib copied to clipboard

`Pointed`: `Setoid` with a distinguished point

Open jamesmckinna opened this issue 2 years ago • 3 comments

This concept doesn't exist in the library (for Set, Data.Maybe does the trick of course), so we should add it.

But where should it belong? A Setoid-with-a-point: is it an Algebra (with a very boring signature, consisting of a single nullary operation), or a special kind of Setoid, and hence should live with those things under Relation.Binary?

(this may be a separate library design pain point regarding Setoid: is that an Algebra too, albeit one with no operations?)

UPDATED: grrr. Pointed introduced in two ways already. Once to add a distinguished point; this apparently lives under Relation.Nullary.Construct.Add.Point where

open import Data.Maybe.Base public
  using () renaming (Maybe to Pointed; nothing to ∙; just to [_])

and once to add a distinguished point which is moreover an identity for a binary operation. And overloading the shared common use of Maybe as the representing Free functor. This seems a bit wart-y how to proceed?

Either way, we might then want a Free such thing, (cf. #1962 / #1954 ) and know that its algebra is that of the usual adjoint/monadic situation arising from Maybe and the forgetful operation of throwing away the distinguished point.

jamesmckinna avatar Apr 29 '23 14:04 jamesmckinna

I picture Pointed as a theory, so a record. What Relation.Nullary.Construct.Add.Point does is build the free Pointed on a Set, as @jamesmckinna says.

Maybe isn't a theory, it's a data-structure -- which is a standard implementation of the Free Pointed Set.

JacquesCarette avatar May 04 '23 22:05 JacquesCarette

Disentangling the existing design to separate out the various use cases seems like: "Another one to punt until after v2.0, I think ;-)"

UPDATED: now we are at such a point, what is the best way to proceed? Suggestions @JacquesCarette ?

jamesmckinna avatar Sep 13 '23 09:09 jamesmckinna

I still see it as something that belongs in Algebra. It could be called Pointed but also PointedCarrier, PointedSet, PointedSetoid, I'm ok with all of those.

JacquesCarette avatar Jan 19 '24 20:01 JacquesCarette