-
Notifications
You must be signed in to change notification settings - Fork 0
/
goal.txt
94 lines (69 loc) · 2.05 KB
/
goal.txt
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
system zero - a total dependently-typed functional programming language
bool : data.
true : bool.
false : bool.
if : bool -> forall (r : data) -> r -> r -> r.
bool = forall (r : data) -> r -> r -> r.
true r x _ = x.
false r _ y = y.
if b = b.
and : bool -> bool -> bool.
and x y = if x bool y false.
or : bool -> bool -> bool.
or x y = if x bool true y.
xor : bool -> bool -> bool.
xor x y = if x bool (not y) y.
-- normalize identity on int
(forall (a : data) -> (x : a) -> x) int 1
(forall (int : data) -> (x : int) -> x) 1
((x : int) -> x) 1
((1 : int) -> 1)
1
-- try again?
what is the type of data? of codata? if they are different types?
-- helpful things?
id : forall (a : data) -> a -> a.
id = \(a : data) -> \(va : a) -> va.
id (a : data) (va : a) = va.
id (a : data) (va : a) : a = va.
id (a : data) (va : a) -> a = va.
id a va = va.
-- types to implement, in rough order of priority?
bool : data.
nat : data.
list a : data -> data.
stream a : data -> codata.
tuple n : nat -> data.
vec n a : nat -> data -> data.
algebra?
f-algebra
f-coalgebra
how to convert algebraic data types into f-algebra and f-coalgebra?
strictly positive
recursion
corecursion
structure of codata (http://www.tac-tics.net/blog/data-vs-codata)
http://lambda-the-ultimate.org/node/4373
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.46.5169&rep=rep1&type=pdf
http://www.cs.nott.ac.uk/~psztxa/talks/types04.pdf
https://brianmckenna.org/blog/evenodd_agda_idris_haskell_scala
http://blog.sigfpe.com/2007/07/data-and-codata.html
-- the below types may be useful
forall a. a -> a.
exists b. b -> b.
forall a. free f a
list : (a : data) -> data.
nil : list a.
cons : a -> list a -> list a.
head : cons a (list a) -> a.
tail : cons a (list a) -> list a.
map : (a -> b) -> list a -> list b.
zip : (a -> b -> c) -> list a -> list b -> list c.
foldr : (a -> b -> b) -> b -> list a -> b.
foldl : (b -> a -> b) -> b -> list a -> b.
stream : (a : data) -> codata.
nil : stream a.
cons : a -> stream a -> stream a.
algebra f a : f a -> a.
coalgebra f a : a -> f a.
stream : data -> codata.