Add a Testable instance for Either

Abierto
#92 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Área
testing

Línea de trabajo

Start by reading the existing Testable instances in purescript-quickcheck and the Either type and note usage shown in the issue. Determine which instance or instances are needed to make Either String Unit usable with the testing machinery, then check the project’s tests for the expected behavior. Done means the instance supports the shown composition pattern and has tests covering it.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

type: enhancement

Result is not a very composable data type, which makes it clunky to work with. If we add a Testable instance for Either String Unit we can use the whole machinery around the Either type and make testing a much more pleasant experience.

Contrived example of pleasant experience:

p :: Array String -> Either String Unit
p  a = do
  i <- note "Couldn't find hello." (elemIndex "hello" a)
  if mod i 2 > 0 
    then Left "hello isn't on an index divisible by two."
    else Right unit

In my opinion this experience becomes pleasant because I can use do-notation, note and a load of other niceties.

If you think this is a good idea I can implement the instance(s) needed and make a PR.

Lenguaje dominante
PureScript
Estrellas
108
Forks
42
Merge medio
2 d 23 h
PR fusionados (30 d)
1

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de purescript/purescript-quickcheck

Todos los issues de purescript/purescript-quickcheck

Issues similares

Más issues de Testing & QA

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.