Skip to content

There should be level-polymorphic versions of the combinators in Data.List.Categorical #951

Open

Description

@laMudri

The definitions of RawFunctor, RawApplicative, &c, by necessity, make it so that their fields (like _<$>_) only work on functions between types at the same level. This means, for example, that the _⊛_ we get from applicative in Data.List.Categorical has type ∀ {ℓ} {A B : Set ℓ} → List (A → B) → List A → List B. However, it would be convenient to have a definition of _⊛_ somewhere with type ∀ {a b} {A : Set a} {B : Set b} → List (A → B) → List A → List B.

Probably these definitions should go in Data.List.Base, though this would probably break any code using the categorical combinators because of name clashes.

There are probably similar problems in all of the other Categorical modules, but I haven't had a look at them yet.

Activity

  1. gallais commented on Oct 18, 2019

    @gallais
    Member

    Yep. See for instance the level polymorphic _>>=_ in Data.Maybe.Base.

  2. added this to the v1.2 milestone on Oct 18, 2019
  3. laMudri commented on Oct 18, 2019

    @laMudri
    ContributorAuthor

    Another funny thing is that RawMonad is not a subclass of RawApplicative, so the _⊛_ coming from monad is different to the one coming from applicative. When I tried just using the definition from applicative, it broke some proofs.

  4. gallais commented on Oct 18, 2019

    @gallais
    Member

    I'd argue that is a bug that we should definitely fix in version 2.0.

  5. MatthewDaggitt commented on Oct 19, 2019

    @MatthewDaggitt
    Collaborator

    I'd argue that is a bug that we should definitely fix in version 2.0.

    @laMudri maybe open a new issue for it?

  6. laMudri commented on Oct 19, 2019

    @laMudri
    ContributorAuthor
  7. MatthewDaggitt commented on Oct 29, 2019

    @MatthewDaggitt
    Collaborator

    If people are keen to include this in v1.2 as the milestone suggests, could someone open a PR in the next couple of days?

  8. JacquesCarette commented on Oct 29, 2019

    @JacquesCarette
    Collaborator

    It's easy enough to hand-code something, but that feels like cheating (and non-scalable). I do have a more level-polymorphic RawFunctor, but RawApplicative has resisted all my attempts at generalization.

  9. modified the milestones: v1.2, v1.3 on Nov 10, 2019
  10. removed this from the v1.3 milestone on Jan 14, 2020
  11. added this to the v2.0 milestone on Jul 11, 2021
  12. modified the milestones: v2.0, v3.0 on Sep 12, 2022
  13. MatthewDaggitt commented on Sep 12, 2022

    @MatthewDaggitt
    Collaborator

    Harder than first thought. According to @JacquesCarette needs some level-function hackery. Bumping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions