Registry Mirror
Skip to content

Can't find List.cons mentioned in List docs page #456

Open

Description

@farskid

According to https://reasonml.github.io/docs/en/list-and-array, spread syntax for appending items to a list is just an alternative to List.cons. I couldn't find any reference to such a method name List.cons in API docs.

Is it a real thing or just a typo of List.concat?

Activity

  1. andywhite37 commented on Oct 30, 2018

    @andywhite37

    I was looking for the same thing, and I don't think List.cons exists in the Reason/BuckleScript/Belt libraries in the mentioned form. I think they are referring to the List.cons from the OCaml (standard?) library, like here: https://caml.inria.fr/pub/docs/manual-ocaml/libref/List.html

    It sounds like this page is saying [h, ...t] is the Reason equivalent of List.cons, but it could be more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions