typechecking things
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Data.Pretty
|
||||
( Pretty(..)
|
||||
, rpretty
|
||||
, ttext
|
||||
-- * Pretty-printing lens combinators
|
||||
, hsepOf, vsepOf
|
||||
@@ -12,6 +13,7 @@ module Data.Pretty
|
||||
----------------------------------------------------------------------------------
|
||||
import Text.PrettyPrint hiding ((<>))
|
||||
import Text.PrettyPrint.HughesPJ hiding ((<>))
|
||||
import Text.Printf
|
||||
import Data.String (IsString(..))
|
||||
import Data.Text.Lens
|
||||
import Data.Monoid
|
||||
@@ -27,6 +29,9 @@ class Pretty a where
|
||||
pretty = prettyPrec 0
|
||||
prettyPrec a _ = pretty a
|
||||
|
||||
rpretty :: (IsString s, Pretty a) => a -> s
|
||||
rpretty = fromString . render . pretty
|
||||
|
||||
instance Pretty String where
|
||||
pretty = Text.PrettyPrint.text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user