equal
deleted
inserted
replaced
165 fun map_filter f = maps (fn x => (case f x of NONE => empty | SOME y => single y)); |
165 fun map_filter f = maps (fn x => (case f x of NONE => empty | SOME y => single y)); |
166 |
166 |
167 fun lift f xq y = map (fn x => f x y) xq; |
167 fun lift f xq y = map (fn x => f x y) xq; |
168 fun lifts f xq y = maps (fn x => f x y) xq; |
168 fun lifts f xq y = maps (fn x => f x y) xq; |
169 |
169 |
170 fun singleton f x = f [x] |> map (fn [y] => y | _ => raise Empty); |
170 fun singleton f x = f [x] |> map (fn [y] => y | _ => raise List.Empty); |
171 |
171 |
172 (*print a sequence, up to "count" elements*) |
172 (*print a sequence, up to "count" elements*) |
173 fun print print_elem count = |
173 fun print print_elem count = |
174 let |
174 let |
175 fun prnt (k: int) xq = |
175 fun prnt (k: int) xq = |