Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: List.iteri #2638

Closed
vicuna opened this issue Dec 10, 2000 · 2 comments
Closed

Suggestion: List.iteri #2638

vicuna opened this issue Dec 10, 2000 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Dec 10, 2000

Original bug ID: 245
Reporter: administrator
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2012-03-24T14:01:44Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

(* val iteri : (int -> 'a -> unit) -> 'a list -> unit = *)
let iteri (f:int -> 'a -> unit) (list:'a list) =
let rec iteri2 f n = function
[] -> ()
| a::l -> f n a; iteri2 f (n+1) l in
iteri2 f 0 list

I had to add the explicit typing, since the infered typing of the f is
f:int -> 'a -> 'b


Mattias

P.s I asked for where to find the source of ocamlwin, but I got no answer
P.P.s I never reach a bootstrap fixpoint for cygwin, but directly when using
redhat 6.2, probably the bootstrap-check doesn't work for cygwin.

@vicuna
Copy link
Author

vicuna commented Nov 6, 2002

Comment author: administrator

not enough demand

@vicuna
Copy link
Author

vicuna commented Nov 5, 2010

Comment author: @alainfrisch

List.iteri and List.mapi have been added to the trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants