A sum type
Simply-typed eliminator for Either
the action to take on Left
the action to take on Right
the sum to analyze
Convert an Either to a Maybe from Right injection
Remove a "useless" Either by collapsing the case distinction
True if the argument is Left, False otherwise
True if the argument is Right, False otherwise
Left is injective
Keep the payloads of all Left constructors in a list of Eithers
Convert a Maybe to an Either by using a default value in case of Nothing
the default value
Right becomes left and left becomes right
Split a list of Eithers into a list of the left elements and a list of the right elements
Right is injective
Keep the payloads of all Right constructors in a list of Eithers