<commit_before>\begin{code}
{-# OPTIONS -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.Pack
-- Copyright   :  (c) The University of Glasgow 1997-2002
-- License     :  see libraries/base/LICENSE
-- 
-- Maintainer  :  <EMAIL>
-- Stability   :  internal
-- Portability :  non-portable (GHC Extensions)
--
-- This module provides a small set of low-level functions for packing
-- and unpacking a chunk of bytes. Used by code emitted by the compiler
-- plus the prelude libraries.
-- 
-- The programmer level view of packed strings is provided by a GHC
-- system library PackedString.
--
-----------------------------------------------------------------------------

module GHC.Pack
       (
	-- (**) - emitted by compiler.

	packCString#,      -- :: [Char] -> ByteArray#    **
	unpackCString,
	unpackCString#,    -- :: Addr# -> [Char]	 **
	unpackNBytes#,     -- :: Addr# -> Int# -> [Char] **
	unpackFoldrCString#,  -- **
	unpackAppendCString#,  -- **
       ) 
	where

import GHC.Base
import {-# SOURCE #-} GHC.Err ( error )
import GHC.List ( length )
import GHC.ST
import GHC.Num
import GHC.Ptr

data ByteArray ix      	       = ByteArray	  ix ix ByteArray#
data MutableByteArray s ix     = MutableByteArray ix ix (MutableByteArray# s)

unpackCString :: Ptr a -> [Char]
unpackCString a@(Ptr addr)
  | a == nullPtr  = []
  | otherwise	   = unpackCString# addr

packCString#	     :: [Char]          -> ByteArray#<commit_msg>[project @ 2002-05-09 13:05:46 by simonmar] Fix comments that are misinterpreted by Haddock<commit_after>\begin{code}
{-# OPTIONS -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.Pack
-- Copyright   :  (c) The University of Glasgow 1997-2002
-- License     :  see libraries/base/LICENSE
-- 
-- Maintainer  :  <EMAIL>
-- Stability   :  internal
-- Portability :  non-portable (GHC Extensions)
--
-- This module provides a small set of low-level functions for packing
-- and unpacking a chunk of bytes. Used by code emitted by the compiler
-- plus the prelude libraries.
-- 
-- The programmer level view of packed strings is provided by a GHC
-- system library PackedString.
--
-----------------------------------------------------------------------------

module GHC.Pack
       (
	-- (**) - emitted by compiler.

	packCString#,      -- :: [Char] -> ByteArray#    (**)
	unpackCString,
	unpackCString#,    -- :: Addr# -> [Char]	 (**)
	unpackNBytes#,     -- :: Addr# -> Int# -> [Char] (**)
	unpackFoldrCString#,  -- (**)
	unpackAppendCString#,  -- (**)
       ) 
	where

import GHC.Base
import {-# SOURCE #-} GHC.Err ( error )
import GHC.List ( length )
import GHC.ST
import GHC.Num
import GHC.Ptr

data ByteArray ix      	       = ByteArray	  ix ix ByteArray#
data MutableByteArray s ix     = MutableByteArray ix ix (MutableByteArray# s)

unpackCString :: Ptr a -> [Char]
unpackCString a@(Ptr addr)
  | a == nullPtr  = []
  | otherwise	   = unpackCString# addr

packCString#	     :: [Char]          -> ByteArray#
{'fraction_non_alphanumeric': 0.22319121447028423, 'fraction_numerical': 0.009689922480620155, 'mean_word_length': 1.8438934802571165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '4122306', 'n_tokens_mistral': 1012, 'n_tokens_neox': 944, 'n_words': 272}