Skip to content

Instantly share code, notes, and snippets.

@CGenie
Created August 11, 2014 17:21
Show Gist options
  • Save CGenie/7884f53b2386d74c164b to your computer and use it in GitHub Desktop.
Save CGenie/7884f53b2386d74c164b to your computer and use it in GitHub Desktop.
Data.Aeson.Lens problems
{-# 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