decodeAsMaybe (Right (Just str)) = case decode str of
        Left decodeErr -> return $ Left (Error $ encode decodeErr)
        Right val      -> return $ Right (Just val)
decodeAsMaybe (Right (Just str)) = case decode str of
        Left decodeErr -> return $ Left (Error $ encode decodeErr)
        Right val      -> return $ Right (Just val)
decodeAsMaybe (Right (Just str)) = case decode str of
        Left decodeErr -> return $ Left (Error $ encode decodeErr)
        Right val      -> return $ Right (Just val)