comparison record.ur @ 11:67b33be5d56a

Record.numFields
author Adam Chlipala <adam@chlipala.net>
date Thu, 03 Feb 2011 14:22:02 -0500
parents 763eb2f2aa5a
children a6730c3cfea7
comparison
equal deleted inserted replaced
10:763eb2f2aa5a 11:67b33be5d56a
1 fun numFields [r ::: {Type}] (fl : folder r) (r : $r) : int =
2 @fold [fn _ => int] (fn [nm ::_] [u ::_] [r ::_] [[nm] ~ r] acc => acc+1) 0 fl
3
1 fun mem [a ::: Type] [ns ::: {Unit}] (_ : eq a) (fl : folder ns) (x : a) (r : $(mapU a ns)) : bool = 4 fun mem [a ::: Type] [ns ::: {Unit}] (_ : eq a) (fl : folder ns) (x : a) (r : $(mapU a ns)) : bool =
2 @foldUR [a] [fn _ => bool] 5 @foldUR [a] [fn _ => bool]
3 (fn [nm ::_] [r ::_] [[nm] ~ r] y acc => 6 (fn [nm ::_] [r ::_] [[nm] ~ r] y acc =>
4 acc || x = y) 7 acc || x = y)
5 False fl r 8 False fl r