4YZYDSDVJFE7RB47LPOUIOQ3U5XBTSJ53UG4TY42VXZI7O3NX7AAC main = dolet inc = PosMoney @"SEK" $ unsafePos "" 15_550r = defaultRule
main = runInputT defaultSettings gowherego :: InputT IO ()go = doinput <- readInput "Income: " (readEither @Int)case input ofLeft x -> liftIO $ hPutStrLn stderr ("An error occurred: " ++ x)Right x -> dolet income = mkIncome xliftIO $ print income
print $ calculate r inc
readInput :: String -> (String -> Either String b) -> InputT IO (Either String b)readInput prompt f = doinput <- getInputLine promptcase input ofNothing -> return $ Left "Input Interrupted"Just x -> return $ f xmkIncome :: Int -> Either String (PosMoney "USD")mkIncome input = eitherPos input >>= return . PosMoney @"USD"