annotate lib/ur/monad.urs @ 2279:32a407902d3b

Rewrite LRU cache. Now uses one big hash table and is less buggy.
author Ziv Scully <ziv@mit.edu>
date Wed, 11 Nov 2015 20:01:48 -0500
parents cbd294994c69
children
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
adam@1768 10 val liftM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type
adam@1768 11 -> (a -> b) -> m a -> m b
adam@1768 12 (* Haskell-style synonym for [mp] *)
adam@1768 13
adam@1768 14 val liftM2 : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type -> c ::: Type
adam@1768 15 -> (a -> b -> c) -> m a -> m b -> m c
adam@1768 16
adamc@905 17 val foldR : K --> m ::: (Type -> Type) -> monad m
adamc@905 18 -> tf :: (K -> Type)
adamc@905 19 -> tr :: ({K} -> Type)
adamc@905 20 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@905 21 -> [[nm] ~ rest] =>
adamc@905 22 tf t -> tr rest -> m (tr ([nm = t] ++ rest)))
adamc@905 23 -> tr []
adamc@1093 24 -> r ::: {K} -> folder r -> $(map tf r) -> m (tr r)
adamc@905 25
adamc@905 26 val foldR2 : K --> m ::: (Type -> Type) -> monad m
adamc@905 27 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
adamc@905 28 -> tr :: ({K} -> Type)
adamc@905 29 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@905 30 -> [[nm] ~ rest] =>
adamc@905 31 tf1 t -> tf2 t -> tr rest -> m (tr ([nm = t] ++ rest)))
adamc@905 32 -> tr []
adamc@1093 33 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m (tr r)
adamc@905 34
adamc@910 35 val foldR3 : K --> m ::: (Type -> Type) -> monad m
adamc@910 36 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type)
adamc@910 37 -> tr :: ({K} -> Type)
adamc@910 38 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@910 39 -> [[nm] ~ rest] =>
adamc@910 40 tf1 t -> tf2 t -> tf3 t -> tr rest -> m (tr ([nm = t] ++ rest)))
adamc@910 41 -> tr []
adamc@1093 42 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> m (tr r)
adamc@910 43
adamc@1172 44 val mapR0 : K --> m ::: (Type -> Type) -> monad m
adamc@1172 45 -> tr :: (K -> Type)
adamc@1172 46 -> (nm :: Name -> t :: K -> m (tr t))
adamc@1172 47 -> r ::: {K} -> folder r -> m ($(map tr r))
adamc@1172 48
adamc@905 49 val mapR : K --> m ::: (Type -> Type) -> monad m
adamc@905 50 -> tf :: (K -> Type)
adamc@905 51 -> tr :: (K -> Type)
adamc@905 52 -> (nm :: Name -> t :: K -> tf t -> m (tr t))
adamc@1093 53 -> r ::: {K} -> folder r -> $(map tf r) -> m ($(map tr r))
adamc@937 54
adamc@937 55 val mapR2 : K --> m ::: (Type -> Type) -> monad m
adamc@937 56 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
adamc@937 57 -> tr :: (K -> Type)
adamc@937 58 -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> m (tr t))
adamc@1093 59 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m ($(map tr r))
adamc@1175 60
adam@2185 61 val mapR3 : K --> m ::: (Type -> Type) -> monad m
adam@2185 62 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type)
adam@2185 63 -> tr :: (K -> Type)
adam@2185 64 -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> tf3 t -> m (tr t))
adam@2185 65 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> m ($(map tr r))
adam@2185 66
adamc@1175 67 val foldMapR : K --> m ::: (Type -> Type) -> monad m
adamc@1175 68 -> tf :: (K -> Type)
adamc@1175 69 -> tf' :: (K -> Type)
adamc@1175 70 -> tr :: ({K} -> Type)
adamc@1175 71 -> (nm :: Name -> t :: K -> rest :: {K}
adamc@1175 72 -> [[nm] ~ rest] =>
adamc@1175 73 tf t -> tr rest -> m (tf' t * tr ([nm = t] ++ rest)))
adamc@1175 74 -> tr []
adamc@1175 75 -> r ::: {K} -> folder r -> $(map tf r) -> m ($(map tf' r) * tr r)
adamc@1257 76
adam@1312 77 val appR : K --> m ::: (Type -> Type) -> monad m
adam@1312 78 -> tf :: (K -> Type)
adam@1312 79 -> (nm :: Name -> t :: K -> tf t -> m unit)
adam@1312 80 -> r ::: {K} -> folder r -> $(map tf r) -> m unit
adam@1312 81
adamc@1257 82 val appR2 : K --> m ::: (Type -> Type) -> monad m
adamc@1257 83 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
adam@1310 84 -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> m unit)
adamc@1257 85 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m unit
adam@1313 86
adam@1313 87 val appR3 : K --> m ::: (Type -> Type) -> monad m
adam@1313 88 -> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type)
adam@1313 89 -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> tf3 t -> m unit)
adam@1313 90 -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> m unit