<commit_before>
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}

-- | This module contains the functions related to @Error@ type,
-- in particular, to @tidyError@ using a solution, and @pprint@ errors.

module Language.Haskell.Liquid.UX.Errors (tidyError, panic) where

import           Control.Arrow                       (second)
import           Control.Exception                   (Exception (..))
import           Data.Aeson
import           Data.Generics                       (everywhere, mkT)
import qualified Data.HashMap.Strict                 as M
import qualified Data.HashSet                        as S
import           Data.Hashable
import           Data.List                           (intersperse)
import           Data.Maybe                          (fromMaybe, maybeToList)
import           Language.Fixpoint.Misc              (dcolon)
import           Language.Fixpoint.Types             hiding (Error, SrcSpan, shiftVV)
import           Language.Haskell.Liquid.UX.PrettyPrint
import           Language.Haskell.Liquid.Types.RefType
import           Language.Haskell.Liquid.Transforms.Simplify
import           Language.Haskell.Liquid.UX.Tidy
import           Language.Haskell.Liquid.Types
import           Language.Haskell.Liquid.Misc        (single)
import           SrcLoc                              (SrcSpan)<commit_msg>tidy contexts before printing errors<commit_after>
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}

-- | This module contains the functions related to @Error@ type,
-- in particular, to @tidyError@ using a solution, and @pprint@ errors.

module Language.Haskell.Liquid.UX.Errors (
  -- * Cleanup an `Error` 
    tidyError

  -- * Die, with grace 
  , panic
  , panicError
  ) where

import           Control.Arrow                       (second)
import           Control.Exception                   (Exception (..))
import           Data.Aeson
import           Data.Generics                       (everywhere, mkT)
import qualified Data.HashMap.Strict                 as M
import qualified Data.HashSet                        as S
import           Data.Hashable
import           Data.List                           (intersperse)
import           Data.Maybe                          (fromMaybe, maybeToList)
import           Language.Fixpoint.Misc              (dcolon)
import           Language.Fixpoint.Types             hiding (Error, SrcSpan, shiftVV)
import           Language.Haskell.Liquid.UX.PrettyPrint
import           Language.Haskell.Liquid.Types.RefType
import           Language.Haskell.Liquid.Transforms.Simplify
import           Language.Haskell.Liquid.UX.Tidy
import           Language.Haskell.Liquid.Types
import           Language.Haskell.Liquid.Misc        (single)
import           SrcLoc                              (SrcSpan)
{'fraction_non_alphanumeric': 0.07336860670194004, 'fraction_numerical': 0.0, 'mean_word_length': 1.6283595922150138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2126345', 'n_tokens_mistral': 759, 'n_tokens_neox': 721, 'n_words': 180}