Mercurial > urweb
comparison lib/ur/list.ur @ 1840:146ec8e90063
Add some name-mangling rules to allow XML attribute 'name' and attributes with dashes
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 27 Dec 2012 15:34:11 -0500 |
parents | a613cae954ca |
children | d9f918b79b5a |
comparison
equal
deleted
inserted
replaced
1839:d8c260bcc1f9 | 1840:146ec8e90063 |
---|---|
435 rest <- mapXiM' (i+1) ls; | 435 rest <- mapXiM' (i+1) ls; |
436 return <xml>{this}{rest}</xml> | 436 return <xml>{this}{rest}</xml> |
437 in | 437 in |
438 mapXiM' 0 | 438 mapXiM' 0 |
439 end | 439 end |
440 | |
441 fun tabulateM [m] (_ : monad m) [a] (f : int -> m a) n = | |
442 let | |
443 fun tabulate' n acc = | |
444 if n <= 0 then | |
445 return acc | |
446 else | |
447 (v <- f (n-1); | |
448 tabulate' (n-1) (v :: acc)) | |
449 in | |
450 tabulate' n [] | |
451 end |