elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 59 forks source link

setAt wrong params #121

Closed taj closed 5 years ago

taj commented 5 years ago

The thid parameter of List.Extra.setAt is supposed by List a but it's actually List (Maybe a)

Not sure if the documentation needs to be updated or the function needs to be fixed. imho I would prefer it if we could fix the function!

pzp1997 commented 5 years ago

The third parameter to setAt is of type List a both in code and documentation. (By the way, it is impossible for the types in the documentation and code to be out of sync because the documentation is autogenerated from the code.)

Perhaps your second argument to setAt is of type Maybe a causing the third argument to have type List (Maybe a)?

Or if you actually meant that the third argument has type Maybe (List a) then perhaps you are using a really old version of the list-extra library. The type was changed from Maybe (List a) to List a over a year and a half ago in #36.

taj commented 5 years ago

My bad, the issue I had was getAt, that I was using a couple of lines above, that returns Maybe a and I didn't realise that! Thanks @pzp1997 !

Closing this issue.