<commit_before>{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase        #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports    #-}
{-# LANGUAGE RecordWildCards   #-}

-- |
-- Module      : Network.AWS.Data.ByteString
-- Copyright   : (c) 2013-2015 <NAME>
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : <NAME> <<EMAIL>>
-- Stability   : provisional
-- Portability : non-portable (GHC extensions)

--
module Network.AWS.Data.ByteString
    (
    -- * ByteString
      ByteString
    , LazyByteString
    , ToByteString (..)
    , showBS
    , stripBS
    ) where

import           Data.ByteString              (ByteString)
import           Data.ByteString.Builder      (Builder)
import qualified Data.ByteString.Char8        as BS8
import qualified Data.ByteString.Lazy         as LBS
import qualified Data.ByteString.Lazy.Builder as Build
import           Data.CaseInsensitive         (CI)
import qualified Data.CaseInsensitive         as CI
import           Data.Char
import qualified Data.Text.Encoding           as Text
import           Data.Time                    (UTCTime)
import           Network.AWS.Data.Crypto
import           Network.AWS.Data.Text
import           Network.HTTP.Types
import           Numeric
import           Numeric.Natural

import           Prelude

type LazyByteString = LBS.ByteString

showBS :: ToByteString a => a -> String
showBS = BS8.unpack . toBS

stripBS :: ByteString -> ByteString
stripBS = BS8.dropWhile isSpace . fst . BS8.spanEnd isSpace

class ToByteString a where
    toBS :: a -> ByteString

    default toBS :: ToText a => a -> ByteString
    toBS = Text.encodeUtf8 . toText<commit_msg>Removing unused import<commit_after>{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase        #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports    #-}
{-# LANGUAGE RecordWildCards   #-}

-- |
-- Module      : Network.AWS.Data.ByteString
-- Copyright   : (c) 2013-2015 <NAME>
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : <NAME> <<EMAIL>>
-- Stability   : provisional
-- Portability : non-portable (GHC extensions)

--
module Network.AWS.Data.ByteString
    (
    -- * ByteString
      ByteString
    , LazyByteString
    , ToByteString (..)
    , showBS
    , stripBS
    ) where

import           Data.ByteString              (ByteString)
import           Data.ByteString.Builder      (Builder)
import qualified Data.ByteString.Char8        as BS8
import qualified Data.ByteString.Lazy         as LBS
import qualified Data.ByteString.Lazy.Builder as Build
import           Data.CaseInsensitive         (CI)
import qualified Data.CaseInsensitive         as CI
import           Data.Char
import qualified Data.Text.Encoding           as Text
import           Data.Time                    (UTCTime)
import           Network.AWS.Data.Text
import           Network.HTTP.Types
import           Numeric
import           Numeric.Natural

import           Prelude

type LazyByteString = LBS.ByteString

showBS :: ToByteString a => a -> String
showBS = BS8.unpack . toBS

stripBS :: ByteString -> ByteString
stripBS = BS8.dropWhile isSpace . fst . BS8.spanEnd isSpace

class ToByteString a where
    toBS :: a -> ByteString

    default toBS :: ToText a => a -> ByteString
    toBS = Text.encodeUtf8 . toText
{'fraction_non_alphanumeric': 0.09646017699115045, 'fraction_numerical': 0.00943952802359882, 'mean_word_length': 2.223384030418251, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '6424849', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1019, 'n_words': 259}