Created
September 26, 2017 15:40
-
-
Save Woody88/66c064c703697eaea88cf68eea5d2f84 to your computer and use it in GitHub Desktop.
PlanIt just for learning
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
module PlantIt where | |
import Control.Concurrent.STM | |
import Control.Monad | |
data Card = Zero | |
| Half | |
| One | |
| Two | |
| Three | |
| Five | |
| Eight | |
| ThirdT | |
| Twenty | |
| Forty | |
| Hundred | |
| None | |
| Coffe | |
deriving (Show, Enum, Eq) | |
type UserId = Int | |
data User = User { name :: String | |
, email :: String | |
, id_ :: UserId | |
, rooms :: [Room] | |
} deriving (Show) | |
data Room = Room { participants :: [UserId] | |
, stories :: StoryPlatform | |
} deriving (Show) | |
data StoryPlatform = StoryPlatform { activeStories :: [Story] | |
, completedStories :: [Story] | |
, allStories :: [Story] | |
} deriving (Show) | |
data Story = Story { title :: String | |
, votes :: [UserId] | |
, cards :: [Card] | |
} deriving (Show) | |
initializeUsers = newTVar newUser | |
newUser = User { name = "Woodson Delhia" | |
, email = "woodsondelhia@gmail.com" | |
, id_ = 1 | |
, rooms = newTVar | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment