unisonweb/unison

eliminate references to `Input` from `Output`

Open

#1,141 opened on Jan 14, 2020

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Haskell (304 forks)batch import
good first issue

Repository metrics

Stars
 (6,624 stars)
PR merge metrics
 (Avg merge 12d 19h) (6 merged PRs in 30d)

Description

To the extent that Input and Output are separate to support easily porting the shell of UCM from one UI (CLI) to another (HTML), it's worth noting that the Input message of one is generally not meaningful in another.

If there are specific values in the Input constructor that are relevant to the output, just copy them into the Output constructor instead of passing through an arbitrary Input which must be matched on in OutputMessages with mostly impossible cases.

If the Output constructor is meant to handle many similar cases that could arise from various Inputs, split that Output constructor into several for those several specific cases.

My very bad for introducing the first such instance: data Output v = Success Input | ...
In this specific case, we don't actually inspect the Input field, so we can just drop it.

Contributor guide