2import Control.Monad.State
3import Control.Monad.Identity
6VThing = {n : Nat} -> Vect n Int -> Int
8foo : Int -> Vect m Int -> ({n : Nat} -> Vect n Int -> Int) -> Int
11foo' : Int -> Vect m Int -> VThing -> Int
16bar y (x :: xs) = y + x + bar y xs
18vsum : Vect n Int -> Int
20vsum (x :: xs) = x + vsum xs
22testfoo : Vect n Int -> Int
23testfoo xs = foo 42 xs (\ xs => vsum xs)
25testfoo2 : Vect n Int -> Int
26testfoo2 xs = foo' 42 xs vsum
28testfoo3 : Vect n Int -> Int
29testfoo3 xs = foo 42 xs (bar 10)
31AnyST : Type -> Type -> Type
32AnyST s a = {m : _} -> Monad m => StateT s m a
38wibble : StateT Int Maybe ()
41appShow : Show a => ({b : _} -> Show b => b -> String) -> a -> String
44myshow : Show a => a -> String
48baz x = appShow myshow x ++ appShow show x
50tupleId : ({a : _} -> a -> a) -> (a, b) -> (a, b)
51tupleId f (a, b) = (f a, f b)
54AppendType = {a, n, m : _} -> Vect n a -> Vect m a -> Vect (n + m) a
58append (x :: xs) ys = x :: append xs ys
61main = do putStrLn (baz 42)
62 print (append [1,2,3] [4,5,6])
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