úÎ2V/·      Safe-InferedNone0Run a scotty application using the warp server. %Turn a scotty application into a WAI , which can be  run with any WAI handler. HUse given middleware. Middleware is nested such that the first declared O is the outermost middleware (it has first dibs on the request and last action < on the response). Every middleware is run on each request. -Throw an exception, which can be caught with . Uncaught exceptions  turn into HTTP 500 responses. EAbort execution of this action and continue pattern matching routes. # Like an exception, any code after  is not executed. JAs an example, these two routes overlap. The only way the second one will $ ever run is if the first one calls .  get "/foo/:number" $ do  n <- param "number" ! unless (all isDigit n) $ next  text "a number"   get "/foo/:bar" $ do  bar <- param "bar"  text "not a number" Catch an exception thrown by . 2 raise "just kidding" `rescue` (\msg -> text msg) cRedirect to given URL. Like throwing an uncatchable exception. Any code after the call to redirect  will not be run.  " redirect "http://www.google.com" OR  redirect "/foo/bar" Get the  object. eParse the request body as a JSON object and return it. Raises an exception if parse is unsuccessful. QGet a parameter. First looks in captures, then form data, then query parameters. , Raises an exception which can be caught by  if parameter is not found.  If parameter is found, but  % fails to parse to the correct type,  is called. > This means captures are somewhat typed, in that a route won't match if a correctly typed  capture cannot be parsed. get = addroute ! post = addroute " put = addroute # delete = addroute $ Define a route with a %, &# value representing the path spec,  and a body () which modifies the response.  ' addroute GET "/" $ text "beam me up!" NThe path spec can include values starting with a colon, which are interpreted  as captures7. These are named wildcards that can be looked up with  .   addroute GET "/foo/:bar" $ do  v <- param "bar"  text v (curl http://localhost:3000/foo/something something.Set the HTTP response status. Default is 200. YSet one of the response headers. Will override any previously set value for that header. $ Header names are case-insensitive. *Set the body of the response to the given & value. Also sets " Content-Type"  header to "text/plain". *Set the body of the response to the given & value. Also sets " Content-Type"  header to "text/html". "Send a file as the response. Doesn' t set the " Content-Type" header, so you probably " want to do that on your own with . PSet the body of the response to the JSON encoding of the given value. Also sets " Content-Type"  header to " application/json". $ '()*+,-./012    $ '()*+,-./0123      !"#!"$%&'()*()+(),()-()./0123456789:;<=> scotty-0.2.0 Web.ScottyWeb.Scotty.UtilParsableActionMScottyMscotty scottyApp middlewareraisenextrescueredirectrequestjsonDataparamgetpostputdeleteaddroutestatusheadertexthtmlfilejsonlazyTextToStrictByteStringstrictByteStringToLazyText setContent setHeader setStatus$fDefaultResponse wai-1.0.0 Network.Wai ApplicationRequestbase Text.Readreadhttp-types-0.6.8Network.HTTP.TypesGETPOSTPUTDELETE StdMethodtext-0.11.1.13Data.Text.Lazy.InternalText$fParsableInteger $fParsableInt$fParsableFloat$fParsableDouble$fParsableBool $fParsable[] $fParsable()$fParsableChar$fParsableByteString$fParsableText$fErrorActionError$fDefaultScottyState