on master help sign in
Add Json.Decode.string
c96fe59Evan Czaplicki
src/Json/Decode.hs+6−1
@@ -2,7 +2,7 @@
2{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Json.Decode
3module Json.Decode
4 ( Decoder, Error(..), decode, parse
4 ( Decoder, Error(..), decode, parse
5− , text, bool, int, float
5+ , string, text, bool, int, float
6 , list, dict, maybe
6 , list, dict, maybe
7 , field, at
7 , field, at
8 , index
8 , index
@@ -65,6 +65,11 @@ parse decoder bytestring =
65-- PRIMITIVES
65-- PRIMITIVES
66
66
67
67
68+string :: Decoder String
69+string =
70+ Text.unpack <$> text
71+
72+
68text :: Decoder Text
73text :: Decoder Text
69text =
74text =
70 Decoder $ \mkError value ->
75 Decoder $ \mkError value ->