úÎaÏ]O*      !"#$%&'()None *Type alias for + Creates a 200 (OK) ,* with the given content-type and resposne  body -+Helper to make responses with content-type "text/html" Creates a 200 (OK) , with content-type "text/html" and the  given resposne body .Given a URL returns a 301 (Moved Permanently) , redirecting to  that URL. &Given a URL returns a 303 (See Other) , redirecting to that URL. Returns a 400 (Bad Request) ,. 'Returns a 401 (Authorization Required) , requiring basic $ authentication in the given realm. Returns a 403 (Forbidden) ,. Returns a 404 (Not Found) ,. Returns a 500 (Server Error) ,. *-   *-None The   type is a basic instance of   that simply holds the Jrouting function and an arbitrary additional data parameter. The power is derived from the instances of . and /, which allow the Asimple construction of complex routing rules using either lists (/) or $do-notation. Moreover, because of it's simple type, any   can be used as a   (using  or by applying it to   ), making it :possible to leverage the monadic or monoid syntax for any  . +Commonly, route functions that construct a   only inspect the 0 #and other parameters. For example,  looks at the hostname:   < routeHost :: Routeable r => S.ByteString -> r -> Route () ' routeHost host route = Route func () / where func req = if host == serverName req / then runRoute route req + else return Nothing 1However, because the result of a route is in the 1( monad, routes have all the power of an 2 and can make Pstate-dependant decisions. For example, it is trivial to implement a route that /succeeds for every other request (perhaps for A/ B testing):  2 routeEveryOther :: (Routeable r1, Routeable r2) 6 => TVar Int -> r1 -> r2 -> Route () 0 routeEveryOther counter r1 r2 = Route func ()  where func req = do  i <- liftIO . atomically $ do  i' <- readTVar counter ( writeTVar counter (i' + 1)  return i'  if i 3 2 == 0 # then runRoute r1 req # else runRoute r2 req  4 types can be converted into a route function using  . %If the route is matched it returns a , , otherwise 4.  In general,  s are data-dependant (on the 0 ), but don't have to be. For example, 2 is an instance of   that always  returns a ,:  ' instance Routeable Application where 1 runRoute app req = app req >>= return . Just  Converts any   into an 2 that can be passed directly  to a WAI server. 5A route that always matches (useful for converting a   into a   ). !Matches on the hostname from the 0. The route only successeds on  exact matches. ?Matches if the path is empty. Note that this route checks that 5 I is empty, so it works as expected when nested under namespaces or other  routes that pop the 5 list. )Matches on the HTTP request method (e.g. 6, 7, 8) 3Routes the given URL pattern. Patterns can include 9 directories as well as variable patterns (prefixed with :) to be added  to 9 (see )  /posts/:id  /posts/:id/new  /:date/posts/ :category/new =Matches if the first directory in the path matches the given  ByteString 5Always matches if there is at least one directory in 5 but and  adds a parameter to 9* where the key is the first parameter and 4 the value is the directory consumed from the path.  :;<=>?     :;<=>?None A  is a @- monad that contains the HTTP request in its  environment. A  is   simply by running the @. Reads the underlying 0 CRedirect back to the referer. If the referer header is not present  redirect to root (i.e., /). CRedirect back to the referer. If the referer header is not present  fallback on the given ,. *Looks up the parameter name in the request's query string and returns the  value as a + or 4. .For example, for a request with query string: "?foo=bar&baz=7",    queryParam "foo"    would return  Just "bar", but    queryParam "zap"  would return Nothing  An alias for A that'0s helps the the compiler type a code block as a  . For example, when using the  routing DSL to , define a simple route that justs returns a ,,  can be used + to avoid explicit typing of the argument:    get "/" $ do  someSideEffect  respond $ okHtml " Hello World"  instead of:   get "/" $ (do  someSideEffect  return $ okHtml " Hello World") :: Controller Response B1Returns the value of the given request header or 4 if it is not  present in the HTTP request. 0Reads and returns the body of the HTTP request. ?Parses a HTML form from the request body. It returns a list of Cs as  well as a list of D)s, which are pairs mapping the name of a file form  field to a E7 pointing to a temporary file with the contents of the  upload.   myController = do  (prms, files) < - parseForm  let mPicFile = lookup " profile_pic" files  case mPicFile of  Just (picFile) -> do - sourceFile (fileContent picFile) $$  sinkFile ("images/" ++ (fileName picFile))  respond $ redirectTo "/"  Nothing -> redirectBack  FGH Fallback , Parameter name BI FGHBINoneJHelper method 0Matches the GET method on the given URL pattern 1Matches the POST method on the given URL pattern 0Matches the PUT method on the given URL pattern 3Matches the DELETE method on the given URL pattern !4Matches the OPTIONS method on the given URL pattern J ! ! !J !None"KLMNOPQRSTU#$%&'()VW"#$%&'()"#'$()%& "KLMNOPQRSTU#$%&'()VWNone X      !"#$%&'()*+,-./0(123456789:8;<5=>?@5A8BC8DE5FGHIGHJGHK5LMNOPQRSTU89VWXYZXY[XY\]]^_`abbcdefghijklm simple-0.2.0Web.Simple.ResponsesWeb.Simple.RouterWeb.Simple.Controller Web.FrankWeb.REST Network.WaiFrank Web.SimpleokokHtmlmovedTo redirectTo badRequestrequireBasicAuth forbiddennotFound serverErrorRoute RouteablerunRoutemkRouterrouteAll routeHostrouteTop routeMethod routePattern routeNamerouteVar Controllerrequest redirectBackredirectBackOr queryParamrespondbody parseFormgetpostputdeleteoptionsRESTControllerindexcreateeditnewshowupdate ContentTypebytestring-0.10.0.0Data.ByteString.Internal ByteString wai-1.3.0.1ResponsemkHtmlResponsebaseGHC.BaseMonad Data.MonoidMonoidRequestresourcet-0.4.0.2Control.Monad.Trans.Resource ResourceT ApplicationGHC.Realmod Data.MaybeNothingpathInfohttp-types-0.7.3.0.1Network.HTTP.Types.MethodGETPOSTPUT queryStringmroute$fRouteableRoute $fMonoidRoute $fMonadRoute$fRouteableResponse$fRouteable(->)transformers-0.3.0.0Control.Monad.Trans.ReaderReaderreturn requestHeaderwai-extra-1.3.0.3Network.Wai.ParseParamFileFileInfoControllerState csRequest$fRouteableReaderT frankMethodRESTControllerMRESTControllerState restIndexrestShow restCreate restUpdate restDeleterestEditrestNewdefaultRESTControllerState$fRouteableStateT$fRouteableRESTControllerState