-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_links_generator.dhall
80 lines (70 loc) · 2.3 KB
/
example_links_generator.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
-- Usage: dhall text --file example_links_generator.dhall
let Prelude =
https://prelude.dhall-lang.org/v21.1.0/package.dhall
sha256:0fed19a88330e9a8a3fbe1e8442aa11d12e38da51eb12ba8bcb56f3c25d0854a
let template =
\(title : Text) ->
\(filename : Text) ->
''
## ${title}
![${filename}](examples/${filename}/number-of-seats-d/out.png)
''
let simple_template = \(name : Text) -> template name name
let simple_subs =
[ "equilateral"
, "colinear1"
, "two_close_right"
, "two_close"
, "colinear2"
, "square"
, "tick"
, "on_triangle"
, "middle_four"
]
let Desc
: Type
= { filename : Text, title : Text }
let stv_subs
: List Desc
= [ { filename = "stv-8-1.0-normal", title = "stv 8 candidates stdev 1.0" }
, { filename = "stv-8-1.0-min"
, title = "stv 8 candidates stdev 1.0 with min party discipline"
}
, { filename = "stv-8-1.0-avg"
, title = "stv 8 candidates stdev 1.0 with avg party discipline"
}
, { filename = "stv-8-0.5-normal", title = "stv 8 candidates stdev 0.5" }
, { filename = "stv-8-0.5-min"
, title = "stv 8 candidates stdev 0.5 with min party discipline"
}
, { filename = "stv-8-0.5-avg"
, title = "stv 8 candidates stdev 0.5 with avg party discipline"
}
, { filename = "stv-13-1.0-normal"
, title = "stv 13 candidates stdev 1.0"
}
, { filename = "stv-13-1.0-min"
, title = "stv 13 candidates stdev 1.0 with min party discipline"
}
, { filename = "stv-13-1.0-avg"
, title = "stv 13 candidates stdev 1.0 with avg party discipline"
}
, { filename = "stv-13-0.5-normal"
, title = "stv 13 candidates stdev 0.5"
}
, { filename = "stv-13-0.5-min"
, title = "stv 13 candidates stdev 0.5 with min party discipline"
}
, { filename = "stv-13-0.5-avg"
, title = "stv 13 candidates stdev 0.5 with avg party discipline"
}
]
let x = Prelude.List.map Text Text simple_template simple_subs
let y =
Prelude.List.map
Desc
Text
(\(x : Desc) -> template x.title x.filename)
stv_subs
let z = Prelude.List.concat Text [ x, y ]
in Prelude.Text.concat z