Skip to content

Commit 2edaa5d

Browse files
authored
Merge pull request #974 from haskell-servant/alp/tutorial-tweaks
website/tutorial tweaks
2 parents 507263e + 11928bc commit 2edaa5d

File tree

4 files changed

+35
-15
lines changed

4 files changed

+35
-15
lines changed

doc/index.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@ servant – A Type-Level Web DSL
33

44
.. image:: https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png
55

6-
**servant** is a set of packages for declaring web APIs at the type-level and
7-
then using those API specifications to:
6+
**servant** is a set of Haskell libraries for writing *type-safe* web
7+
applications but also *deriving* clients (in Haskell and other languages) or
8+
generating documentation for them, and more.
89

9-
- write servers (this part of **servant** can be considered a web framework),
10-
- obtain client functions (in haskell),
11-
- generate client functions for other programming languages,
12-
- generate documentation for your web applications
13-
- and more...
10+
This is achieved by taking as input a description of the web API
11+
as a Haskell type. Servant is then able to check that your server-side request
12+
handlers indeed implement your web API faithfully, or to automatically derive
13+
Haskell functions that can hit a web application that implements this API,
14+
generate a Swagger description or code for client functions in some other
15+
languages directly.
1416

15-
All in a type-safe manner.
17+
If you would like to learn more, click the tutorial link below.
1618

1719
.. toctree::
1820
:maxdepth: 2
1921

20-
introduction.rst
2122
tutorial/index.rst
2223
cookbook/index.rst
2324
examples.md
2425
links.rst
26+
principles.rst

doc/introduction.rst renamed to doc/principles.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Introduction
2-
------------
1+
Principles
2+
----------
33

44
**servant** has the following guiding principles:
55

doc/tutorial/Javascript.lhs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ data AngularOptions = AngularOptions
477477
}
478478
```
479479
480-
# Custom function name builder
480+
## Custom function name builder
481481
482482
Servant comes with three name builders included:
483483
@@ -518,4 +518,3 @@ var get_books = function(q, onSuccess, onError)
518518
}
519519
520520
```
521-

doc/tutorial/index.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,28 @@ Tutorial
33

44
This is an introductory tutorial to **servant**. Whilst browsing is fine, it makes more sense if you read the sections in order, or at least read the first section before anything else.
55

6-
(Any comments, issues or feedback about the tutorial can be submitted
7-
to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.)
6+
Any comments, issues or feedback about the tutorial can be submitted
7+
to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
88

9+
In fact, the whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
10+
project and can be built and played with locally as follows:
11+
12+
.. code-block:: bash
13+
14+
$ git clone https://github.com/haskell-servant/servant.git
15+
$ cd servant
16+
# build
17+
$ cabal new-build tutorial
18+
# load in ghci to play with it
19+
$ cabal new-repl tutorial
20+
21+
The code can be found in the `*.lhs` files under `doc/tutorial/` in the
22+
repository. Feel free to edit it while you're reading this documentation and
23+
see the effect of your changes.
24+
25+
`Nix <https://nixos.org/nix/>`_ users should feel free to take a look at
26+
the `nix/shell.nix` file in the repository and use it to provision a suitable
27+
environment to build and run the examples.
928

1029
.. toctree::
1130
:maxdepth: 1

0 commit comments

Comments
 (0)