{- DisTract ------------------------------------------------------\ | | | Copyright (c) 2007, Matthew Sackman (matthew@wellquite.org) | | | | DisTract is freely distributable under the terms of a 3-Clause | | BSD-style license. For details, see the DisTract web site: | | http://distract.wellquite.org/ | | | \-----------------------------------------------------------------} module DisTract.JSONUtils (lookupJsonString) where import qualified JSON as J import qualified Data.Map as M lookupJsonString :: M.Map String J.Value -> String -> String lookupJsonString obj key = let Just (J.String str) = M.lookup key obj in str