summaryrefslogtreecommitdiff
path: root/ddl/out/LambdaCube.TypeInfo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/out/LambdaCube.TypeInfo.hs')
-rw-r--r--ddl/out/LambdaCube.TypeInfo.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/ddl/out/LambdaCube.TypeInfo.hs b/ddl/out/LambdaCube.TypeInfo.hs
index a2df59c..f23bd83 100644
--- a/ddl/out/LambdaCube.TypeInfo.hs
+++ b/ddl/out/LambdaCube.TypeInfo.hs
@@ -1,5 +1,5 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2-- 2016-02-12T16:05:13.364534000000Z 2-- 2016-02-26T10:42:57.376331000000Z
3 3
4{-# LANGUAGE OverloadedStrings, RecordWildCards #-} 4{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
5module LambdaCube.TypeInfo where 5module LambdaCube.TypeInfo where
@@ -28,9 +28,9 @@ data TypeInfo
28 28
29 deriving (Show, Eq, Ord) 29 deriving (Show, Eq, Ord)
30 30
31data MyEither 31data CompileResult
32 = MyLeft TypeInfo (Vector TypeInfo) 32 = CompileError (Vector TypeInfo) (Vector TypeInfo)
33 | MyRight String Pipeline (Vector TypeInfo) 33 | Compiled String Pipeline (Vector TypeInfo)
34 deriving (Show, Eq, Ord) 34 deriving (Show, Eq, Ord)
35 35
36 36
@@ -64,16 +64,16 @@ instance FromJSON TypeInfo where
64 } 64 }
65 parseJSON _ = mzero 65 parseJSON _ = mzero
66 66
67instance ToJSON MyEither where 67instance ToJSON CompileResult where
68 toJSON v = case v of 68 toJSON v = case v of
69 MyLeft arg0 arg1 -> object [ "tag" .= ("MyLeft" :: Text), "arg0" .= arg0, "arg1" .= arg1] 69 CompileError arg0 arg1 -> object [ "tag" .= ("CompileError" :: Text), "arg0" .= arg0, "arg1" .= arg1]
70 MyRight arg0 arg1 arg2 -> object [ "tag" .= ("MyRight" :: Text), "arg0" .= arg0, "arg1" .= arg1, "arg2" .= arg2] 70 Compiled arg0 arg1 arg2 -> object [ "tag" .= ("Compiled" :: Text), "arg0" .= arg0, "arg1" .= arg1, "arg2" .= arg2]
71 71
72instance FromJSON MyEither where 72instance FromJSON CompileResult where
73 parseJSON (Object obj) = do 73 parseJSON (Object obj) = do
74 tag <- obj .: "tag" 74 tag <- obj .: "tag"
75 case tag :: Text of 75 case tag :: Text of
76 "MyLeft" -> MyLeft <$> obj .: "arg0" <*> obj .: "arg1" 76 "CompileError" -> CompileError <$> obj .: "arg0" <*> obj .: "arg1"
77 "MyRight" -> MyRight <$> obj .: "arg0" <*> obj .: "arg1" <*> obj .: "arg2" 77 "Compiled" -> Compiled <$> obj .: "arg0" <*> obj .: "arg1" <*> obj .: "arg2"
78 parseJSON _ = mzero 78 parseJSON _ = mzero
79 79