S.is could do for me. However, I really like working with S.eitherFromUnion for scenarios where there's only two cases. This causes Schema to tag my types for me upon decoding.tagged utility that uses S.transformOrFail to tag my type with a given tag: