Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created March 25, 2012 01:50
Show Gist options
  • Save mwotton/2190677 to your computer and use it in GitHub Desktop.
Save mwotton/2190677 to your computer and use it in GitHub Desktop.
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
import Data.MessagePack
import qualified Data.ByteString.Lazy.Char8 as L
data OauthData = OauthData { key :: L.ByteString,
secret :: L.ByteString }
deriving(Show)
data Fake = Fake L.ByteString
deriving(Show)
deriveObject True ''OauthData
deriveObject True ''Fake
main = do
let l = pack $ OauthData "hi" "there"
print l
print $ (tryUnpack l :: Either String OauthData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment