git.iko.soy/typeable/cabal2nix
on master help sign in
doc: extended the presentation
7d0e1c2Peter Simons
doc/GNUmakefile+6−3
@@ -4,13 +4,13 @@ PANDOC_FLAGS := --smart -V papersize:"a4paper"
4
4
5.PHONY: all clean
5.PHONY: all clean
6
6
7−all: hal8.pdf hal8.html
7+all: hal8.pdf hal8.html hal8-folien.pdf
8
8
9%.tex : %.md
9%.tex : %.md
10− pandoc -s $(PANDOC_FLAGS) -f markdown -t latex $< >$@
10+ pandoc -s $(PANDOC_FLAGS) -f markdown -t latex $< -o $@
11
11
12%.html : %.md
12%.html : %.md
13− pandoc -s $(PANDOC_FLAGS) -f markdown -t html $< >$@
13+ pandoc -s $(PANDOC_FLAGS) -f markdown -t html $< -o $@
14
14
15%.pdf : %.tex
15%.pdf : %.tex
16 pdflatex $<
16 pdflatex $<
@@ -18,5 +18,8 @@ all: hal8.pdf hal8.html
18 pdflatex $<; \
18 pdflatex $<; \
19 done
19 done
20
20
21+hal8-folien.pdf : hal8-folien.md
22+ pandoc -t beamer $< -o $@
23+
21clean:
24clean:
22 @rm -f hal8.aux hal8.html hal8.log hal8.out hal8.pdf hal8.toc
25 @rm -f hal8.aux hal8.html hal8.log hal8.out hal8.pdf hal8.toc
doc/hal8-folien.md+42−4
@@ -7,7 +7,7 @@
71) Vorstellung des Nix Paket-Managers
71) Vorstellung des Nix Paket-Managers
8
8
9 - Übersicht der besonderen Features
9 - Übersicht der besonderen Features
10− - Der Paket-Store
10+ - Die Paket-Datenbank
11 - Nix als Programmiersprache
11 - Nix als Programmiersprache
12
12
132) Installation von Haskell-Paketen
132) Installation von Haskell-Paketen
@@ -63,7 +63,24 @@
63- In `/nix/store` installierte Pakete referenzieren niemals
63- In `/nix/store` installierte Pakete referenzieren niemals
64 Dateien außerhalb des Stores.
64 Dateien außerhalb des Stores.
65
65
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+
66−# Das Nix-Programm für `parsec 3.1.3`
83+# Das Paket `parsec 3.1.3`
67
84
68 { cabal, mtl, text }:
85 { cabal, mtl, text }:
69
86
@@ -84,10 +101,10 @@
84 /nix/store/i0k3s...-haskell-text-ghc7.6.3-0.11.3.1
101 /nix/store/i0k3s...-haskell-text-ghc7.6.3-0.11.3.1
85 /nix/store/q8163...-haskell-transformers-ghc7.6.3-0.3.0.0
102 /nix/store/q8163...-haskell-transformers-ghc7.6.3-0.3.0.0
86 [...]
103 [...]
87− building path(s) `/nix/store/0xfxh1ncksix601m9n71fw1wkfhmsjjz-user-environment'
104+ building path(s) `/nix/store/0xfxh...-user-environment'
88 created 22 symlinks in user environment
105 created 22 symlinks in user environment
89
106
90−# Das Nix-Programm für `yesod 1.2.1`
107+# Das Paket für `yesod 1.2.1`
91
108
92 { cabal, aeson, blazeHtml, blazeMarkup, dataDefault,
109 { cabal, aeson, blazeHtml, blazeMarkup, dataDefault,
93 , hamlet monadControl, networkConduit, safe,
110 , hamlet monadControl, networkConduit, safe,
@@ -106,3 +123,24 @@
106 yesodCore yesodForm yesodPersistent
123 yesodCore yesodForm yesodPersistent
107 ];
124 ];
108 })
125 })
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; }