elm-community / list-extra

Convenience functions for working with List.

Home Page:http://package.elm-lang.org/packages/elm-community/list-extra/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setAt wrong params

taj opened this issue · comments

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!

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.

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.