<commit_before>{-# LANGUAGE NoImplicitPrelude #-}
module FOL.Language.Pretty
    ( Pretty
    , pp
    , real
    , pprint
    , sepMap
    , ppList
    , symbol
    , ppForm
    , module Text.PrettyPrint
    )
    where

import FOL.Language.Common

import Data.Char

import Text.PrettyPrint

class Pretty a where
    pp :: a -> Doc

real :: Real -> Doc
real = double

pprint :: Pretty a => a -> String
pprint = render . pp

sepMap :: (a -> Doc) -> [a] -> Doc
sepMap f = sep . map f

ppList :: [Doc] -> Doc
ppList = parens . sep

symbol :: String -> Doc
symbol s = text (map toUpper s)

ppForm :: Pretty a => String -> [a] -> Doc
ppForm name xs = ppList $ symbol name : map pp xs
<commit_msg>Print symbols in low case letters.<commit_after>{-# LANGUAGE NoImplicitPrelude #-}
module FOL.Language.Pretty
    ( Pretty
    , pp
    , real
    , pprint
    , sepMap
    , ppList
    , symbol
    , ppForm
    , module Text.PrettyPrint
    )
    where

import FOL.Language.Common

import Text.PrettyPrint

class Pretty a where
    pp :: a -> Doc

real :: Real -> Doc
real = double

pprint :: Pretty a => a -> String
pprint = render . pp

sepMap :: (a -> Doc) -> [a] -> Doc
sepMap f = sep . map f

ppList :: [Doc] -> Doc
ppList = parens . sep

symbol :: String -> Doc
symbol = text

ppForm :: Pretty a => String -> [a] -> Doc
ppForm name xs = ppList $ symbol name : map pp xs

{'fraction_non_alphanumeric': 0.12271731190650109, 'fraction_numerical': 0.0, 'mean_word_length': 2.382716049382716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4181309', 'n_tokens_mistral': 481, 'n_tokens_neox': 470, 'n_words': 163}