<commit_before>import "hint" HLint.Default
import "hint" HLint.Builtin.All

-- Naming can be useful
ignore "Avoid lambda"
ignore "Redundant lambda"
ignore "Eta reduce"
ignore "Use camelCase"
ignore "Use fromMaybe"
ignore "Use if"
ignore "Use const"
ignore "Use uncurry"

-- AMP fallout
error "generalize mapM"  = mapM  ==> traverse
error "generalize mapM_" = mapM_ ==> traverse_
error "generalize forM"  = forM  ==> for
error "generalize forM_" = forM_ ==> for_
error "Avoid return" =
    return ==> pure
    where note = "return is obsolete as of GHC 7.10"

error "Use parentheses instead of ($)" = f $ x ==> ()<commit_msg>Comment on HLint config<commit_after>import "hint" HLint.Default
import "hint" HLint.Builtin.All

-- Avoiding lambdas is not always a good idea if you keep in mind that GHC's
-- inliner will only consider fully applied functions.
ignore "Avoid lambda"

-- Naming can be useful
ignore "Eta reduce"
ignore "Redundant lambda"
ignore "Use const"

-- Sometimes, it can make code more readable if underscores are allowed as a
-- form of a "large" separator. For example, one might give all tests the prefix
-- "test_", followed by a camel-case test name.
ignore "Use camelCase"

--
ignore "Use fromMaybe"

-- I have no idea why "if" is even in Haskell. I certainly do not encourage
-- using it (over a simple "case").
ignore "Use if"

-- Obfuscation much?
ignore "Use uncurry"

-- AMP fallout
error "generalize mapM"  = mapM  ==> traverse
error "generalize mapM_" = mapM_ ==> traverse_
error "generalize forM"  = forM  ==> for
error "generalize forM_" = forM_ ==> for_
error "Avoid return" =
    return ==> pure
    where note = "return is obsolete as of GHC 7.10"

-- Avoid operator soup
error "Use parentheses instead of ($)" = f $ x ==> ()
{'fraction_non_alphanumeric': 0.10965909090909091, 'fraction_numerical': 0.003409090909090909, 'mean_word_length': 3.8781163434903045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2024044', 'n_tokens_mistral': 584, 'n_tokens_neox': 559, 'n_words': 239}