Created
August 11, 2014 17:21
-
-
Save CGenie/7884f53b2386d74c164b to your computer and use it in GitHub Desktop.
Data.Aeson.Lens problems
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 OverloadedStrings #-} | |
import Data.Aeson.Lens | |
import Data.Text | |
import Data.Text.Encoding as E | |
main = do | |
lex x = (E.decodeUtf8 "{\"a\": 1}") ^? key "a" | |
return () | |
No instance for (AsValue Text) arising from a use of ‘key’ | |
In the second argument of ‘(^?)’, namely ‘key "a"’ | |
In the expression: (decodeUtf8 "{\"a\": 1}") ^? key "a" | |
In an equation for ‘x’: x = (decodeUtf8 "{\"a\": 1}") ^? key "a" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment