fix the left()/right() predicates such that they return an Either

This commit is contained in:
erik-krogh
2022-12-08 15:16:32 +01:00
parent b1001d1a10
commit 0a828f7b31

View File

@@ -33,8 +33,8 @@ module Either<TypeWithToString Left, TypeWithToString Right> {
}
/** Makes an `Either` from an instance of `Left` */
Left left(Left c) { result = c }
Either left(Left c) { result.asLeft() = c }
/** Makes an `Either` from an instance of `Right` */
Right right(Right c) { result = c }
Either right(Right c) { result.asRight() = c }
}