You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug in code, but for documentation, I think, but I'd like to confirm intention.
The sample code for String.mapi is input |> String.mapi (fun i c -> (i, c)), but this lambda produces int * char, so we have an error when we run this sample. I somehow correct the document, e.g, input |> String.mapi (fun _ c -> c), but what is a better example for String.mapi? Or is the intent of String.mapi (and/or String.map?) originally to be Seq.map, e.g., mapping should be int -> 'char -> 'U?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is not a bug in code, but for documentation, I think, but I'd like to confirm intention.
The sample code for
String.mapi
isinput |> String.mapi (fun i c -> (i, c))
, but this lambda producesint * char
, so we have an error when we run this sample. I somehow correct the document, e.g,input |> String.mapi (fun _ c -> c)
, but what is a better example forString.mapi
? Or is the intent ofString.mapi
(and/orString.map
?) originally to beSeq.map
, e.g.,mapping
should beint -> 'char -> 'U
?Beta Was this translation helpful? Give feedback.
All reactions