Skip to content

Instantly share code, notes, and snippets.

@Woody88
Created September 26, 2017 15:40
Show Gist options
  • Save Woody88/66c064c703697eaea88cf68eea5d2f84 to your computer and use it in GitHub Desktop.
Save Woody88/66c064c703697eaea88cf68eea5d2f84 to your computer and use it in GitHub Desktop.
PlanIt just for learning
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