The Hackage documentation for Maybe lists can be folded up as one of the possible types. It also contains the following function:
null :: Maybe a -> Bool
He even refers to the implementation of this function (from Foldable):
null :: t a -> Bool
null = foldr (\_ _ -> False) True
... which seems pretty reasonable. It also works: I can, if I import qualified Data.Foldable, use foldrMaybe for values.
However, when I try to call nullon Maybe, Haskell thinks I want to use null intended for lists:
Prelude> :t null
null :: [a] -> Bool
Prelude> null Nothing
<interactive>:3:6:
Couldn't match expected type `[a0]' with actual type `Maybe a1'
In the first argument of `null', namely `Nothing'
In the expression: null Nothing
In an equation for `it': it = null Nothing
I know what it is isJust, I'm just wondering how to call a type function nullfor any Foldable.