`second`/`right` derived from `first`/`left`
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 28/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Domaine
- backend
Piste de recherche
The issue asks whether Strong and Choice can derive second and right from first and left, and whether PureScript’s lack of default type class implementations explains the current design. Start by reading the Strong and Choice definitions and their implementations; the issue names no files or tests. Done means establishing the design reason and whether changing the class definitions is viable.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Is there any reason why Strong/Choice require second/right and not instead derive them from first/left?
secondBasedOnFirst :: forall p a b c. Strong p => p a b -> p (Tuple c a) (Tuple c b)
-- equivalent to `second`?
secondBasedOnFirst = dimap swap swap <<< first
where
swap :: forall x y. Tuple x y -> Tuple y x
swap (Tuple a b) = Tuple b a
rightBasedOnLeft :: forall p a b c. Choice p => p a b -> p (Either c a) (Either c b)
-- equivalent to `right`?
rightBasedOnLeft = dimap flip flip <<< left
where
flip :: forall x y. Either x y -> Either y x
flip (Left a) = Right a
flip (Right b) = Left b
Is this only because of lack of default type class member implementations feature in PureScript or is there any other reason?
- Langage dominant
- PureScript
- Étoiles
- 34
- Forks
- 13
- Merge moyen
- 3 j 10 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-profunctor
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Add `Mux` and `Demux`Ouvertestatus: needs more info
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
purescript/purescript-profunctor#32 · 1 commentaire ·
-
Add Choice CostarOuvertetype: enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
Toutes les issues de purescript/purescript-profunctor
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