Make it easier to discover the format fp trick. Fixes #97

This commit is contained in:
Gabriel Gonzalez 2015-08-22 12:43:25 -07:00
parent cffe0ef573
commit a2fff2acf9
2 changed files with 10 additions and 0 deletions

View file

@ -52,6 +52,12 @@
-- 456
-- 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
--
-- >>> stdout (grep ("123" <|> "ABC") (input "foo.txt"))

View file

@ -777,6 +777,10 @@ import Turtle
-- another argument of type `Int` to satisfy the `d` at the end of the format
-- 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
-- for more details.