<commit_before>{-# OPTIONS_GHC -fno-warn-orphans #-}

module HsToCoq.PrettyPrint (
  -- * The base module
  module Text.PrettyPrint.Leijen.Text,
  -- * Don't use operators with existing meanings
  (<>), (<!>),
  -- * Lazy 'TL.Text' to strict 'Text'
  text, lazyText, string, lazyString,
  -- * '[]' -> 'Foldable'
  encloseSep,
  list, tupled, semiBraces,
  hsep, vsep, fillSep, sep,
  hcat, vcat, fillCat, cat,
  punctuate,
  -- * Utility functions
  -- ** Nicely smushing lists together
  sepWith, spacedSepPre, spacedSepPost,
  -- ** Dealing with possibly-empty documents
  (</?>), docIf, spaceIf, lineIf, softlineIf,
  -- * Rendering
  renderOneLineT
  ) where

import Text.PrettyPrint.Leijen.Text hiding ( (<>), (<$>)
                                           , text
                                           , string
                                           , encloseSep
                                           , list
                                           , tupled
                                           , semiBraces
                                           , hsep
                                           , vsep
                                           , fillSep
                                           , sep
                                           , hcat
                                           , vcat
                                           , fillCat
                                           , cat
                                           , punctuate )
import qualified Text.PrettyPrint.Leijen.Text as T
import Data.Text (Text)
import qualified Data.Text.Lazy as TL
import Data.Semigroup (Semigroup(..))
import Data.Foldable

instance Semigroup Doc where
  (<>) = (T.<>)

(<!>) :: Doc -> Doc -> Doc
(<!>) = (T.<$>)
infixr 5 <!>
{-# INLINABLE (<!>) #-}

text :: Text -> Doc
text = T.text . TL.fromStrict<commit_msg>[core-coq] Update for new pretty printer version<commit_after>module HsToCoq.PrettyPrint (
  -- * The base module
  module Text.PrettyPrint.Leijen.Text,
  -- * Don't use operators with existing meanings
  (<>), (<!>),
  -- * Lazy 'TL.Text' to strict 'Text'
  text, lazyText, string, lazyString,
  -- * '[]' -> 'Foldable'
  encloseSep,
  list, tupled, semiBraces,
  hsep, vsep, fillSep, sep,
  hcat, vcat, fillCat, cat,
  punctuate,
  -- * Utility functions
  -- ** Nicely smushing lists together
  sepWith, spacedSepPre, spacedSepPost,
  -- ** Dealing with possibly-empty documents
  (</?>), docIf, spaceIf, lineIf, softlineIf,
  -- * Rendering
  renderOneLineT
  ) where

import Text.PrettyPrint.Leijen.Text hiding ( (<>), (<$>)
                                           , text
                                           , string
                                           , encloseSep
                                           , list
                                           , tupled
                                           , semiBraces
                                           , hsep
                                           , vsep
                                           , fillSep
                                           , sep
                                           , hcat
                                           , vcat
                                           , fillCat
                                           , cat
                                           , punctuate )
import qualified Text.PrettyPrint.Leijen.Text as T
import Data.Text (Text)
import qualified Data.Text.Lazy as TL
import Data.Semigroup (Semigroup(..))
import Data.Foldable

(<!>) :: Doc -> Doc -> Doc
(<!>) = (T.<$>)
infixr 5 <!>
{-# INLINABLE (<!>) #-}

text :: Text -> Doc
text = T.text . TL.fromStrict
{'fraction_non_alphanumeric': 0.10626702997275204, 'fraction_numerical': 0.0005449591280653951, 'mean_word_length': 1.0203632361034674, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 60, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7544768', 'n_tokens_mistral': 917, 'n_tokens_neox': 876, 'n_words': 223}