Created
March 7, 2018 12:16
-
-
Save streamerd/0de4b16b2c9b308914d09e892d61fa7a to your computer and use it in GitHub Desktop.
source file: Project.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- # 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