Last active
December 11, 2015 01:07
-
-
Save rblaze/00c6c12662a4a4117d8f 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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import qualified Data.Binary.Get as G | |
type BGetM = ReaderT SchemaDef G.Get | |
newtype BGet t a = BGet (BGetM a) | |
deriving (Functor, Applicative, Monad) | |
class Proto t where | |
bGetInt32 :: BGet t Int32 | |
class Serializable a where | |
bGet :: Proto t => BGet t a | |
instance Serializable Int32 where | |
bGet = bGetInt32 | |
newtype Modifier = Modifier Int32 deriving Serializable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment