First pass at a scheme backend
This commit is contained in:
@@ -9,6 +9,13 @@ snoclen {a} xs = go xs Z
|
||||
go Lin acc = acc
|
||||
go (xs :< x) acc = go xs (S acc)
|
||||
|
||||
snoclen' : ∀ a. SnocList a → Int
|
||||
snoclen' {a} xs = go xs 0
|
||||
where
|
||||
go : SnocList a → Int → Int
|
||||
go Lin acc = acc
|
||||
go (xs :< x) acc = go xs (1 + acc)
|
||||
|
||||
snocelem : ∀ a. {{Eq a}} → a → SnocList a → Bool
|
||||
snocelem a Lin = False
|
||||
snocelem a (xs :< x) = if a == x then True else snocelem a xs
|
||||
|
||||
Reference in New Issue
Block a user