lue-bird/elm-partial-or-complete/1.0.1

NOTE: the latest version is 1.0.2

PartialOrComplete

| Partial partial -- keep going
| Complete complete -- done

– a pattern used in

Maybe it makes sense to have a shared type in a shared place? With shared documentation and helpers?

where PartialOrComplete is already being used

Step through a structure; stop when you're done.

Suggestions & additions welcome!

reasons for avoiding it

  • You don't want to require users to manually install this package for just the stoppable type and helpers?

  • In your domain, variant names can be more specific and descriptive than "partial" and "complete"?

  • You like avoiding package dependencies? → You can expect this package to not have breaking changes

  • You have the same intermediate and complete types and use

    type InProgress
        = Atom { info : Info, report : Maybe Report }
        | Structured (List InProgress)
    
    step : InProgress -> InProgress
    isDone : InProgress -> Bool

    → I do suggest looking into

    type Thing report
        = Atom { info : Info, report : report }
        | Structured (List (Thing report))
    
    step : Thing (Maybe Report) -> PartialOrComplete (Thing (Maybe Report)) (Thing Report)

    I'd say that's a tiny tiny bit nicer because you can't miss that you're already done.