annotate 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
rev   line source
adam@11 1 val numFields : r ::: {Type} -> folder r -> $r -> int
adam@11 2
adam@10 3 val mem : a ::: Type -> ns ::: {Unit} -> eq a -> folder ns -> a -> $(mapU a ns) -> bool
adam@10 4 (* Is a value found in a record? *)
adam@12 5
adam@12 6 val equal : ts ::: {Type} -> $(map eq ts) -> folder ts -> $ts -> $ts -> bool
adam@12 7 (* Are two records equal? *)
ezyang@28 8
ezyang@28 9 (* Analogous to applicative ap e.g. <*>, of type [f (a -> b) -> f a -> f b] *)
ezyang@28 10 val ap : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type)
ezyang@28 11 -> r ::: {K} -> folder r
ezyang@28 12 -> $(map (fn t => tf1 t -> tf2 t) r)
ezyang@28 13 -> $(map tf1 r)
ezyang@28 14 -> $(map tf2 r)