@@ -0,0 +1,652 @@
1+-- Hoogle documentation, generated by Haddock
2+-- See Hoogle, http://www.haskell.org/hoogle/
3+
4+
5+-- | A family of combinators for defining webservices APIs and serving them
6+--
7+@package servant
8+@version 0.2
9+
10+module Servant.Common.Text
11+
12+-- | For getting values from url captures and query string parameters
13+class FromText a
14+fromText :: FromText a => Text -> Maybe a
15+
16+-- | For putting values in paths and query string parameters
17+class ToText a
18+toText :: ToText a => a -> Text
19+instance ToText Float
20+instance FromText Float
21+instance ToText Double
22+instance FromText Double
23+instance ToText Integer
24+instance FromText Integer
25+instance ToText Word64
26+instance FromText Word64
27+instance ToText Word32
28+instance FromText Word32
29+instance ToText Word16
30+instance FromText Word16
31+instance ToText Word8
32+instance FromText Word8
33+instance ToText Word
34+instance FromText Word
35+instance ToText Int64
36+instance FromText Int64
37+instance ToText Int32
38+instance FromText Int32
39+instance ToText Int16
40+instance FromText Int16
41+instance ToText Int8
42+instance FromText Int8
43+instance ToText Int
44+instance FromText Int
45+instance ToText Bool
46+instance FromText Bool
47+instance ToText String
48+instance FromText String
49+instance ToText Text
50+instance FromText Text
51+
52+
53+-- | This module lets you implement <a>Server</a>s for defined APIs. You'll
54+-- most likely just need <a>serve</a>.
55+module Servant.Server
56+
57+-- | <a>serve</a> allows you to implement an API and produce a wai
58+-- <a>Application</a>.
59+--
60+-- Example:
61+--
62+-- <pre>
63+-- type MyApi = "books" :> Get [Book] -- GET /books
64+-- :<|> "books" :> ReqBody Book :> Post Book -- POST /books
65+--
66+-- server :: Server MyApi
67+-- server = listAllBooks :<|> postBook
68+-- where listAllBooks = ...
69+-- postBook book = ...
70+--
71+-- app :: Application
72+-- app = serve myApi server
73+--
74+-- main :: IO ()
75+-- main = Network.Wai.Handler.Warp.run 8080 app
76+-- </pre>
77+serve :: HasServer layout => Proxy layout -> Server layout -> Application
78+toApplication :: RoutingApplication -> Application
79+data RouteMismatch
80+
81+-- | the usual "not found" error
82+NotFound :: RouteMismatch
83+
84+-- | a more informative "you just got the HTTP method wrong" error
85+WrongMethod :: RouteMismatch
86+
87+-- | an even more informative "your json request body wasn't valid" error
88+InvalidBody :: RouteMismatch
89+
90+-- | <pre>
91+-- > mempty = NotFound
92+-- >
93+-- > NotFound <a>mappend</a> x = x
94+-- > WrongMethod <a>mappend</a> InvalidBody = InvalidBody
95+-- > WrongMethod <a>mappend</a> _ = WrongMethod
96+-- > InvalidBody <a>mappend</a> _ = InvalidBody
97+-- </pre>
98+
99+-- | A wrapper around <tt><a>Either</a> <a>RouteMismatch</a> a</tt>.
100+newtype RouteResult a
101+RR :: Either RouteMismatch a -> RouteResult a
102+routeResult :: RouteResult a -> Either RouteMismatch a
103+failWith :: RouteMismatch -> RouteResult a
104+succeedWith :: a -> RouteResult a
105+isMismatch :: RouteResult a -> Bool
106+
107+-- | If we get a <a>Right</a>, it has precedence over everything else.
108+--
109+-- This in particular means that if we could get several <a>Right</a>s,
110+-- only the first we encounter would be taken into account.
111+type RoutingApplication = Request -> (RouteResult Response -> IO ResponseReceived) -> IO ResponseReceived
112+class HasServer layout where type family Server layout :: *
113+route :: HasServer layout => Proxy layout -> Server layout -> RoutingApplication
114+instance Eq RouteMismatch
115+instance Show RouteMismatch
116+instance Eq a => Eq (RouteResult a)
117+instance Show a => Show (RouteResult a)
118+instance Monoid (RouteResult a)
119+instance Monoid RouteMismatch
120+
121+module Servant.API.Sub
122+
123+-- | The contained API (second argument) can be found under <tt>("/" ++
124+-- path)</tt> (path being the first argument).
125+--
126+-- Example:
127+--
128+-- <pre>
129+-- -- GET /hello/world
130+-- -- returning a JSON encoded World value
131+-- type MyApi = "hello" :> "world" :> Get World
132+-- </pre>
133+data (:>) (path :: k) a
134+(:>) :: Proxy path -> a -> (:>) a
135+
136+-- | Make sure the incoming request starts with <tt>"/path"</tt>, strip it
137+-- and pass the rest of the request path to <tt>sublayout</tt>.
138+instance (KnownSymbol path, HasServer sublayout) => HasServer (path :> sublayout)
139+
140+module Servant.API.Alternative
141+
142+-- | Union of two APIs, first takes precedence in case of overlap.
143+--
144+-- Example:
145+--
146+-- <pre>
147+-- type MyApi = "books" :> Get [Book] -- GET /books
148+-- :<|> "books" :> ReqBody Book :> Post Book -- POST /books
149+-- </pre>
150+data (:<|>) a b
151+(:<|>) :: a -> b -> (:<|>) a b
152+
153+-- | A server for <tt>a <a>:<|></a> b</tt> first tries to match the
154+-- request again the route represented by <tt>a</tt> and if it fails
155+-- tries <tt>b</tt>. You must provide a request handler for each route.
156+--
157+-- <pre>
158+-- type MyApi = "books" :> Get [Book] -- GET /books
159+-- :<|> "books" :> ReqBody Book :> Post Book -- POST /books
160+--
161+-- server :: Server MyApi
162+-- server = listAllBooks :<|> postBook
163+-- where listAllBooks = ...
164+-- postBook book = ...
165+-- </pre>
166+instance (HasServer a, HasServer b) => HasServer (a :<|> b)
167+
168+module Servant.API.Capture
169+
170+-- | Capture a value from the request path under a certain type <tt>a</tt>.
171+--
172+-- Example:
173+--
174+-- <pre>
175+-- -- GET /books/:isbn
176+-- type MyApi = "books" :> Capture "isbn" Text :> Get Book
177+-- </pre>
178+data Capture sym a
179+instance (KnownSymbol capture, FromText a, HasServer sublayout) => HasServer (Capture capture a :> sublayout)
180+
181+module Servant.API.Header
182+
183+-- | Extract the given header's value as a value of type <tt>a</tt>.
184+--
185+-- Example:
186+--
187+-- <pre>
188+-- newtype Referer = Referer Text
189+-- deriving (Eq, Show, FromText, ToText)
190+--
191+-- -- GET /view-my-referer
192+-- type MyApi = "view-my-referer" :> Header "from" Referer :> Get Referer
193+-- </pre>
194+data Header sym a
195+
196+-- | If you use <a>Header</a> in one of the endpoints for your API, this
197+-- automatically requires your server-side handler to be a function that
198+-- takes an argument of the type specified by <a>Header</a>. This lets
199+-- servant worry about extracting it from the request and turning it into
200+-- a value of the type you specify.
201+--
202+-- All it asks is for a <a>FromText</a> instance.
203+--
204+-- Example:
205+--
206+-- <pre>
207+-- newtype Referer = Referer Text
208+-- deriving (Eq, Show, FromText, ToText)
209+--
210+-- -- GET /view-my-referer
211+-- type MyApi = "view-my-referer" :> Header "Referer" Referer :> Get Referer
212+--
213+-- server :: Server MyApi
214+-- server = viewReferer
215+-- where viewReferer :: Referer -> EitherT (Int, String) IO referer
216+-- viewReferer referer = return referer
217+-- </pre>
218+instance (KnownSymbol sym, FromText a, HasServer sublayout) => HasServer (Header sym a :> sublayout)
219+
220+module Servant.API.QueryParam
221+
222+-- | Lookup the value associated to the <tt>sym</tt> query string parameter
223+-- and try to extract it as a value of type <tt>a</tt>.
224+--
225+-- Example:
226+--
227+-- <pre>
228+-- -- /books?author=<author name>
229+-- type MyApi = "books" :> QueryParam "author" Text :> Get [Book]
230+-- </pre>
231+data QueryParam sym a
232+
233+-- | If you use <tt><a>QueryParam</a> "author" Text</tt> in one of the
234+-- endpoints for your API, this automatically requires your server-side
235+-- handler to be a function that takes an argument of type
236+-- <tt><a>Maybe</a> <tt>Text</tt></tt>.
237+--
238+-- This lets servant worry about looking it up in the query string and
239+-- turning it into a value of the type you specify, enclosed in
240+-- <a>Maybe</a>, because it may not be there and servant would then hand
241+-- you <a>Nothing</a>.
242+--
243+-- You can control how it'll be converted from <tt>Text</tt> to your type
244+-- by simply providing an instance of <a>FromText</a> for your type.
245+--
246+-- Example:
247+--
248+-- <pre>
249+-- type MyApi = "books" :> QueryParam "author" Text :> Get [Book]
250+--
251+-- server :: Server MyApi
252+-- server = getBooksBy
253+-- where getBooksBy :: Maybe Text -> EitherT (Int, String) IO [Book]
254+-- getBooksBy Nothing = ...return all books...
255+-- getBooksBy (Just author) = ...return books by the given author...
256+-- </pre>
257+
258+-- | Lookup the values associated to the <tt>sym</tt> query string
259+-- parameter and try to extract it as a value of type <tt>[a]</tt>. This
260+-- is typically meant to support query string parameters of the form
261+-- <tt>param[]=val1&param[]=val2</tt> and so on. Note that servant
262+-- doesn't actually require the <tt>[]</tt>s and will fetch the values
263+-- just fine with <tt>param=val1&param=val2</tt>, too.
264+--
265+-- Example:
266+--
267+-- <pre>
268+-- -- /books?authors[]=<author1>&authors[]=<author2>&...
269+-- type MyApi = "books" :> QueryParams "authors" Text :> Get [Book]
270+-- </pre>
271+data QueryParams sym a
272+
273+-- | If you use <tt><a>QueryParams</a> "authors" Text</tt> in one of the
274+-- endpoints for your API, this automatically requires your server-side
275+-- handler to be a function that takes an argument of type
276+-- <tt>[<tt>Text</tt>]</tt>.
277+--
278+-- This lets servant worry about looking up 0 or more values in the query
279+-- string associated to <tt>authors</tt> and turning each of them into a
280+-- value of the type you specify.
281+--
282+-- You can control how the individual values are converted from
283+-- <tt>Text</tt> to your type by simply providing an instance of
284+-- <a>FromText</a> for your type.
285+--
286+-- Example:
287+--
288+-- <pre>
289+-- type MyApi = "books" :> QueryParams "authors" Text :> Get [Book]
290+--
291+-- server :: Server MyApi
292+-- server = getBooksBy
293+-- where getBooksBy :: [Text] -> EitherT (Int, String) IO [Book]
294+-- getBooksBy authors = ...return all books by these authors...
295+-- </pre>
296+
297+-- | Lookup a potentially value-less query string parameter with boolean
298+-- semantics. If the param <tt>sym</tt> is there without any value, or if
299+-- it's there with value "true" or "1", it's interpreted as <a>True</a>.
300+-- Otherwise, it's interpreted as <a>False</a>.
301+--
302+-- Example:
303+--
304+-- <pre>
305+-- -- /books?published
306+-- type MyApi = "books" :> QueryFlag "published" :> Get [Book]
307+-- </pre>
308+data QueryFlag sym
309+
310+-- | If you use <tt><a>QueryFlag</a> "published"</tt> in one of the
311+-- endpoints for your API, this automatically requires your server-side
312+-- handler to be a function that takes an argument of type <a>Bool</a>.
313+--
314+-- Example:
315+--
316+-- <pre>
317+-- type MyApi = "books" :> QueryFlag "published" :> Get [Book]
318+--
319+-- server :: Server MyApi
320+-- server = getBooks
321+-- where getBooks :: Bool -> EitherT (Int, String) IO [Book]
322+-- getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
323+-- </pre>
324+instance (KnownSymbol sym, HasServer sublayout) => HasServer (QueryFlag sym :> sublayout)
325+instance (KnownSymbol sym, FromText a, HasServer sublayout) => HasServer (QueryParams sym a :> sublayout)
326+instance (KnownSymbol sym, FromText a, HasServer sublayout) => HasServer (QueryParam sym a :> sublayout)
327+
328+module Servant.API.ReqBody
329+
330+-- | Extract the request body as a value of type <tt>a</tt>.
331+--
332+-- Example:
333+--
334+-- <pre>
335+-- -- POST /books
336+-- type MyApi = "books" :> ReqBody Book :> Post Book
337+-- </pre>
338+data ReqBody a
339+
340+-- | If you use <a>ReqBody</a> in one of the endpoints for your API, this
341+-- automatically requires your server-side handler to be a function that
342+-- takes an argument of the type specified by <a>ReqBody</a>. This lets
343+-- servant worry about extracting it from the request and turning it into
344+-- a value of the type you specify.
345+--
346+-- All it asks is for a <a>FromJSON</a> instance.
347+--
348+-- Example:
349+--
350+-- <pre>
351+-- type MyApi = "books" :> ReqBody Book :> Post Book
352+--
353+-- server :: Server MyApi
354+-- server = postBook
355+-- where postBook :: Book -> EitherT (Int, String) IO Book
356+-- postBook book = ...insert into your db...
357+-- </pre>
358+instance (FromJSON a, HasServer sublayout) => HasServer (ReqBody a :> sublayout)
359+
360+module Servant.API.Get
361+
362+-- | Endpoint for simple GET requests. Serves the result as JSON.
363+--
364+-- Example:
365+--
366+-- <pre>
367+-- type MyApi = "books" :> Get [Book]
368+-- </pre>
369+data Get a
370+
371+-- | When implementing the handler for a <a>Get</a> endpoint, just like for
372+-- <a>Delete</a>, <a>Post</a> and <a>Put</a>, the handler code runs in
373+-- the <tt>EitherT (Int, String) IO</tt> monad, where the <a>Int</a>
374+-- represents the status code and the <a>String</a> a message, returned
375+-- in case of failure. You can quite handily use <a>left</a> to quickly
376+-- fail if some conditions are not met.
377+--
378+-- If successfully returning a value, we just require that its type has a
379+-- <a>ToJSON</a> instance and servant takes care of encoding it for you,
380+-- yielding status code 200 along the way.
381+instance Typeable Get
382+instance ToJSON result => HasServer (Get result)
383+
384+module Servant.API.Post
385+
386+-- | Endpoint for POST requests. The type variable represents the type of
387+-- the response body (not the request body, use <a>RQBody</a> for that).
388+--
389+-- Example:
390+--
391+-- <pre>
392+-- -- POST /books
393+-- -- with a JSON encoded Book as the request body
394+-- -- returning the just-created Book
395+-- type MyApi = "books" :> ReqBody Book :> Post Book
396+-- </pre>
397+data Post a
398+
399+-- | When implementing the handler for a <a>Post</a> endpoint, just like
400+-- for <a>Delete</a>, <a>Get</a> and <a>Put</a>, the handler code runs in
401+-- the <tt>EitherT (Int, String) IO</tt> monad, where the <a>Int</a>
402+-- represents the status code and the <a>String</a> a message, returned
403+-- in case of failure. You can quite handily use <a>left</a> to quickly
404+-- fail if some conditions are not met.
405+--
406+-- If successfully returning a value, we just require that its type has a
407+-- <a>ToJSON</a> instance and servant takes care of encoding it for you,
408+-- yielding status code 201 along the way.
409+instance Typeable Post
410+instance ToJSON a => HasServer (Post a)
411+
412+module Servant.API.Delete
413+
414+-- | Combinator for DELETE requests.
415+--
416+-- Example:
417+--
418+-- <pre>
419+-- -- DELETE /books/:isbn
420+-- type MyApi = "books" :> Capture "isbn" Text :> Delete
421+-- </pre>
422+data Delete
423+
424+-- | If you have a <a>Delete</a> endpoint in your API, the handler for this
425+-- endpoint is meant to delete a resource.
426+--
427+-- The code of the handler will, just like for <a>Get</a>, <a>Post</a>
428+-- and <a>Put</a>, run in <tt>EitherT (Int, String) IO ()</tt>. The
429+-- <a>Int</a> represents the status code and the <a>String</a> a message
430+-- to be returned. You can use <a>left</a> to painlessly error out if the
431+-- conditions for a successful deletion are not met.
432+instance Typeable Delete
433+instance HasServer Delete
434+
435+module Servant.API.Put
436+
437+-- | Endpoint for PUT requests, usually used to update a ressource. The
438+-- type <tt>a</tt> is the type of the response body that's returned.
439+--
440+-- Example:
441+--
442+-- <pre>
443+-- -- PUT /books/:isbn
444+-- -- with a Book as request body, returning the updated Book
445+-- type MyApi = "books" :> Capture "isbn" Text :> ReqBody Book :> Put Book
446+-- </pre>
447+data Put a
448+
449+-- | When implementing the handler for a <a>Put</a> endpoint, just like for
450+-- <a>Delete</a>, <a>Get</a> and <a>Post</a>, the handler code runs in
451+-- the <tt>EitherT (Int, String) IO</tt> monad, where the <a>Int</a>
452+-- represents the status code and the <a>String</a> a message, returned
453+-- in case of failure. You can quite handily use <a>left</a> to quickly
454+-- fail if some conditions are not met.
455+--
456+-- If successfully returning a value, we just require that its type has a
457+-- <a>ToJSON</a> instance and servant takes care of encoding it for you,
458+-- yielding status code 200 along the way.
459+instance Typeable Put
460+instance ToJSON a => HasServer (Put a)
461+
462+
463+-- | QuasiQuoting utilities for API types.
464+--
465+-- <a>sitemap</a> allows you to write your type in a very natural way:
466+--
467+-- <pre>
468+-- [sitemap|
469+-- PUT hello String -> ()
470+-- POST hello/p:Int String -> ()
471+-- GET hello/?name:String Int
472+-- |]
473+-- </pre>
474+--
475+-- Will generate:
476+--
477+-- <pre>
478+-- "hello" :> ReqBody String :> Put ()
479+-- :<|> "hello" :> Capture "p" Int :> ReqBody String :> Post ()
480+-- :<|> "hello" :> QueryParam "name" String :> Get Int
481+-- </pre>
482+--
483+-- Note the <tt>/</tt> before a <tt>QueryParam</tt>!
484+module Servant.QQ
485+
486+-- | Finally-tagless encoding for our DSL. Keeping <tt>repr'</tt> and
487+-- <tt>repr</tt> distinct when writing functions with an <tt>ExpSYM</tt>
488+-- context ensures certain invariants (for instance, that there is only
489+-- one of <a>get</a>, <a>post</a>, <a>put</a>, and <a>delete</a> in a
490+-- value), but sometimes requires a little more work.
491+class ExpSYM repr' repr | repr -> repr', repr' -> repr
492+lit :: ExpSYM repr' repr => String -> repr' -> repr
493+capture :: ExpSYM repr' repr => String -> String -> repr -> repr
494+reqBody :: ExpSYM repr' repr => String -> repr -> repr
495+queryParam :: ExpSYM repr' repr => String -> String -> repr -> repr
496+conj :: ExpSYM repr' repr => repr' -> repr -> repr
497+get :: ExpSYM repr' repr => String -> repr
498+post :: ExpSYM repr' repr => String -> repr
499+put :: ExpSYM repr' repr => String -> repr
500+delete :: ExpSYM repr' repr => String -> repr
501+(>:) :: Type -> Type -> Type
502+parseMethod :: ExpSYM repr' repr => Parser (String -> repr)
503+parseUrlSegment :: ExpSYM repr repr => Parser (repr -> repr)
504+parseUrl :: ExpSYM repr repr => Parser (repr -> repr)
505+data Typ
506+Val :: String -> Typ
507+ReqArgVal :: String -> String -> Typ
508+parseTyp :: Parser Typ
509+parseEntry :: ExpSYM repr repr => Parser repr
510+blockComment :: Parser ()
511+inlineComment :: Parser ()
512+eol :: Parser String
513+eols :: Parser ()
514+parseAll :: Parser Type
515+
516+-- | The sitemap QuasiQuoter.
517+--
518+-- <ul>
519+-- <li><tt>...<i><a>var</a>:<a>type</a></i>...</tt> becomes a
520+-- capture</li>
521+-- <li><tt>.../?<a>var</a>:<a>type</a></tt> becomes a query
522+-- parameter</li>
523+-- <li><tt><a>method</a> ... <a>typ</a></tt> becomes a method returning
524+-- <tt><a>typ</a></tt></li>
525+-- <li><tt><a>method</a> ... <a>typ1</a> -> <a>typ2</a></tt> becomes a
526+-- method with request body of <tt><a>typ1</a></tt> and returning
527+-- <tt><a>typ2</a></tt></li>
528+-- </ul>
529+--
530+-- Comments are allowed, and have the standard Haskell format
531+--
532+-- <ul>
533+-- <li><tt>--</tt> for inline</li>
534+-- <li><tt>{- ... -}</tt> for block</li>
535+-- </ul>
536+sitemap :: QuasiQuoter
537+instance ExpSYM Type Type
538+
539+
540+-- | Type safe internal links.
541+--
542+-- Provides the function <a>mkLink</a>:
543+--
544+-- <pre>
545+-- type API = Proxy ("hello" :> Get Int
546+-- :<a>|</a> "bye" :> QueryParam "name" String :> Post Bool)
547+--
548+-- api :: API
549+-- api = proxy
550+--
551+-- link1 :: Proxy ("hello" :> Get Int)
552+-- link1 = proxy
553+--
554+-- link2 :: Proxy ("hello" :> Delete)
555+-- link2 = proxy
556+--
557+-- mkLink link1 API -- typechecks, returns 'Link "/hello"'
558+--
559+-- mkLink link2 API -- doesn't typecheck
560+-- </pre>
561+--
562+-- That is, <a>mkLink</a> takes two arguments, a link proxy and a
563+-- sitemap, and returns a <a>Link</a>, but only typechecks if the link
564+-- proxy is a valid link, and part of the sitemap.
565+--
566+-- <b>N.B.:</b> <a>mkLink</a> assumes a capture matches any string
567+-- (without slashes).
568+module Servant.Utils.Links
569+
570+-- | The 'ValidLinkIn f s' constraint holds when <tt>s</tt> is an API that
571+-- contains <tt>f</tt>, and <tt>f</tt> is a link.
572+class ValidLinkIn f s
573+mkLink :: ValidLinkIn f s => f -> s -> Link
574+data Link
575+Link :: String -> Link
576+class VLinkHelper f
577+vlh :: VLinkHelper f => proxy f -> String
578+instance Show Link
579+instance VLinkHelper (Post x)
580+instance VLinkHelper (Get x)
581+instance (KnownSymbol s, VLinkHelper e) => VLinkHelper (s :> e)
582+instance (IsElem f s ~ 'True, IsLink f ~ 'True, VLinkHelper f) => ValidLinkIn f s
583+
584+module Servant.API.Raw
585+
586+-- | Endpoint for plugging in your own Wai <a>Application</a>s.
587+--
588+-- The given <a>Application</a> will get the request as received by the
589+-- server, potentially with a modified (stripped) <a>pathInfo</a> if the
590+-- <a>Application</a> is being routed with <a>:></a>.
591+--
592+-- In addition to just letting you plug in your existing WAI
593+-- <a>Application</a>s, this can also be used with <a>serveDirectory</a>
594+-- to serve static files stored in a particular directory on your
595+-- filesystem, or to serve your API's documentation with
596+-- <a>serveDocumentation</a>.
597+data Raw
598+
599+-- | Just pass the request to the underlying application and serve its
600+-- response.
601+--
602+-- Example:
603+--
604+-- <pre>
605+-- type MyApi = "images" :> Raw
606+--
607+-- server :: Server MyApi
608+-- server = serveDirectory "/var/www/images"
609+-- </pre>
610+instance HasServer Raw
611+
612+
613+-- | This module defines a sever-side handler that lets you serve static
614+-- files.
615+--
616+-- <ul>
617+-- <li><a>serveDirectory</a> lets you serve anything that lives under a
618+-- particular directory on your filesystem.</li>
619+-- </ul>
620+module Servant.Utils.StaticFiles
621+
622+-- | Serve anything under the specified directory as a <a>Raw</a> endpoint.
623+--
624+-- <pre>
625+-- type MyApi = "static" :> Raw
626+--
627+-- server :: Server MyApi
628+-- server = serveDirectory "/var/www"
629+-- </pre>
630+--
631+-- would capture any request to <tt>/static/<something></tt> and
632+-- look for <tt><something></tt> under <tt>/var/www</tt>.
633+--
634+-- It will do its best to guess the MIME type for that file, based on the
635+-- extension, and send an appropriate <i>Content-Type</i> header if
636+-- possible.
637+--
638+-- If your goal is to serve HTML, CSS and Javascript files that use the
639+-- rest of the API as a webapp backend, you will most likely not want the
640+-- static files to be hidden behind a <i>/static/</i> prefix. In that
641+-- case, remember to put the <a>serveDirectory</a> handler in the last
642+-- position, because <i>servant</i> will try to match the handlers in
643+-- order.
644+serveDirectory :: FilePath -> Server Raw
645+
646+module Servant.API
647+
648+module Servant
649+
650+-- | A concrete, poly-kinded proxy type
651+data Proxy (t :: k) :: k -> *
652+Proxy :: Proxy