Created
March 21, 2018 18:28
-
-
Save FruitieX/9b2806d95e32840f2cde0c55649f1211 to your computer and use it in GitHub Desktop.
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
type PlayPauseMessage = | |
{ play :: Boolean } | |
type SkipMessage = | |
{ skip :: Int } | |
data Message | |
= PlayPause PlayPauseMessage | |
| Skip SkipMessage | |
instance readForeignMessage :: ReadForeign Message where | |
readImpl f = PlayPause <$> read' f <|> Skip <$> read' f | |
instance writeForeignMessage :: WriteForeign Message where | |
writeImpl f = ??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment