annotate lib/ur/monad.urs @ 1262:003df929ee08

Switch to strings and eval for thunkifying JavaScripted functions
author Adam Chlipala <adamc@hcoop.net>
date Sat, 22 May 2010 16:29:54 -0400
parents fd1a49b51db5
children f0909fb3848f
rev   line source
adamc@834 1 val exec : m ::: (Type -> Type) -> monad m -> ts ::: {Type}
adamc@834 2 -> $(map m ts) -> folder ts -> m $ts
adamc@898 3
adamc@898 4 val ignore : m ::: (Type -> Type) -> monad m -> t ::: Type
adamc@898 5 -> m t -> m unit
adamc@905 6
adamc@917 7 val mp : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type
adamc@917 8 -> (a -> b) -> m a -> m b
adamc@917 9
adamc@905 10 val foldR : K --> m ::: (Type -> Type) -> monad m
adamc@905 11 -> tf :: (K -> Type)
adamc@905 12 -> tr :: ({K} -> Type)
adamc@905 13 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@905 14 -> [[nm] ~ rest] =>
adamc@905 15 tf t -> tr rest -> m (tr ([nm = t] ++ rest)))
adamc@905 16 -> tr []
adamc@1093 17 -> r ::: {K} -> folder r -> $(map tf r) -> m (tr r)
adamc@905 18
adamc@905 19 val foldR2 : K --> m ::: (Type -> Type) -> monad m
adamc@905 20 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
adamc@905 21 -> tr :: ({K} -> Type)
adamc@905 22 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@905 23 -> [[nm] ~ rest] =>
adamc@905 24 tf1 t -> tf2 t -> tr rest -> m (tr ([nm = t] ++ rest)))
adamc@905 25 -> tr []
adamc@1093 26 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m (tr r)
adamc@905 27
adamc@910 28 val foldR3 : K --> m ::: (Type -> Type) -> monad m
adamc@910 29 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type)
adamc@910 30 -> tr :: ({K} -> Type)
adamc@910 31 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@910 32 -> [[nm] ~ rest] =>
adamc@910 33 tf1 t -> tf2 t -> tf3 t -> tr rest -> m (tr ([nm = t] ++ rest)))
adamc@910 34 -> tr []
adamc@1093 35 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> m (tr r)
adamc@910 36
adamc@1172 37 val mapR0 : K --> m ::: (Type -> Type) -> monad m
adamc@1172 38 -> tr :: (K -> Type)
adamc@1172 39 -> (nm :: Name -> t :: K -> m (tr t))
adamc@1172 40 -> r ::: {K} -> folder r -> m ($(map tr r))
adamc@1172 41
adamc@905 42 val mapR : K --> m ::: (Type -> Type) -> monad m
adamc@905 43 -> tf :: (K -> Type)
adamc@905 44 -> tr :: (K -> Type)
adamc@905 45 -> (nm :: Name -> t :: K -> tf t -> m (tr t))
adamc@1093 46 -> r ::: {K} -> folder r -> $(map tf r) -> m ($(map tr r))
adamc@937 47
adamc@937 48 val mapR2 : K --> m ::: (Type -> Type) -> monad m
adamc@937 49 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
adamc@937 50 -> tr :: (K -> Type)
adamc@937 51 -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> m (tr t))
adamc@1093 52 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m ($(map tr r))
adamc@1175 53
adamc@1175 54 val foldMapR : K --> m ::: (Type -> Type) -> monad m
adamc@1175 55 -> tf :: (K -> Type)
adamc@1175 56 -> tf' :: (K -> Type)
adamc@1175 57 -> tr :: ({K} -> Type)
adamc@1175 58 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@1175 59 -> [[nm] ~ rest] =>
adamc@1175 60 tf t -> tr rest -> m (tf' t * tr ([nm = t] ++ rest)))
adamc@1175 61 -> tr []
adamc@1175 62 -> r ::: {K} -> folder r -> $(map tf r) -> m ($(map tf' r) * tr r)
adamc@1257 63
adamc@1257 64 val appR2 : K --> m ::: (Type -> Type) -> monad m
adamc@1257 65 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
adamc@1257 66 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@1257 67 -> [[nm] ~ rest] =>
adamc@1257 68 tf1 t -> tf2 t -> m unit)
adamc@1257 69 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m unit