cleanup a little bit

This commit is contained in:
2025-01-06 16:28:40 -08:00
parent 627ca5d91b
commit 265a81257a
21 changed files with 22 additions and 64 deletions

View File

@@ -185,15 +185,14 @@ instance Traversable List where
traverse f Nil = return Nil
traverse f (x :: xs) = return _::_ <*> f x <*> traverse f xs
-- something goes madly wrong with erasure in here.
-- traverse_ : ∀ t f a b. {{Traversable t}} {{Applicative f}} → (a → f b) → t a → f Unit
-- traverse_ f xs = return (const MkUnit) <*> traverse f xs
traverse_ : t f a b. {{Traversable t}} {{Applicative f}} (a f b) t a f Unit
traverse_ f xs = return (const MkUnit) <*> traverse f xs
for : {t : U U} {f : U U} {{Traversable t}} {{appf : Applicative f}} {a : U} {b : U} t a (a f b) f (t b)
for stuff fun = traverse fun stuff
-- for_ : {t : U → U} {f : U → U} → {{Traversable t}} {{appf : Applicative f}} → {a : U} → {b : U} → t a → (a → f b) → f Unit
-- for_ stuff fun = return (const MkUnit) <*> traverse fun stuff
for_ : {t : U U} {f : U U} {{Traversable t}} {{appf : Applicative f}} {a : U} {b : U} t a (a f b) f Unit
for_ stuff fun = return (const MkUnit) <*> traverse fun stuff
instance Applicative Maybe where
return a = Just a