# HG changeset patch # User haftmann # Date 1445090910 -7200 # Node ID 7d1127ac2251c5082ac5ab2533a101181b2b41ed # Parent 282f69026f91f96254224a861df9c3bf78c24305 code abbreviation for mapping over a fixed range diff -r 282f69026f91 -r 7d1127ac2251 src/HOL/List.thy --- a/src/HOL/List.thy Sat Oct 17 23:07:28 2015 +0200 +++ b/src/HOL/List.thy Sat Oct 17 16:08:30 2015 +0200 @@ -6389,6 +6389,15 @@ "map f (filter P xs) = map_filter (\x. if P x then Some (f x) else None) xs" by (simp add: map_filter_def) +definition map_range :: "(nat \ 'a) \ nat \ 'a list" +where + [code_abbrev]: "map_range f n = map f [0..Optimized code for @{text"\i\{a..b::int}"} and @{text"\n:{a.."}.\