So if you were modeling a joke with algebraic data types, it’d be something like
newtype LaughterLevel = PositiveInt
type JokeException =
| NoOneLaughed
| KarenWasOffended
| NaziYelledIAgree
declare const tellJoke: (content: string) => Either<JokeException, LaughterLevel>