module Clash.Pretty where
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.String
showDoc :: Doc ann -> String
showDoc :: Doc ann -> String
showDoc = SimpleDocStream ann -> String
forall ann. SimpleDocStream ann -> String
renderString (SimpleDocStream ann -> String)
-> (Doc ann -> SimpleDocStream ann) -> Doc ann -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LayoutOptions -> Doc ann -> SimpleDocStream ann
forall ann. LayoutOptions -> Doc ann -> SimpleDocStream ann
layoutPretty (PageWidth -> LayoutOptions
LayoutOptions (Int -> Double -> PageWidth
AvailablePerLine 80 0.6))
removeAnnotations :: Doc ann -> Doc ()
removeAnnotations :: Doc ann -> Doc ()
removeAnnotations = (ann -> ()) -> Doc ann -> Doc ()
forall ann ann'. (ann -> ann') -> Doc ann -> Doc ann'
reAnnotate ((ann -> ()) -> Doc ann -> Doc ())
-> (ann -> ()) -> Doc ann -> Doc ()
forall a b. (a -> b) -> a -> b
$ () -> ann -> ()
forall a b. a -> b -> a
const ()
class ClashPretty a where
clashPretty :: a -> Doc ()
fromPretty :: Pretty a => a -> Doc ()
fromPretty :: a -> Doc ()
fromPretty = Doc Any -> Doc ()
forall ann. Doc ann -> Doc ()
removeAnnotations (Doc Any -> Doc ()) -> (a -> Doc Any) -> a -> Doc ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Doc Any
forall a ann. Pretty a => a -> Doc ann
pretty