Skip to content

Instantly share code, notes, and snippets.

@chadaustin
Created January 25, 2016 21:53
Show Gist options
  • Save chadaustin/50f57a2698d5757b06ac to your computer and use it in GitHub Desktop.
Save chadaustin/50f57a2698d5757b06ac to your computer and use it in GitHub Desktop.
data Scalar
= SInt Int32
| SFloat Float
| SBoolean Bool
| SString Text
| SEnum Text -- unquoted on parse
data InputValue
= IVar Text
| IScalar Scalar
| IList [InputValue]
| IObject (HashMap Text InputValue)
data ResponseValue
= RNull
| RScalar Scalar
| RList [ResponseValue]
| RObject NodeHandler
data KeyHandler = KeyHandler (HashMap Text Main.Value -> IO ResponseValue)
data NodeHandler = NodeHandler (HashMap Text KeyHandler)
data Server = Server
{ rootQuery :: NodeHandler
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment