Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- slHead :: SortedList a -> a
- data PlayedGame c s m = PlayedGame {
- _gameExtra :: !m
- _gameSorted :: !(SortedList (s, c))
- gameSorted :: forall c s m c s. Lens (PlayedGame c s m) (PlayedGame c s m) (SortedList (s, c)) (SortedList (s, c))
- gameExtra :: forall c s m m. Lens (PlayedGame c s m) (PlayedGame c s m) m m
- data Bracket c s m = Bracket {
- _bPlayed :: ![[PlayedGame c s m]]
- _bUpcoming :: ![[c]]
- _bCurrent :: !(Maybe (PlayedGame c s m))
- class HasBracket c c s m | c -> c s m where
- bracket :: Lens' c (Bracket c s m)
- bCurrent :: Lens' c (Maybe (PlayedGame c s m))
- bPlayed :: Lens' c [[PlayedGame c s m]]
- bUpcoming :: Lens' c [[c]]
- data KuritaGame = KGame {
- _kgEndTime :: !UTCTime
- _kgCommentary :: [(UTCTime, Text)]
- kgEndTime :: Lens' KuritaGame UTCTime
- kgCommentary :: Lens' KuritaGame [(UTCTime, Text)]
- changeVoteType :: (Ord c, Ord s2) => (s1 -> s2) -> Bracket c s1 a -> Bracket c s2 a
- seedBracket :: (Ord c, Ord s, Monoid s) => ([c] -> m) -> (Int -> [c] -> m) -> [c] -> Bracket c s m
- finishGame :: (Ord c, Ord s, Monoid s) => ([c] -> m) -> (Int -> [c] -> m) -> Bracket c s m -> Bracket c s m
- upToGame :: (Ord c, Ord s, Monoid s) => ([c] -> m) -> [c] -> PlayedGame c s m
- addScores :: (Ord c, Ord s, Semigroup s) => [(c, s)] -> Bracket c s a -> Bracket c s a
- addScore :: (Ord c, Reifies p Integer) => c -> Word32 -> Bracket c (HyperLogLog p) a -> Bracket c (HyperLogLog p) a
- data ClientGame = CGame {
- _cgEndTime :: !UTCTime
- _cgCommentary :: [Text]
- k2cGame :: KuritaGame -> ClientGame
- data TDown c
- = BattleStart {
- tdBrackets :: Bracket c Int64 ClientGame
- | ScoreUpdate [(c, Int64)]
- = BattleStart {
- data TUp c = Vote c
- data RUp hllsz c = Votes [(c, HyperLogLog hllsz)]
- decodeHLL :: Reifies p Integer => Value -> Parser (HyperLogLog p)
Documentation
data PlayedGame c s m Source #
Who played in a game, the score they got, sorted in score order.
PlayedGame | |
|
Instances
Functor (PlayedGame c s) Source # | |
Defined in Kurita.Protocol fmap :: (a -> b) -> PlayedGame c s a -> PlayedGame c s b # (<$) :: a -> PlayedGame c s b -> PlayedGame c s a # | |
(Eq m, Eq s, Eq c) => Eq (PlayedGame c s m) Source # | |
Defined in Kurita.Protocol (==) :: PlayedGame c s m -> PlayedGame c s m -> Bool # (/=) :: PlayedGame c s m -> PlayedGame c s m -> Bool # | |
(Ord m, Ord s, Ord c) => Ord (PlayedGame c s m) Source # | |
Defined in Kurita.Protocol compare :: PlayedGame c s m -> PlayedGame c s m -> Ordering # (<) :: PlayedGame c s m -> PlayedGame c s m -> Bool # (<=) :: PlayedGame c s m -> PlayedGame c s m -> Bool # (>) :: PlayedGame c s m -> PlayedGame c s m -> Bool # (>=) :: PlayedGame c s m -> PlayedGame c s m -> Bool # max :: PlayedGame c s m -> PlayedGame c s m -> PlayedGame c s m # min :: PlayedGame c s m -> PlayedGame c s m -> PlayedGame c s m # | |
(Show m, Show s, Show c) => Show (PlayedGame c s m) Source # | |
Defined in Kurita.Protocol showsPrec :: Int -> PlayedGame c s m -> ShowS # show :: PlayedGame c s m -> String # showList :: [PlayedGame c s m] -> ShowS # | |
(FromJSON c, FromJSON s, FromJSON m, Ord c, Ord s) => FromJSON (PlayedGame c s m) Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser (PlayedGame c s m) parseJSONList :: Value -> Parser [PlayedGame c s m] | |
(ToJSON c, ToJSON s, ToJSON m) => ToJSON (PlayedGame c s m) Source # | |
Defined in Kurita.Protocol toJSON :: PlayedGame c s m -> Value toEncoding :: PlayedGame c s m -> Encoding toJSONList :: [PlayedGame c s m] -> Value toEncodingList :: [PlayedGame c s m] -> Encoding |
gameSorted :: forall c s m c s. Lens (PlayedGame c s m) (PlayedGame c s m) (SortedList (s, c)) (SortedList (s, c)) Source #
gameExtra :: forall c s m m. Lens (PlayedGame c s m) (PlayedGame c s m) m m Source #
Bracket | |
|
Instances
Functor (Bracket c s) Source # | |
(Eq m, Eq s, Eq c) => Eq (Bracket c s m) Source # | |
(Ord m, Ord s, Ord c) => Ord (Bracket c s m) Source # | |
Defined in Kurita.Protocol compare :: Bracket c s m -> Bracket c s m -> Ordering # (<) :: Bracket c s m -> Bracket c s m -> Bool # (<=) :: Bracket c s m -> Bracket c s m -> Bool # (>) :: Bracket c s m -> Bracket c s m -> Bool # (>=) :: Bracket c s m -> Bracket c s m -> Bool # | |
(Show m, Show s, Show c) => Show (Bracket c s m) Source # | |
(FromJSON c, FromJSON s, FromJSON m, Ord c, Ord s) => FromJSON (Bracket c s m) Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser (Bracket c s m) parseJSONList :: Value -> Parser [Bracket c s m] | |
(ToJSON c, ToJSON s, ToJSON m) => ToJSON (Bracket c s m) Source # | |
Defined in Kurita.Protocol toJSON :: Bracket c s m -> Value toEncoding :: Bracket c s m -> Encoding toJSONList :: [Bracket c s m] -> Value toEncodingList :: [Bracket c s m] -> Encoding | |
HasBracket (Bracket c s m) c s m Source # | |
class HasBracket c c s m | c -> c s m where Source #
bracket :: Lens' c (Bracket c s m) Source #
bCurrent :: Lens' c (Maybe (PlayedGame c s m)) Source #
bPlayed :: Lens' c [[PlayedGame c s m]] Source #
Instances
HasBracket (Bracket c s m) c s m Source # | |
data KuritaGame Source #
KGame | |
|
Instances
Eq KuritaGame Source # | |
Defined in Kurita.Protocol (==) :: KuritaGame -> KuritaGame -> Bool # (/=) :: KuritaGame -> KuritaGame -> Bool # | |
Ord KuritaGame Source # | |
Defined in Kurita.Protocol compare :: KuritaGame -> KuritaGame -> Ordering # (<) :: KuritaGame -> KuritaGame -> Bool # (<=) :: KuritaGame -> KuritaGame -> Bool # (>) :: KuritaGame -> KuritaGame -> Bool # (>=) :: KuritaGame -> KuritaGame -> Bool # max :: KuritaGame -> KuritaGame -> KuritaGame # min :: KuritaGame -> KuritaGame -> KuritaGame # | |
Show KuritaGame Source # | |
Defined in Kurita.Protocol showsPrec :: Int -> KuritaGame -> ShowS # show :: KuritaGame -> String # showList :: [KuritaGame] -> ShowS # | |
FromJSON KuritaGame Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser KuritaGame parseJSONList :: Value -> Parser [KuritaGame] | |
ToJSON KuritaGame Source # | |
Defined in Kurita.Protocol toJSON :: KuritaGame -> Value toEncoding :: KuritaGame -> Encoding toJSONList :: [KuritaGame] -> Value toEncodingList :: [KuritaGame] -> Encoding |
kgEndTime :: Lens' KuritaGame UTCTime Source #
kgCommentary :: Lens' KuritaGame [(UTCTime, Text)] Source #
seedBracket :: (Ord c, Ord s, Monoid s) => ([c] -> m) -> (Int -> [c] -> m) -> [c] -> Bracket c s m Source #
finishGame :: (Ord c, Ord s, Monoid s) => ([c] -> m) -> (Int -> [c] -> m) -> Bracket c s m -> Bracket c s m Source #
Finishes the current game and start the next, generating a new round if need be, or finishing the game if this was the last round.
addScore :: (Ord c, Reifies p Integer) => c -> Word32 -> Bracket c (HyperLogLog p) a -> Bracket c (HyperLogLog p) a Source #
data ClientGame Source #
CGame | |
|
Instances
Eq ClientGame Source # | |
Defined in Kurita.Protocol (==) :: ClientGame -> ClientGame -> Bool # (/=) :: ClientGame -> ClientGame -> Bool # | |
Ord ClientGame Source # | |
Defined in Kurita.Protocol compare :: ClientGame -> ClientGame -> Ordering # (<) :: ClientGame -> ClientGame -> Bool # (<=) :: ClientGame -> ClientGame -> Bool # (>) :: ClientGame -> ClientGame -> Bool # (>=) :: ClientGame -> ClientGame -> Bool # max :: ClientGame -> ClientGame -> ClientGame # min :: ClientGame -> ClientGame -> ClientGame # | |
Show ClientGame Source # | |
Defined in Kurita.Protocol showsPrec :: Int -> ClientGame -> ShowS # show :: ClientGame -> String # showList :: [ClientGame] -> ShowS # | |
FromJSON ClientGame Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser ClientGame parseJSONList :: Value -> Parser [ClientGame] | |
ToJSON ClientGame Source # | |
Defined in Kurita.Protocol toJSON :: ClientGame -> Value toEncoding :: ClientGame -> Encoding toJSONList :: [ClientGame] -> Value toEncodingList :: [ClientGame] -> Encoding |
k2cGame :: KuritaGame -> ClientGame Source #
BattleStart | |
| |
ScoreUpdate [(c, Int64)] |
Instances
Show c => Show (TDown c) Source # | |
(Ord c, FromJSON c) => FromJSON (TDown c) Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser (TDown c) parseJSONList :: Value -> Parser [TDown c] | |
ToJSON c => ToJSON (TDown c) Source # | |
Defined in Kurita.Protocol toEncoding :: TDown c -> Encoding toJSONList :: [TDown c] -> Value toEncodingList :: [TDown c] -> Encoding |
Vote c |
Instances
Eq c => Eq (TUp c) Source # | |
Ord c => Ord (TUp c) Source # | |
Show c => Show (TUp c) Source # | |
FromJSON c => FromJSON (TUp c) Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser (TUp c) parseJSONList :: Value -> Parser [TUp c] | |
ToJSON c => ToJSON (TUp c) Source # | |
Defined in Kurita.Protocol |
Votes [(c, HyperLogLog hllsz)] |
Instances
Show c => Show (RUp hllsz c) Source # | |
(Reifies hllsz Integer, FromJSON c) => FromJSON (RUp hllsz c) Source # | |
Defined in Kurita.Protocol parseJSON :: Value -> Parser (RUp hllsz c) parseJSONList :: Value -> Parser [RUp hllsz c] | |
ToJSON c => ToJSON (RUp hllsz c) Source # | |
Defined in Kurita.Protocol toJSON :: RUp hllsz c -> Value toEncoding :: RUp hllsz c -> Encoding toJSONList :: [RUp hllsz c] -> Value toEncodingList :: [RUp hllsz c] -> Encoding |
Orphan instances
Reifies p Integer => Ord (HyperLogLog p) Source # | |
compare :: HyperLogLog p -> HyperLogLog p -> Ordering # (<) :: HyperLogLog p -> HyperLogLog p -> Bool # (<=) :: HyperLogLog p -> HyperLogLog p -> Bool # (>) :: HyperLogLog p -> HyperLogLog p -> Bool # (>=) :: HyperLogLog p -> HyperLogLog p -> Bool # |