Scan or not to scan?

In the core 5.1.1 package documentation, I can see the definition of the common functional programming function List.scanl.

But the compiler doesn’t recognise it:

I cannot find a `List.scanl` variable:

The `List` module does not expose a `scanl` variable. These names seem close
though:

Any thoughts?

You’re looking at the documentation for the core package for Elm 0.18. (elm-lang/core)

List.scanl was removed in Elm 0.19 and core was moved to elm/core.
https://package.elm-lang.org/packages/elm/core/latest/List

You can use the scanl function from elm-community/list-extra
https://package.elm-lang.org/packages/elm-community/list-extra/latest/List-Extra#scanl

1 Like

Thanks for the info.

In general terms, is there any easy way to tell which piece of documentation is 0.18 or 0.19 – is there a cast-iron way to guarantee being on the latest documentation?

Search for package in http://package.elm-lang.org/ - that only shows 0.19 packages.

And there is also Elm 0.18 packages for 0.18 packages.

Also, https://package.elm-lang.org/packages/elm-lang/core/latest shows 0.18 documentation, which is the trap I fell into - that is where my bookmark pointed…

Yes, it’s a bit confusing. Both 0.18 and 0.19 packages will be located at http://package.elm-lang.org/packages/… but the search engine at http://package.elm-lang.org only shows 0.19 packages.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.