import { Maybe } from './Maybe'
import { Nothing, NOTHING } from './Nothing'
/**
* Given a Maybe it returns false if the Maybe is Just or
* true if it is a Nothing.
* @name isNothing(maybe: Maybe): maybe is Nothing
* @example
* import { isNothing, Maybe, Nothing } from '@typed/maybe'
*
* console.log(isNothing(Nothing)) // logs true
* console.log(isNothing(Maybe.of(1))) // logs false
*/
export function isNothing(maybe: Maybe): maybe is Nothing {
return !!(maybe as Nothing)[NOTHING]
}