isNothing -package:beam-core

The isNothing function returns True iff its argument is Nothing.

Examples

Basic usage:
>>> isNothing (Just 3)
False
>>> isNothing (Just ())
False
>>> isNothing Nothing
True
Only the outer constructor is taken into consideration:
>>> isNothing (Just Nothing)
False
Yields True iff the argument is Nothing.
IS NULL comparison. For IS NOT NULL, you can negate this with not_, as in not_ (isNothing (person ^. PersonAge)) Warning: Persistent and Esqueleto have different behavior for != Nothing: TODO: table In SQL, = NULL and != NULL return NULL instead of true or false. For this reason, you very likely do not want to use !=. Nothing in Esqueleto. You may find these hlint rules helpful to enforce this:
- error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
- error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.val Nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
- error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.nothing, rhs: not_ (Database.Esqueleto.isNothing v), name: Use Esqueleto's not isNothing}
- error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.val Nothing, rhs: not_ (Database.Esqueleto.isNothing v), name: Use Esqueleto's not isNothing}
Check if the symbolic value is nothing.
>>> isNothing (sNothing :: SMaybe Integer)
True

>>> isNothing (sJust (literal "nope"))
False
Operator corresponding SQL IS NULL , and extended against record types.
Convert between Nothing and True (see isNothing). (not . isJust)
Operator corresponding SQL IS NULL , and extended against record types.
Test that a Maybe is Nothing.
Analogous to isNothing, but for MaybeT
An alias for isNothing that avoids clashing with the function from Data.Maybe isNothing.
Type class for types which can be safely cast to NothingAction, for instance with toNothingAction.