Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

Add dependent congruence of arity 1 and 2 for heterogeneous equality to Prelude

Open Russoul opened this issue 3 years ago • 14 comments

Russoul avatar May 05 '22 21:05 Russoul

I'm not sure this needs to be in prelude, the library meant for things you almost can't write any program without.

gallais avatar May 06 '22 08:05 gallais

Right, I remember now that Edwin emphasized that point of view a few times.

Russoul avatar May 06 '22 08:05 Russoul

Hmm... Are cong and cong2 needed for almost any program, then?

buzden avatar May 06 '22 09:05 buzden

"Not being able to write any program without" is rather vague. I am sure there are ways to interpret that for and against adding depCongX based on availability of congX. But I don't have a strong opinion. I don't mind relocating depCong or closing this altogether.

Russoul avatar May 06 '22 09:05 Russoul

I'm comfortable with moving cong and cong2 out of the prelude and into base.

ohad avatar May 21 '22 05:05 ohad

I'm comfortable with moving cong and cong2 out of the prelude and into base.

Please remember that such a change will break every library using these functions. Sure, the fix would be trivial, but we still have to be careful about breaking changes in the Prelude.

stefan-hoeck avatar May 21 '22 05:05 stefan-hoeck

In my experience cong is needed as soon as you try to prove anything about any program.

gallais avatar May 27 '22 08:05 gallais

In order to keep the name of the namespace consistent and expressive, I propose we place this function in a module Basics.Dependent in `base. How does that sound?

andrevidela avatar Sep 27 '22 16:09 andrevidela

I've been forwarded this thread from #2601

what's the purpose of Basics in Prelude and what would it's role be in base?

joelberkeley avatar Sep 27 '22 17:09 joelberkeley

Basics contains all the combinators on functions that we expect from a functional programming language, in particular it contains both cong and flip https://github.com/idris-lang/Idris2/blob/main/libs/prelude/Prelude/Basics.idr

Importing a dependent version of it seems to remain consistent with Prelude.Basics.

One thing that goes against this naming is that regular users aren't supposed to interact with the Basics namespace, so they almost certainly have no experience importing something from the Basics namespace, which would make importing from Basics.Dependent unintuitive

andrevidela avatar Sep 28 '22 14:09 andrevidela

@Russoul @gallais @joelberkeley any feedback or ideas about Basics.Dependent in base?

andrevidela avatar Sep 30 '22 12:09 andrevidela

One thing that goes against this naming is that regular users aren't supposed to interact with the Basics namespace

is this specific to Basics? Or is this just a consequence of being in Prelude?

joelberkeley avatar Sep 30 '22 14:09 joelberkeley

is this specific to Basics? Or is this just a consequence of being in Prelude?

It is a consequence of being in Prelude

andrevidela avatar Sep 30 '22 14:09 andrevidela

@Russoul @gallais @joelberkeley any feedback or ideas about Basics.Dependent in base?

That works for me! I don't really have a preference.

Russoul avatar Sep 30 '22 15:09 Russoul