commit
0f8b6f00d4
1 changed files with 9 additions and 6 deletions
|
@ -180,6 +180,15 @@ g = makeFormat (\n -> pack (showGFloat (Just 6) n ""))
|
|||
s :: Format r (Text -> r)
|
||||
s = makeFormat id
|
||||
|
||||
{-| `Format` a `Filesystem.Path.CurrentOS.FilePath` into `Text`
|
||||
|
||||
>>> import Filesystem.Path.CurrentOS((</>))
|
||||
>>> format fp ("usr" </> "lib")
|
||||
"usr/lib"
|
||||
-}
|
||||
fp :: Format r (FilePath -> r)
|
||||
fp = makeFormat (\fpath -> either id id (toText fpath))
|
||||
|
||||
{-| Convert a `Show`able value to `Text`
|
||||
|
||||
Short-hand for @(format w)@
|
||||
|
@ -187,11 +196,5 @@ s = makeFormat id
|
|||
>>> repr (1,2)
|
||||
"(1,2)"
|
||||
-}
|
||||
|
||||
{-| `Format` a `Filesystem.Path.CurrentOS` into `Text`
|
||||
-}
|
||||
fp :: Format r (FilePath -> r)
|
||||
fp = makeFormat (\fpath -> either id id (toText fpath))
|
||||
|
||||
repr :: Show a => a -> Text
|
||||
repr = format w
|
||||
|
|
Loading…
Reference in a new issue