Skip to content

Instantly share code, notes, and snippets.

@FruitieX
Created March 21, 2018 18:28
Show Gist options
  • Save FruitieX/9b2806d95e32840f2cde0c55649f1211 to your computer and use it in GitHub Desktop.
Save FruitieX/9b2806d95e32840f2cde0c55649f1211 to your computer and use it in GitHub Desktop.
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