From 37393929704e312eabc7a059561e3bf7e87add7b Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:21:14 +0200 Subject: [PATCH] add str import to docs --- crates/compiler/builtins/roc/Str.roc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/compiler/builtins/roc/Str.roc b/crates/compiler/builtins/roc/Str.roc index 4968fb6cf2..095bddcfcd 100644 --- a/crates/compiler/builtins/roc/Str.roc +++ b/crates/compiler/builtins/roc/Str.roc @@ -49,6 +49,16 @@ ## ## Interpolation can be used in multiline strings, but the part inside the parentheses must still be on one line. ## +## ### Import Str from File +## +## To avoid verbose code to read the contents of a file into a Str, you can import it directly: +## +## ``` +## import "some-file.txt" as some_str : Str +## ``` +## +## Note: The file content is included in the Roc app executable, if you publish the executable, you do not need to provide the file alongside it. +## ## ### Escapes ## ## There are a few special escape sequences in strings: