Created
February 24, 2015 19:33
-
-
Save cschneid/01fae1e7727a2ab8563f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 DeriveGeneric #-} | |
| module StrawPoll.Types where | |
| import GHC.Generics | |
| import Data.Aeson | |
| data Poll = Poll String | |
| data Counter = Counter { count :: Int } deriving (Show, Generic) | |
| instance Counter ToJSON | |
| instance Counter FromJSON | |
| incrementCounter :: Counter -> Counter | |
| incrementCounter (Counter i) = Counter (i + 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment