<commit_before>{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}

module HSE.FreeVars(FreeVars, freeVars, vars, varss, pvars, declBind) where

import HSE.Type
import Data.Monoid
import qualified Data.Set as Set
import Data.Set(Set)


-- which names are bound by a declaration
declBind :: Decl_ -> [String]
declBind x = pvars x

vars x = Set.toList $ freeVars x

varss x = Set.toList $ free $ allVars x

pvars x = Set.toList $ bound $ allVars x


(^+) = Set.union
(^-) = Set.difference<commit_msg>Avoid Alt ambiguity on base-4.8.0.0 and above<commit_after>{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}

module HSE.FreeVars(FreeVars, freeVars, vars, varss, pvars, declBind) where

import HSE.Type
import Data.Monoid (Monoid(..))
import qualified Data.Set as Set
import Data.Set(Set)


-- which names are bound by a declaration
declBind :: Decl_ -> [String]
declBind x = pvars x

vars x = Set.toList $ freeVars x

varss x = Set.toList $ free $ allVars x

pvars x = Set.toList $ bound $ allVars x


(^+) = Set.union
(^-) = Set.difference
{'fraction_non_alphanumeric': 0.11607992388201713, 'fraction_numerical': 0.003805899143672693, 'mean_word_length': 4.0576923076923075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1734952', 'n_tokens_mistral': 379, 'n_tokens_neox': 379, 'n_words': 118}