1
1
mirror of https://github.com/sdiehl/wiwinwlh.git synced 2024-08-16 23:40:41 +03:00

Write more

This commit is contained in:
sdiehl 2020-02-11 07:01:50 +00:00
parent 4fe79146ee
commit c964a5962d
3 changed files with 62 additions and 9 deletions

View File

@ -31,7 +31,8 @@ includes: includes.hs
%.html: %.md includes
./includes < $< \
| $(PANDOC) --template $(HTEMPLATE) -s -f $(IFORMAT) -t html $(FLAGS) $(HFLAGS) \
| sed '/<extensions>/r extensions.html' > $@
| sed '/<extensions>/r extensions.html' \
| sed '/<copyright>/r resources/copyright.html' > $@
%.epub: %.md includes
(cat $(ETEMPLATE); ./includes < $<) \

21
resources/copyright.html Normal file
View File

@ -0,0 +1,21 @@
<h2 id="version">Version</h2>
<p>This is the fifth major draft of this document since 2009.</p>
<ul class="incremental">
<li><strong><a href="http://dev.stephendiehl.com/hask/index.html">HTML Version</a></strong></li>
<li><strong><a href="http://dev.stephendiehl.com/hask/tutorial.pdf">PDF Version</a></strong></li>
<li><strong><a href="http://dev.stephendiehl.com/hask/tutorial.epub">EPUB Version</a></strong></li>
<li><strong><a href="http://dev.stephendiehl.com/hask/tutorial.mobi">Kindle Version</a></strong></li>
</ul>
<p>Pull requests are always accepted for changes and additional content. This is a living document. The only way this document will stay up to date is through the kindness of readers like you and community patches and <a href="https://github.com/sdiehl/wiwinwlh">pull requests</a> on Github.</p>
<h2 id="author">Author</h2>
<p>This text is authored by Stephen Diehl.</p>
<ul class="incremental">
<li>Web: <a href="www.stephendiehl.com" class="uri">www.stephendiehl.com</a></li>
<li>Twitter: <a href="https://twitter.com/smdiehl" class="uri">https://twitter.com/smdiehl</a></li>
<li>Github: <a href="https://github.com/sdiehl" class="uri">https://github.com/sdiehl</a></li>
</ul>
<h2 id="license">License</h2>
<p>Copyright © 2009-2020 Stephen Diehl</p>
<p>This code included in the text is dedicated to the public domain. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.</p>
<p>You may distribute this text in its full form freely, but may not reauthor or sublicense this work. Any reproductions of major portions of the text must include attribution.</p>
<p>The software is provided “as is”, without warranty of any kind, express or implied, including But not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, Arising from, out of or in connection with the software or the use or other dealings in the software.</p>

View File

@ -2,6 +2,8 @@
% Stephen Diehl
% February 2020
<copyright></copyright>
Basics
======
@ -2672,6 +2674,8 @@ FROM fpco/stack-build:lts-14.0
Continuous Integration
----------------------
TODO
These days it is quite common to use cloud hosted continuous integration systems
to test code from version control systems. There are many community contributed
build script for different service providers:
@ -4227,7 +4231,7 @@ APIs.
* RankNTypes
* [ExistentialQuantification](#quantification)
* [TypeFamilies](#type-families)
* [TypeOperators]
* [TypeOperators](#promoted-syntax)
* [TypeApplications](#promoted-syntax)
* UndecidableInstances
@ -5212,7 +5216,7 @@ one.
Historically enabling this on module-level was not the best idea, since
generally we define multiple classes in a module only a subset of which may be
incoherent. So as of 7.10 we now have the capacity to just annotate instances
with the OVERLAPPING and INCOHERENT pragmas.
with the `OVERLAPPING` and `INCOHERENT` pragmas.
~~~~ {.haskell include="src/04-extensions/overlapping_anno.hs"}
~~~~
@ -5764,9 +5768,14 @@ read :: Read a => String -> a
A list of partial functions in the default prelude:
**Partial for all inputs**
* ``error``
* ``undefined``
* ``fail``
* ``fail`` -- For `Monad IO`
**Partial for empty lists**
* ``head``
* ``init``
* ``tail``
@ -5780,15 +5789,27 @@ A list of partial functions in the default prelude:
* ``cycle``
* ``maximum``
* ``minimum``
* ``(!!)``
**Partial for Nothing**
* ``fromJust``
**Partial for invalid strings lists**
* ``read``
**Partial for infinite lists**
* ``sum``
* ``product``
* ``fromJust``
* ``read``
* ``reverse``
**Partial for negative or unbounded numbers**
* ``(!)``
* ``(!!)``
* ``toEnum``
* ``genericIndex``
* ``(!)``
Replacing Partiality
--------------------
@ -7899,7 +7920,7 @@ Name Type Signature Descr
----- --------------------------------- -----------------
Catamorphism ``cata :: (a -> b -> b) -> b -> [a] -> b`` Deconstructs a data structure
Anamorphism ``ana :: (b -> Maybe (a, b)) -> b -> [a]`` Constructs a structure level by level
Hylomorphism ``hylo :: Functor f => (f b -> b) -> (a -> f a) -> a -> b`` TDO
Hylomorphism ``hylo :: Functor f => (f b -> b) -> (a -> f a) -> a -> b`` TODO
For Fix point type over a type `f :: * -> *` we can write down the recursion
schemes as the following definitions:
@ -15210,6 +15231,16 @@ The specific flags can be checked by passing `+RTS --info` to a compiled binary.
]
```
The state of the runtime can also be queried at runtime for statistics about the
heap, garbage collector and wall time. The `getRTSStats` generates two datateyps
wwith all the queryable information contained in `RTSStats` and `GCDetails`.
```haskell
import GHC.Stats
getRTSStats :: IO RTSStats
```
<hr/>
Profiling