Skip to content

Adds mapWithIndex (map with a generated index)#68

Merged
garyb merged 1 commit into
purescript:masterfrom
damncabbage:topic/mapWithIndex
Jul 26, 2016
Merged

Adds mapWithIndex (map with a generated index)#68
garyb merged 1 commit into
purescript:masterfrom
damncabbage:topic/mapWithIndex

Conversation

@damncabbage

Copy link
Copy Markdown
Contributor

mapWithIndex :: forall a b. (Int -> a -> b) -> Array a -> Array b

This PR came about as a result of asking in the Gitter channel to see if anyone else writes their own version of this function: https://gitter.im/purescript/purescript?at=5785c87959cfbd4c5e93113f

(CC: @dkoontz, @felixSchl)

@damncabbage

Copy link
Copy Markdown
Contributor Author

(This is already called imap in the Haskell vector package, in case you're not happy with the name.)

@garyb

garyb commented Jul 21, 2016

Copy link
Copy Markdown
Member

@paf31

paf31 commented Jul 25, 2016

Copy link
Copy Markdown
Contributor

Looks good! Agreed on the name.

@garyb garyb merged commit 90b1c3d into purescript:master Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants