File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ library
6767 diagrams-lib >= 1.4.2.3 && < 1.5 ,
6868 parsec >= 3.1 ,
6969 yaml >= 0.8.4 ,
70- aeson >= 0.7 ,
70+ aeson >= 2.0 ,
7171 unordered-containers >= 0.2 ,
7272 containers >= 0.5 ,
7373 hashable >= 1.2 ,
@@ -97,7 +97,7 @@ executable drawpuzzle
9797 diagrams-lib >= 1.4.2.3 && < 1.5 ,
9898 yaml >= 0.8.4 ,
9999 optparse-applicative >= 0.12 ,
100- aeson >= 0.7 ,
100+ aeson >= 2.0 ,
101101 filepath >= 1.3 ,
102102 bytestring >= 0.10 ,
103103 diagrams-rasterific >= 1.4.2 ,
@@ -113,7 +113,7 @@ executable checkpuzzle
113113 yaml >= 0.8.4 ,
114114 containers >= 0.5 ,
115115 optparse-applicative >= 0.12 ,
116- aeson >= 0.7 ,
116+ aeson >= 2.0 ,
117117 bytestring >= 0.10 ,
118118 filepath >= 1.3
119119
@@ -128,7 +128,7 @@ executable servepuzzle
128128 snap-core >= 0.9 ,
129129 snap-server >= 0.9 ,
130130 diagrams-lib >= 1.2 ,
131- aeson >= 0.7 ,
131+ aeson >= 2.0 ,
132132 yaml >= 0.8.4 ,
133133 filepath >= 1.3 ,
134134 directory >= 1.2 ,
Original file line number Diff line number Diff line change @@ -32,18 +32,19 @@ import Data.Ord (comparing)
3232import qualified Data.Text as T
3333import Data.Traversable (mapM )
3434import Data.Yaml
35+ import qualified Data.Aeson.Key
3536import Parse.Parsec
3637import Text.Read (readMaybe )
3738import Prelude hiding (mapM )
3839
3940type Path = [String ]
4041
4142field :: Path -> Value -> Parser Value
42- field = field' . map T. pack
43+ field = field' . map ( Data.Aeson.Key. fromText . T. pack)
4344 where
4445 field' [] v = pure v
4546 field' (f : fs) (Object v) = v .: f >>= field' fs
46- field' (f : _) _ = fail $ " expected field '" ++ T. unpack f ++ " '"
47+ field' (f : _) _ = fail $ " expected field '" ++ ( T. unpack . Data.Aeson.Key. toText $ f) ++ " '"
4748
4849parseFrom :: Path -> (Value -> Parser b ) -> Value -> Parser b
4950parseFrom fs p v =
You can’t perform that action at this time.
0 commit comments