Created
March 25, 2012 01:50
-
-
Save mwotton/2190677 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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