<commit_before>-----------------------------------------------------------------------------
-- |
-- Module      :  Data.FiniteMap
-- Copyright   :  (c) The University of Glasgow 2001
-- License     :  BSD-style (see the file libraries/base/LICENSE)
-- 
-- Maintainer  :  <EMAIL>
-- Stability   :  provisional
-- Portability :  portable
--
-- A finite map implementation, derived from the paper:
-- 	   /Efficient sets: a balancing act/, <NAME>,
-- 	   Journal of functional programming 3(4) Oct 1993, pp553-562
--
-----------------------------------------------------------------------------

-- ToDo: clean up, remove the COMPILING_GHC stuff.

-- The code is SPECIALIZEd to various highly-desirable types (e.g., Id)
-- near the end (only \tr{#ifdef COMPILING_GHC}).

#ifdef COMPILING_GHC
#include "HsVersions.h"
#define IF_NOT_GHC(a) {--}
#else
#define ASSERT(e) {--}
#define IF_NOT_GHC(a) a
#define COMMA ,
#define _tagCmp compare
#define _LT LT
#define _GT GT
#define _EQ EQ
#endif

#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)/* NB NB NB */
#define OUTPUTABLE_key , Outputable key
#else
#define OUTPUTABLE_key {--}
#endif

module Data.FiniteMap (
	-- * The @FiniteMap@ type
	FiniteMap,		-- abstract type

	-- * Construction
	emptyFM, unitFM, listToFM,

	-- * Lookup operations
	lookupFM, lookupWithDefaultFM,
	elemFM,

	-- * Adding elements
	addToFM,
	addToFM_C,
	addListToFM,
	addListToFM_C,

	-- * Deleting elements
	IF_NOT_GHC(delFromFM COMMA)
	delListFromFM,

	-- * Combination
	plusFM,
	plusFM_C,

	-- * Extracting information
	fmToList, keysFM, eltsFM,
	sizeFM, isEmptyFM,

	-- * Other operations
	minusFM,
	foldFM,
	IF_NOT_GHC(intersectFM COMMA)
	IF_NOT_GHC(intersectFM_C COMMA)
	IF_NOT_GHC(mapFM COMMA filterFM COMMA)

#ifdef COMPILING_GHC
	, bagToFM
#endif
    ) where

import Prelude

import Data.Maybe ( isJust )
#ifdef __GLASGOW_HASKELL__
import GHC.Base
#endif

#ifdef COMPILING_GHC
IMP_Ubiq(){-uitous-}
# ifdef DEBUG
import Pretty
# endif
import Bag	( foldBag )

# if ! OMIT_NATIVE_CODEGEN
#  define IF_NCG(a) a
# else
#  define IF_NCG(a) {--}
# endif
#endif<commit_msg>[project @ 2003-04-09 08:17:39 by simonpj] Remove redundant Prelude import<commit_after>-----------------------------------------------------------------------------
-- |
-- Module      :  Data.FiniteMap
-- Copyright   :  (c) The University of Glasgow 2001
-- License     :  BSD-style (see the file libraries/base/LICENSE)
-- 
-- Maintainer  :  <EMAIL>
-- Stability   :  provisional
-- Portability :  portable
--
-- A finite map implementation, derived from the paper:
-- 	   /Efficient sets: a balancing act/, <NAME>,
-- 	   Journal of functional programming 3(4) Oct 1993, pp553-562
--
-----------------------------------------------------------------------------

-- ToDo: clean up, remove the COMPILING_GHC stuff.

-- The code is SPECIALIZEd to various highly-desirable types (e.g., Id)
-- near the end (only \tr{#ifdef COMPILING_GHC}).

#ifdef COMPILING_GHC
#include "HsVersions.h"
#define IF_NOT_GHC(a) {--}
#else
#define ASSERT(e) {--}
#define IF_NOT_GHC(a) a
#define COMMA ,
#define _tagCmp compare
#define _LT LT
#define _GT GT
#define _EQ EQ
#endif

#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)/* NB NB NB */
#define OUTPUTABLE_key , Outputable key
#else
#define OUTPUTABLE_key {--}
#endif

module Data.FiniteMap (
	-- * The @FiniteMap@ type
	FiniteMap,		-- abstract type

	-- * Construction
	emptyFM, unitFM, listToFM,

	-- * Lookup operations
	lookupFM, lookupWithDefaultFM,
	elemFM,

	-- * Adding elements
	addToFM,
	addToFM_C,
	addListToFM,
	addListToFM_C,

	-- * Deleting elements
	IF_NOT_GHC(delFromFM COMMA)
	delListFromFM,

	-- * Combination
	plusFM,
	plusFM_C,

	-- * Extracting information
	fmToList, keysFM, eltsFM,
	sizeFM, isEmptyFM,

	-- * Other operations
	minusFM,
	foldFM,
	IF_NOT_GHC(intersectFM COMMA)
	IF_NOT_GHC(intersectFM_C COMMA)
	IF_NOT_GHC(mapFM COMMA filterFM COMMA)

#ifdef COMPILING_GHC
	, bagToFM
#endif
    ) where

import Data.Maybe ( isJust )
#ifdef __GLASGOW_HASKELL__
import GHC.Base
#endif

#ifdef COMPILING_GHC
IMP_Ubiq(){-uitous-}
# ifdef DEBUG
import Pretty
# endif
import Bag	( foldBag )

# if ! OMIT_NATIVE_CODEGEN
#  define IF_NCG(a) a
# else
#  define IF_NCG(a) {--}
# endif
#endif
{'fraction_non_alphanumeric': 0.1806831566548881, 'fraction_numerical': 0.010836277974087162, 'mean_word_length': 2.688966116420504, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '460673', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1525, 'n_words': 393}