This commit is contained in:
2024-12-03 22:07:52 -08:00
parent dbc5670a52
commit 21b03368d4
4 changed files with 107 additions and 5 deletions

View File

@@ -627,3 +627,9 @@ instance Functor IO where
uncurry : a b c. (a -> b -> c) -> (a × b) -> c
uncurry f (a,b) = f a b
-- TODO Idris has a tail recursive version of this
instance Applicative List where
return a = a :: Nil
Nil <*> _ = Nil
fs <*> ys = join $ map (\ f => map f ys) fs