Formatting for FAQ.

This commit is contained in:
Stephen Diehl
2016-07-02 17:27:40 -04:00
parent 6b6f8967ac
commit 827c0ef87b
+5 -5
View File
@@ -88,8 +88,8 @@ tracks Stack LTS resolver.
FAQs FAQs
---- ----
* My ``putStrLn`` and ``putStr`` instances are no longer inferred in the presense * **My ``putStrLn`` and ``putStr`` instances are no longer inferred in the presense
of the ``-XOverloadedStrings`` extension? of the ``-XOverloadedStrings`` extension?**
Because the print functions are polymorphic the type of the print functions may Because the print functions are polymorphic the type of the print functions may
require annotations if the type is not fully specified by inference. To force a require annotations if the type is not fully specified by inference. To force a
@@ -100,7 +100,7 @@ putText :: MonadIO m => T.Text -> m ()
putLText :: MonadIO m => TL.Text -> m () putLText :: MonadIO m => TL.Text -> m ()
``` ```
* How do I write manual Show instances if ``show`` isn't provided? * **How do I write manual Show instances if ``show`` isn't provided?**
Generally speaking writing manual instances of Show is a [Haskell antipattern]( Generally speaking writing manual instances of Show is a [Haskell antipattern](
http://www.stephendiehl.com/posts/strings.html) because it produces http://www.stephendiehl.com/posts/strings.html) because it produces
@@ -114,8 +114,8 @@ manually.
import GHC.Show (Show(..)) import GHC.Show (Show(..))
``` ```
* Partial functions like ``undefined`` and ``error`` raise compiler warnings on * **Partial functions like ``undefined`` and ``error`` raise compiler warnings on
usage. usage.**
This is by design. For fatal uncatchable errors use the provided ``panic`` This is by design. For fatal uncatchable errors use the provided ``panic``
function if you intend the program to immediately abort. function if you intend the program to immediately abort.