1
1
mirror of https://github.com/sdiehl/wiwinwlh.git synced 2024-09-11 12:05:25 +03:00

liquidhaskell

This commit is contained in:
Stephen Diehl 2016-03-22 19:25:14 -04:00
parent c558356b4c
commit d9b0154a99
11 changed files with 122 additions and 5 deletions

View File

@ -1,7 +1,7 @@
PANDOC = pandoc PANDOC = pandoc
IFORMAT = markdown IFORMAT = markdown
FLAGS = --standalone --toc --toc-depth=2 --highlight-style pygments FLAGS = --standalone --toc --toc-depth=2 --highlight-style pygments
TEMPLATE = page.tmpl TEMPLATE = resources/page.tmpl
STYLE = css/style.css STYLE = css/style.css
HTML = tutorial.html HTML = tutorial.html

6
css/bootstrap-min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,13 @@ h1, h2, h3, h4, h5 {
line-height: 1.1; line-height: 1.1;
} }
pre {
/* Override bootstrap */
border: none;
border-radius: 0px;
background-color: inherit;
}
pre code { pre code {
/*font: 15px/19px Inconsolata, Monaco,"Lucida Console",Terminal,"Courier New",Courier;*/ /*font: 15px/19px Inconsolata, Monaco,"Lucida Console",Terminal,"Courier New",Courier;*/
font: 12pt "Source Code Pro"; font: 12pt "Source Code Pro";

View File

View File

@ -11,7 +11,8 @@
<style type="text/css"> <style type="text/css">
$header-includes$ $header-includes$
</style> </style>
<link href="css/bootstrap-responsive.min.css" rel="stylesheet"> <!--<link href="css/bootstrap-responsive.min.css" rel="stylesheet">-->
<link href="css/bootstrap-min.css" rel="stylesheet">
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@ -29,9 +30,11 @@
$highlighting-css$ $highlighting-css$
</style> </style>
$endif$ $endif$
$for(css)$ $for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/> <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
$endfor$ $endfor$
$if(math)$ $if(math)$
$if(html5)$ $if(html5)$
$else$ $else$
@ -65,6 +68,6 @@ $body$
</div> </div>
<script src="https://code.jquery.com/jquery.js"></script> <script src="https://code.jquery.com/jquery.js"></script>
<script src="nav.js"></script> <script src="js/nav.js"></script>
</body> </body>
</html> </html>

15
src/01-basics/README.md Normal file
View File

@ -0,0 +1,15 @@
Monads
======
```bash
$ stach exec list.hs
$ stach exec list_impl.hs
$ stach exec maybe.hs
$ stach exec maybe_impl.hs
$ stach exec reader.hs
$ stach exec reader_impl.hs
$ stach exec state.hs
$ stach exec state_impl.hs
$ stach exec writer.hs
$ stach exec writer_impl.hs
```

15
src/02-monads/README.md Normal file
View File

@ -0,0 +1,15 @@
Monads
======
```bash
$ stach exec list.hs
$ stach exec list_impl.hs
$ stach exec maybe.hs
$ stach exec maybe_impl.hs
$ stach exec reader.hs
$ stach exec reader_impl.hs
$ stach exec state.hs
$ stach exec state_impl.hs
$ stach exec writer.hs
$ stach exec writer_impl.hs
```

View File

@ -0,0 +1,15 @@
Monads
======
```bash
$ stach exec list.hs
$ stach exec list_impl.hs
$ stach exec maybe.hs
$ stach exec maybe_impl.hs
$ stach exec reader.hs
$ stach exec reader_impl.hs
$ stach exec state.hs
$ stach exec state_impl.hs
$ stach exec writer.hs
$ stach exec writer_impl.hs
```

View File

@ -0,0 +1,15 @@
Monads
======
```bash
$ stach exec list.hs
$ stach exec list_impl.hs
$ stach exec maybe.hs
$ stach exec maybe_impl.hs
$ stach exec reader.hs
$ stach exec reader_impl.hs
$ stach exec state.hs
$ stach exec state_impl.hs
$ stach exec writer.hs
$ stach exec writer_impl.hs
```

15
src/05-laziness/README.md Normal file
View File

@ -0,0 +1,15 @@
Monads
======
```bash
$ stach exec list.hs
$ stach exec list_impl.hs
$ stach exec maybe.hs
$ stach exec maybe_impl.hs
$ stach exec reader.hs
$ stach exec reader_impl.hs
$ stach exec state.hs
$ stach exec state_impl.hs
$ stach exec writer.hs
$ stach exec writer_impl.hs
```

View File

@ -1144,6 +1144,8 @@ Shake
This is an advanced section, and is not typically necessary to write Haskell. This is an advanced section, and is not typically necessary to write Haskell.
</div> </div>
* [Shake Manual](https://github.com/ndmitchell/shake/blob/master/docs/Manual.md)
<hr/> <hr/>
Monads Monads
@ -6169,19 +6171,31 @@ Liquid Haskell
LiquidHaskell is not typically necessary to write Haskell. LiquidHaskell is not typically necessary to write Haskell.
</div> </div>
Add the following line to your ``/etc/sources.list``: LiquidHaskell is an extension to GHC's typesystem that adds the capactity for
refinement types using the annotation syntax. The type signatures of functions
can be checked by the external for richer type semantics than default GHC
provides, including non-exhaustive patterns and complex arithemtic properties
that require external SMT solvers to verify. For instance LiquidHaskell can
statically verify that a function that operates over a ``Maybe a`` is always
given a ``Just`` or that an arithmetic functions always yields an Int that is
even positive number.
To Install LiquidHaskell in Ubuntu add the following line to your
``/etc/sources.list``:
```bash ```bash
deb http://ppa.launchpad.net/hvr/z3/ubuntu trusty main deb http://ppa.launchpad.net/hvr/z3/ubuntu trusty main
``` ```
Install the And then install the external SMT solver.
```bash ```bash
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
$ sudo apt-get install z3 $ sudo apt-get install z3
``` ```
Then clone the repo and build it using stack.
```bash ```bash
$ git clone --recursive git@github.com:ucsd-progsys/liquidhaskell.git $ git clone --recursive git@github.com:ucsd-progsys/liquidhaskell.git
$ cd liquidhaskell $ cd liquidhaskell
@ -6220,6 +6234,13 @@ Done solving.
**** RESULT: SAFE ************************************************************** **** RESULT: SAFE **************************************************************
``` ```
For more extensive documentation and further use cases see the official
documentation:
* [Liquid Haskell Documentation](https://ucsd-progsys.github.io/liquidhaskell-tutorial/01-intro.html)
</hr>
Generics Generics
======== ========
@ -7860,6 +7881,11 @@ TODO
~~~~ {.haskell include="src/24-parsing/happy/input.test"} ~~~~ {.haskell include="src/24-parsing/happy/input.test"}
~~~~ ~~~~
Configurator
------------
TODO
Streaming Streaming
========= =========