If I had a record like:
data MaybeTest = MaybeTest {
test0 :: String
test1 :: Maybe Int,
test2 :: Maybe Float,
test3 :: Maybe Int,
test4 :: Maybe String,
test5 :: Maybe String
}
deriving (Typeable, Data, Eq, Show)
is there a simple way to see if all the maybe fields are Nothing? I would like to return Nothing if the records fit this condition else return Just MaybeTest. I want to avoid my current long method of calling each Maybe field and checking if they are Nothing.