theoremquest-0.0.0: A common library for TheoremQuest, a theorem proving game.

TheoremQuest.Transactions

Synopsis

Documentation

data Req Source

Requests from client to server.

Constructors

Ping

Ping server.

NewUser User Email

New user: username, email.

RspInJSON Req

Send response in JSON.

Inference User (Inference TheoremId)

Submit an inference. Server will validate the inference and return a theorem.

TheoremAssumptions TheoremId

Request a theorem's assumptions.

TheoremConclusion TheoremId

Request a theorem's conclusion.

TheoremSearch Term Int

Search for a theorem similar to a term. Return a list of ids starting at the given index.

Instances

data Rsp Source

Responses to client requests.

Constructors

DeprecatedReq Rsp

A warning to clients that the associated Req will soon be obsolete.

UnknownReq

Server did not recognize Req.

Ack

Acknowledge.

Nack String

No acknowledge with reason.

Id Int

A unique id. Usually a TheoremId.

Ids [Int]

A list of unique ids.

Term Term

A term.

Terms [Term]

A list of terms.

Instances

formatJSON :: JSON a => a -> ([Header], String)Source

HTTP headers and body for JSON transfer.

formatText :: String -> ([Header], String)Source

HTTP headers and body for text transfer.

formatHaskell :: Show a => a -> ([Header], String)Source

HTTP headers and body for shown Haskell type transfer.

maybeRead :: Read a => String -> Maybe aSource

Maybe read, on parse errors return Nothing.