isJust package:universum

The isJust function returns True iff its argument is of the form Just _.

Examples

Basic usage:
>>> isJust (Just 3)
True
>>> isJust (Just ())
True
>>> isJust Nothing
False
Only the outer constructor is taken into consideration:
>>> isJust (Just Nothing)
True