isSomeOption()
isSomeOption<
A>(fa):fa is { _tag: "Some"; value: A }
Validates if a value is a valid Option type with Some tag.
Type Parametersโ
A: Aโ
The value type.
Parametersโ
fa: #### _tag: "Some" | "None"โ
The value to validate.
value?: Aโ
Returns: fa is { _tag: "Some"; value: A }โ
True if the value is a valid Some Option.
Sinceโ
2.0.0
Exampleโ
if (isSomeOption(fa)) {
return E.right(fa.value!);
}
return E.left(onNone());