<commit_before>
module Paper.Haskell2.Stage2(stage2) where

import Data.Char
import Data.List
import Paper.Util.String
import Paper.Haskell2.Type


stage2 :: [HsLow] -> [HsItem]
stage2 = concatMap f
    where
        f (HsDef pos x) | "instance " `isPrefixOf` x 
                        || "import " `isPrefixOf` x  = [HsItem Stmt pos x Always]
                        | null x = []

        f (HsCheck pos expr cmd x) | cmd == "ignore" = []
                                   | otherwise = [HsItem typ pos x $ parseWhere files]<commit_msg>Nub the items, so you get less to test<commit_after>
module Paper.Haskell2.Stage2(stage2) where

import Data.Char
import Data.List
import Paper.Util.String
import Paper.Haskell2.Type


stage2 :: [HsLow] -> [HsItem]
stage2 = concatMap f . nub
    where
        f (HsDef pos x) | "instance " `isPrefixOf` x 
                        || "import " `isPrefixOf` x  = [HsItem Stmt pos x Always]
                        | null x = []

        f (HsCheck pos expr cmd x) | cmd == "ignore" = []
                                   | otherwise = [HsItem typ pos x $ parseWhere files]
{'fraction_non_alphanumeric': 0.10441044104410441, 'fraction_numerical': 0.010801080108010801, 'mean_word_length': 1.8958333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3793586', 'n_tokens_mistral': 361, 'n_tokens_neox': 332, 'n_words': 110}