foldr1 and foldl1 are too restrictive
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 36/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Domaine
- backend
Piste de recherche
Start by comparing the proposed and current foldr1 signatures in the issue, then trace their definitions and the corresponding foldl1 implementation in the repository. Check existing tests for these functions and determine whether the proposed terminal-value mapping behavior can be supported without a full traversal; done means the API decision and its behavior are covered by tests. The issue has had no comment activity for over four years.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Should the signature of foldr1 (and similarly foldl1) be:
foldr1 :: forall f a b. Foldable1 f => (a -> b -> b) -> (a -> b) -> f a -> b
I understand the logic behind the current signature:
foldr1 :: forall f a b. Foldable1 f => (b -> b -> b) -> f b -> b
In that, if I have a mapping from a -> b, then I can pre-map unconditionally, and derive the latter signature. Unfortunately that's not actually what I want to do:
- I only want the mapping to apply to the terminal value.
- I want to otherwise combine with the combining function.
- I don't want to waste an entire traversal to make the signature work.
I feel like there's a missed opportunity with the current signature. To be honest, I almost never want the current signature.
- Langage dominant
- PureScript
- Étoiles
- 51
- Forks
- 57
- Merge moyen
- 3 j 14 min
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de purescript/purescript-foldable-traversable
-
Add `count`Ouvertestatus: accepted type: enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
purescript/purescript-foldable-traversable#140 · 7 commentaires ·
-
type: documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
purescript/purescript-foldable-traversable#139 · 1 commentaire ·
-
`Data.Traversable` re-exports `sum` from `Data.Foldable` but not `product`Peut-être pris @triallax l’a pris il y a 1959 jours. Ouvertetype: enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 25/100
purescript/purescript-foldable-traversable#137 · 5 commentaires ·
-
foldrMOuvertetype: enhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
purescript/purescript-foldable-traversable#136 · 3 commentaires ·
-
purs-0.15 type: breaking change
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
purescript/purescript-foldable-traversable#132 · 4 commentaires ·
Toutes les issues de purescript/purescript-foldable-traversable
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Mend: dependency security vulnerability
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Mend: dependency security vulnerability
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
ManageIQ/manageiq-pods#1476 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
prime-radiant-inc/evener#6366 ·
Les mainteneurs répondent en général sous 1 jour