Skip to content

Conversation

damncabbage
Copy link
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
Contributor Author

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

@garyb
Copy link
Member

garyb commented Jul 21, 2016

mapWithIndex would be my preferred name 👍 we use imap for invariant functors: https://pursuit.purescript.org/packages/purescript-invariant/1.0.0/docs/Data.Functor.Invariant#v:imap

@paf31
Copy link
Contributor

paf31 commented Jul 25, 2016

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