Make it easier to discover the format fp
trick. Fixes #97
This commit is contained in:
parent
cffe0ef573
commit
a2fff2acf9
2 changed files with 10 additions and 0 deletions
|
@ -52,6 +52,12 @@
|
||||||
-- 456
|
-- 456
|
||||||
-- ABC
|
-- ABC
|
||||||
--
|
--
|
||||||
|
-- Format strings in a type safe way using `format`:
|
||||||
|
--
|
||||||
|
-- >>> dir <- pwd
|
||||||
|
-- >>> format ("I am in the "%fp%" directory") dir
|
||||||
|
-- "I am in the /tmp directory"
|
||||||
|
--
|
||||||
-- Commands like `grep`, `sed` and `find` accept arbitrary `Pattern`s
|
-- Commands like `grep`, `sed` and `find` accept arbitrary `Pattern`s
|
||||||
--
|
--
|
||||||
-- >>> stdout (grep ("123" <|> "ABC") (input "foo.txt"))
|
-- >>> stdout (grep ("123" <|> "ABC") (input "foo.txt"))
|
||||||
|
|
|
@ -777,6 +777,10 @@ import Turtle
|
||||||
-- another argument of type `Int` to satisfy the `d` at the end of the format
|
-- another argument of type `Int` to satisfy the `d` at the end of the format
|
||||||
-- string.
|
-- string.
|
||||||
--
|
--
|
||||||
|
-- Note that this is also the idiomatic way to convert a `FilePath` to `Text`:
|
||||||
|
--
|
||||||
|
-- > format fp :: FilePath -> Text
|
||||||
|
--
|
||||||
-- If you are interested in this feature, check out the "Turtle.Format" module
|
-- If you are interested in this feature, check out the "Turtle.Format" module
|
||||||
-- for more details.
|
-- for more details.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue