ZJ6BESB2ZX5KZWQRANKZFHPP64H3WQHF56PMFFMZIKVSIZSX3SXAC module Main (main) wheremain :: IO ()main = putStrLn "Test suite not yet implemented."
module Budget (Positive,calculate,positive,getPositive,) wheredata Budget = Budget{ needs :: Positive, wants :: Positive, savings :: Positive}deriving (Show)newtype Positive = Positive {unPositive :: Word} deriving (Show)type Income = Positivepositive :: Int -> Maybe Positivepositive x| x > 0 = Just . Positive . fromIntegral $ x| otherwise = NothinggetPositive :: Positive -> WordgetPositive = unPositivecalculate :: Income -> Budgetcalculate (Positive income) = Budget (Positive needs) (Positive wants) (Positive savings)whereneeds = income `quot` 2wants = income - needs - savingssavings = income `quot` 5
cabal-version: 2.4name: budgetversion: 0.1.0.0synopsis: A personal budgeting app-- A longer description of the package.-- description:homepage:-- A URL where users can report bugs.-- bug-reports:license: MITlicense-file: LICENSEauthor: Wgaffamaintainer: subscription@skriptladan.se-- A copyright notice.-- copyright:category: Financeextra-source-files: CHANGELOG.mdlibraryexposed-modules: Budget-- Modules included in this library but not exported.-- other-modules:-- LANGUAGE extensions used by modules in this package.-- other-extensions:build-depends: base ^>=4.16.4.0hs-source-dirs: libdefault-language: Haskell2010executable budgetmain-is: Main.hs-- Modules included in this executable, other than Main.-- other-modules:-- LANGUAGE extensions used by modules in this package.-- other-extensions:build-depends:base ^>=4.16.4.0,budgeths-source-dirs: appdefault-language: Haskell2010test-suite budget-testdefault-language: Haskell2010type: exitcode-stdio-1.0hs-source-dirs: testmain-is: MyLibTest.hsbuild-depends: base ^>=4.16.4.0
module Main whereimport qualified MyLib (someFunc)main :: IO ()main = doputStrLn "Hello, Haskell!"MyLib.someFunc
Copyright (c) 2023 WgaffaPermission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Revision history for budget## 0.1.0.0 -- YYYY-mm-dd* First version. Released on an unsuspecting world.