cdornan / fmt

New formatting library
BSD 3-Clause "New" or "Revised" License
56 stars 6 forks source link

Examples from docs don't work #32

Closed jwatte closed 3 years ago

jwatte commented 4 years ago

Somehow the String -> Builder machinery doesn't work:

$ cabal v2-repl all
...
*Load> import Fmt
*Load Fmt> "foo " +| 3 |+ "\n"

<interactive>:2:1: error:
    • Couldn't match expected type ‘Builder’ with actual type ‘[Char]’
    • In the first argument of ‘(+|)’, namely ‘"foo "’
      In the expression: "foo " +| 3 |+ "\n"
      In an equation for ‘it’: it = "foo " +| 3 |+ "\n"

Here's what Cabal had to say when I added fmt to my dependency packages:

Starting     fmt-0.6.1.2 (lib)
Building     fmt-0.6.1.2 (lib)
Installing   fmt-0.6.1.2 (lib)
Completed    fmt-0.6.1.2 (lib)
jwatte commented 4 years ago

Oh, wait! I just saw that I need OverloadedStrings. That was apparently not clearly enough put front-and-center in the docs, so maybe turn this bug report into a documentation bug report? Also, leaving this issue here so that the Googles can find it if someone else misses this requirement and gets the same error.

cdornan commented 3 years ago

I have reviewed the Haddocks and the instruction to user OverloadedStrings is the very first thing right at the top of the the documentation in a dedicated clearly-labeled &section mdash; it is difficult to make it more prominent. Please repopen if you have a suggestion as to how we can do better.