Skip to content

Commit

Permalink
Make it easier to discover the format fp trick. Fixes #97
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriella439 committed Aug 22, 2015
1 parent cffe0ef commit a2fff2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Turtle/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
4 changes: 4 additions & 0 deletions src/Turtle/Tutorial.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit a2fff2a

Please sign in to comment.