Unbound module Str?


#1

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?


#2

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.


#3

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


#4

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


#5

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.


#6

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