You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
smurphy8 edited this page Jun 21, 2013
·
9 revisions
Lookup content will take a list of values and parse them
with a transformer into the right values. Then will map them
into a JSON Object.
To do this the final Data type must be an Instance of FromJSON and
the transormer provided must convert (Text,Text) into a (Text,Val) type
according to whatever Transformation rule you want
`
lookupContent ::(FromJSON a , MonadHandler m) => ( (Text,Text) -> (Text,Value) ) -> m (Result a)
lookupContent objTransformer = do
req <- getRequest
return $ fromJSON.object $ objTransformer <$> (reqGetParams req)
data TestObj = TestObj { testWidth :: Int
,testTitle :: Text
,testStep :: Int
}
deriving (Show,Eq)