Created
December 25, 2012 13:49
-
-
Save qrilka/4373331 to your computer and use it in GitHub Desktop.
Example from aeson docs - fails in GHC 7.4.1
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 TemplateHaskell #-} | |
module Test where | |
import Data.Aeson | |
import Data.Aeson.TH | |
data D a = Nullary | |
| Unary Int | |
| Product String Char a | |
| Record { testOne :: Double | |
, testTwo :: Bool | |
, testThree :: D a | |
} deriving Eq | |
d :: D Int | |
d = Record { testOne = 3.14159 | |
, testTwo = True | |
, testThree = Product "test" 'A' 123 | |
} | |
$(deriveJSON (drop 4) ''D) | |
main = print $ fromJSON (toJSON d) == Success d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GHC 7.4.1 output: