3data List a = Nil | Cons a (List a);
6rev xs = revAcc Nil xs where {
7 revAcc : List a -> List a -> List a;
9 revAcc acc (Cons x xs) = revAcc (Cons x acc) xs;
12length : List a -> Int;
14length (Cons x xs) = 1 + length xs;
16take : Int -> List a -> List a;
19take n (Cons x xs) = Cons x (take (n-1) xs);
21drop : Int -> List a -> List a;
24drop n (Cons x xs) = drop (n-1) xs;
26map : (a -> b) -> List a -> List b;
28map f (Cons x xs) = Cons (f x) (map f xs);
30filter : (y -> Bool) -> List y -> List y;
32filter pred (Cons x xs) with (pred x, filter pred xs) {
33 filter pred (Cons x xs) | (True, fxs) = Cons x fxs;
34 filter pred (Cons x xs) | (False, fxs) = fxs;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list