You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Can't find List.cons mentioned in List docs page #456
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.
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.
Activity
andywhite37 commentedon Oct 30, 2018
I was looking for the same thing, and I don't think
List.consexists in the Reason/BuckleScript/Belt libraries in the mentioned form. I think they are referring to theList.consfrom the OCaml (standard?) library, like here: https://caml.inria.fr/pub/docs/manual-ocaml/libref/List.htmlIt sounds like this page is saying
[h, ...t]is the Reason equivalent ofList.cons, but it could be more clear.