on master help sign in
Add Json.Decode.string
commitc96fe59553a4a63751ccf8a2dee570536c0f26fd authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 29 Jun 2017, 18:12 (9 years ago) parent466c477
1 file changed+6−1
src/Json/Decode.hs+6−1
src/Json/Decode.hs+6−1
@@ -2,7 +2,7 @@
22{-# LANGUAGE OverloadedStrings #-}
33module Json.Decode
44 ( Decoder, Error(..), decode, parse
5− , text, bool, int, float
5+ , string, text, bool, int, float
66 , list, dict, maybe
77 , field, at
88 , index
@@ -65,6 +65,11 @@ parse decoder bytestring =
6565-- PRIMITIVES
6666
6767
68+string :: Decoder String
69+string =
70+ Text.unpack <$> text
71+
72+
6873text :: Decoder Text
6974text =
7075 Decoder $ \mkError value ->