F3PSUKWXAFKSWPWD4OFGDMMOPGRZVLJWWHNWOHRDP677PZVFTRIQC
input <- readInput "Income: " (readEither @Int)
case input of
Left x -> liftIO $ hPutStrLn stderr ("An error occurred: " ++ show x)
Right x -> do
case calculateBudget x of
Left e -> liftIO $ hPutStrLn stderr ("An error occured: " ++ show e)
Right x -> liftIO $ print x
income <- readInput "Income: " (readEither @Int)
budget <- calculateBudget income
liftIO $ print budget
mkIncome :: Int -> Either AppError (PosMoney "USD")
mkIncome input = mapLeft (const NegativeIncome) $ eitherPos input >>= return . PosMoney @"USD"
mkIncome :: Int -> App (PosMoney "USD")
mkIncome input = liftEither . mapLeft (const NegativeIncome) $ eitherPos input >>= return . PosMoney @"USD"