Add a Testable instance for Either

Aberta
#92 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Domínio
testing

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
PureScript
Estrelas
108
Forks
42
Merge médio
2d 23h
PRs com merge (30d)
1

Preparar o ambiente

  • Sem Dockerfile nem arquivo Docker Compose
  • Tem um modelo de pull request
  • Sem guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de purescript/purescript-quickcheck

Todas as issues de purescript/purescript-quickcheck

Issues semelhantes

Mais issues de Testing & QA

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.