Skip to content

Instantly share code, notes, and snippets.

@streamerd
Created March 7, 2018 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save streamerd/0de4b16b2c9b308914d09e892d61fa7a to your computer and use it in GitHub Desktop.
Save streamerd/0de4b16b2c9b308914d09e892d61fa7a to your computer and use it in GitHub Desktop.
source file: Project.hs
{- # LANGUAGE GeneralizedNewtypeDeriving #-}
module Project where
import Data.Text (Text)
newtype Money = Money
{ unMoney :: Double
} deriving (Show, Eq, Num)
newtype ProjectId = ProjectId
{ unProjectId :: Int
} deriving (Show, Eq, Num)
data Project
= Project ProjectId Text
| ProjectGroup Text [Project]
deriving (Show, Eq)
data Budget = Budget
{ budgetIncome :: Money
, budgetExpenditure :: Money
} deriving (Show, Eq)
data Transaction
= Sale Money
| Purchase Money
deriving (Show, Eq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment