forall

Returns false if the option is None, otherwise it returns the result of applying the predicate to the option value.

Type

type forall = <T>(predicate: Predicate<T>) => (option: Option<T>) => boolean

Examples

import {forall, Some, None} from 'fnxt/option';

const some = forall((x:number)=> x > 5);
some(Some(42))  // -> true
some(Some(0))   // -> false
some(None)      // -> true

See Also