valMayFromObj :: JSON a => String -> JSObject JSValue -> Result (Maybe a)
valMayFromObj cs obj = valFromObj cs obj >>= toMaybe
  where
    toMaybe JSNull = return Nothing
    toMaybe jv     = Just <$> readJSON jv
valMayFromObj :: JSON a => String -> JSObject JSValue -> Result (Maybe a)
valMayFromObj cs obj = valFromObj cs obj >>= toMaybe
  where
    toMaybe JSNull = return Nothing
    toMaybe jv     = Just <$> readJSON jv
valMayFromObj cs obj = valFromObj cs obj >>= toMaybe
  where
    toMaybe JSNull = return Nothing
    toMaybe jv     = Just <$> readJSON jv