files

Claro's StdLib Module Documentation Generation Is Still a WIP.

This is currently just a placeholder to at least ensure that all the StdLib Modules are represented here so that you don't have to dig into the GitHub repo to find this. But, expect this to improve and become more interactive over time.


# Opaque type whose internal representation is not exposed to consumers. This cannot be unwrapped OR initialized by any
# code outside of this module's srcs.
opaque newtype Resource
newtype IOError : string

# Now some claro file could read a resource declared in its build target as:
#   claro_module(
#     name = "foo",
#     module_api_file = "foo.claro_module_api",
#     srcs = ["foo.claro"],
#     resources = {"MyFile": "myfile.txt"},
#   }
# Inside `foo.claro`:
#   var fileContents: string = files::readOrPanic(resources::MyFile);
function read(resource: Resource) -> oneof<string, std::Error<IOError>>;
function readOrPanic(resource: Resource) -> string;