Unbound module Str?


From https://reasonml.github.io/docs/en/string-and-char#design-decisions:

let r = Str.regexp({|hello \([A-Za-z]+\)|});

But I get “Unbound module Str”. Why?


Though for JS compilation, you’d use [%bs.re] and Js.Re instead, since Str is not available.

I think it’s showing a pseudo code example for some reason. Not sure why though. Maybe it’s worth updating the docs.


That code example will work when compiling to OCaml native binaries or bytecode. It won’t work only for BuckleScript (JavaScript) compilation.


That’s not clear from the example. I think I’ll make a PR to clarify your point more.


Thanks for the answers.

I like ReasonML and I think it’s a great language (I have tried several), but issues like this are bad. It will make it difficult to learn the language having to navigate two libraries (Reason and BuckleScript), and it looks like nobody cares for the language.


Right now we have these rough spots but I’m sure in time they will be smoothed over :slight_smile: