mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Add README for go-to-definition tool
Signed-off-by: Kakadu <Kakadu@pm.me>
This commit is contained in:
parent
a48db74053
commit
5356537fd0
4 changed files with 61 additions and 17 deletions
15
tools/demo1.lama
Normal file
15
tools/demo1.lama
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
public fun foldl (f, acc, l) {
|
||||
-- ^-- (1,19)
|
||||
case l of
|
||||
{} -> acc
|
||||
| x : xs -> foldl (f, f (acc, x), xs)
|
||||
-- (5,22)--^ ^-- (5,25)
|
||||
esac
|
||||
}
|
||||
|
||||
public fun filter (f, l) {
|
||||
case l of
|
||||
{} -> {}
|
||||
| h : t -> if f (h) then h : filter (f, t) else filter (f, t) fi
|
||||
esac
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue