diff record.urs @ 28:f55f66c6fdee

Migrate ap method to Record module.
author Edward Z. Yang <ezyang@mit.edu>
date Thu, 26 Jul 2012 16:48:37 -0400
parents a6730c3cfea7
children
line wrap: on
line diff
--- a/record.urs	Thu Jul 26 16:39:02 2012 -0400
+++ b/record.urs	Thu Jul 26 16:48:37 2012 -0400
@@ -5,3 +5,10 @@
 
 val equal : ts ::: {Type} -> $(map eq ts) -> folder ts -> $ts -> $ts -> bool
 (* Are two records equal? *)
+
+(* Analogous to applicative ap e.g. <*>, of type [f (a -> b) -> f a -> f b] *)
+val ap : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
+         -> r ::: {K} -> folder r
+         -> $(map (fn t => tf1 t -> tf2 t) r)
+         -> $(map tf1 r)
+         -> $(map tf2 r)