This commit is contained in:
2025-12-08 08:07:44 -08:00
parent a9c588be76
commit 6c836a6ef4
3 changed files with 129 additions and 2 deletions

View File

@@ -353,9 +353,14 @@ instance Monad IO where
bindList : a b. List a (a List b) List b
-- Tail recursive, but may be hard to write proofs?
instance a. Concat (List a) where
Nil ++ ys = ys
(x :: xs) ++ ys = x :: (xs ++ ys)
xs ++ ys = go (reverse xs) ys
where
go : a. List a List a List a
go Nil ys = ys
go (x :: xs) ys = go xs (x :: ys)
instance Monad List where
pure a = a :: Nil