Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

add `dflip`, a dependent version of `flip`

Open joelberkeley opened this issue 2 years ago • 11 comments

This came out of https://github.com/idris-lang/Idris2/issues/2589. I thought, since @buzden gave it a 👍🏻 I'd see if there was wider support for it

I'm very aware this is in one of the most core modules in the stdlib, so we'll want to be sure it's worth adding.

joelberkeley avatar Jul 27 '22 20:07 joelberkeley

The goal of prelude is to be as small as possible. dflip hasn't been something that's been asked for before so there is little reason to conclude it needs to exist in prelude. It would be nice to have but in that case, I would suggest to have it in base or maybe even contrib

andrevidela avatar Aug 02 '22 18:08 andrevidela

Happy to move it. Just let me know where

joelberkeley avatar Aug 02 '22 20:08 joelberkeley

To remain consistent with #2456 We should place this in the same spot. I proposed Basics.Dependent, I suggest you chime in the thread to tell us what you think of this namespace for it

andrevidela avatar Sep 27 '22 16:09 andrevidela

Control.Function, maybe? (I don't why it's in Control rather than Data like in Haskell).

gallais avatar Sep 27 '22 17:09 gallais

That would be fine but then what would be the namespace for #2456?

andrevidela avatar Sep 27 '22 17:09 andrevidela

moved it to Control.Function. Put it at the top of the file so it doesn't get confused with the [Bi]injective stuff further down

joelberkeley avatar Sep 27 '22 18:09 joelberkeley

Ah shoot the derive_traversable test is leaking information about the internal state of the compiler. :( Strange that the printing of EqMap uses named application rather than auto's @{}. :thinking:

gallais avatar Sep 27 '22 20:09 gallais

Are we putting this in Basics.Dependent? @gallais @joelberkeley

andrevidela avatar Oct 04 '22 13:10 andrevidela

I don't have a strong opinion one way or the other.

gallais avatar Oct 04 '22 13:10 gallais

I also don't have a strong opinion, though I would find it odd there being a Basics.Dependent without anything in Basics

joelberkeley avatar Oct 04 '22 16:10 joelberkeley

Ah shoot the derive_traversable test is leaking information about the internal state of the compiler. :( Strange that the printing of EqMap uses named application rather than auto's @{}. thinking

@gallais am i right in thinking that's not to do with this change? Should I wait for that to be fixed elsewhere?

joelberkeley avatar Oct 04 '22 16:10 joelberkeley

Ah shoot the derive_traversable test is leaking information about the internal state of the compiler. :( Strange that the printing of EqMap uses named application rather than auto's @{}. thinking

@gallais this PR still appears to be failing for this reason. Do you know when or if that issue will be fixed?

joelberkeley avatar Feb 27 '23 20:02 joelberkeley

The canonical solution is to use a bit of sed to drop numbers in the output

gallais avatar Feb 27 '23 20:02 gallais

The canonical solution is to use a bit of sed to drop numbers in the output

sorry I'm not following at all

joelberkeley avatar Feb 27 '23 21:02 joelberkeley

For instance: https://github.com/idris-lang/Idris2/blob/main/tests/idris2/basic044/run

gallais avatar Feb 27 '23 21:02 gallais

yeah I don't want this PR that much. Can close if no-one feels strongly

joelberkeley avatar Feb 27 '23 22:02 joelberkeley