git.iko.soy/typeable/cabal2nix
on master help sign in
doc: extended the presentation
commit7d0e1c21cb52e4f81ffe09cb4caee707e5cf4db5 authorPeter Simons <simons@cryp.to> dateThu 20 Jun 2013, 17:26 (13 years ago) parent8ec496d
2 files changed+48−7
doc/GNUmakefile+6−3 doc/hal8-folien.md+42−4
doc/GNUmakefile+6−3
@@ -4,13 +4,13 @@ PANDOC_FLAGS := --smart -V papersize:"a4paper"
44
55.PHONY: all clean
66
7−all: hal8.pdf hal8.html
7+all: hal8.pdf hal8.html hal8-folien.pdf
88
99%.tex : %.md
10− pandoc -s $(PANDOC_FLAGS) -f markdown -t latex $< >$@
10+ pandoc -s $(PANDOC_FLAGS) -f markdown -t latex $< -o $@
1111
1212%.html : %.md
13− pandoc -s $(PANDOC_FLAGS) -f markdown -t html $< >$@
13+ pandoc -s $(PANDOC_FLAGS) -f markdown -t html $< -o $@
1414
1515%.pdf : %.tex
1616 pdflatex $<
@@ -18,5 +18,8 @@ all: hal8.pdf hal8.html
1818 pdflatex $<; \
1919 done
2020
21+hal8-folien.pdf : hal8-folien.md
22+ pandoc -t beamer $< -o $@
23+
2124clean:
2225 @rm -f hal8.aux hal8.html hal8.log hal8.out hal8.pdf hal8.toc
doc/hal8-folien.md+42−4
@@ -7,7 +7,7 @@
771) Vorstellung des Nix Paket-Managers
88
99 - Übersicht der besonderen Features
10− - Der Paket-Store
10+ - Die Paket-Datenbank
1111 - Nix als Programmiersprache
1212
13132) Installation von Haskell-Paketen
@@ -63,7 +63,24 @@
6363- In `/nix/store` installierte Pakete referenzieren niemals
6464 Dateien außerhalb des Stores.
6565
66−# Das Nix-Programm für `parsec 3.1.3`
66+# Die Paketdatenbank
67+
68+- Nixpkgs ist eine Sammlung von Build-Rezepten, die in der rein
69+funktionalen Sprache *Nix* geschrieben sind.
70+
71+- Ein Paket wird erzeugt durch die Funktion `derivation`:
72+
73+ derivation :: String -- Arch-OS
74+ -> String -- Name-Version
75+ -> [String] -- Build-Kommando
76+ -> [StorePath] -- Abhängigkeiten
77+ -> [(String,String)] -- Shell-Umgebung
78+ -> IO StorePath
79+
80+- Nixpkgs bietet verschiedene `mkDerivation`-Wrapper, um die Verwendung
81+von `derivation` vereinfachen.
82+
83+# Das Paket `parsec 3.1.3`
6784
6885 { cabal, mtl, text }:
6986
@@ -84,10 +101,10 @@
84101 /nix/store/i0k3s...-haskell-text-ghc7.6.3-0.11.3.1
85102 /nix/store/q8163...-haskell-transformers-ghc7.6.3-0.3.0.0
86103 [...]
87− building path(s) `/nix/store/0xfxh1ncksix601m9n71fw1wkfhmsjjz-user-environment'
104+ building path(s) `/nix/store/0xfxh...-user-environment'
88105 created 22 symlinks in user environment
89106
90−# Das Nix-Programm für `yesod 1.2.1`
107+# Das Paket für `yesod 1.2.1`
91108
92109 { cabal, aeson, blazeHtml, blazeMarkup, dataDefault,
93110 , hamlet monadControl, networkConduit, safe,
@@ -106,3 +123,24 @@
106123 yesodCore yesodForm yesodPersistent
107124 ];
108125 })
126+
127+# Die Programmiersprache Nix
128+
129+- Nix ist lazy-evaluiertes ungetyptes Lambda-Kalkül.
130+
131+- Strings: `"hello world"`, `http://example.org/`
132+
133+- Listen: `[ 12 "abc" http://example.org ]`
134+
135+- Funktionen: `list: element: list ++ [element]`
136+
137+- Dictionaries: { foo = "foo"; foo = "bar; }
138+
139+- Rekursive Dictionaries:
140+
141+ rec { bar = "foo"; bar = "bar; foobar = foo + bar; }
142+
143+- Let-Statements:
144+
145+ let append = { list ? [], element }: list++[element];
146+ in append { list = ["abc" 3]; element = null; }