<commit_before>{-# OPTIONS_GHC -Wall #-}
module Reporting.Error.Type where

--import Data.Aeson ((.=))
import qualified Data.Aeson as Json

import qualified AST.Type as T
import qualified Reporting.Region as R


data Error
    = Mismatch Mismatch
    | InfiniteType R.Region
    | BadMain T.Canonical
    | ProblemWithInferenceAlgorithm String


data Mismatch = MismatchInfo
    { hint :: Maybe String
    , leftType :: T.Canonical
    , rightType :: T.Canonical
    }


-- TO STRING

toString :: R.Region -> Error -> String
toString region err =
  case err of
    _ -> error "Type.toString" region


-- TO JSON

toJson :: Error -> Json.Value
toJson err =
  case err of
    _ -> error "Type.toJson"

<commit_msg>Get rid of unused type error case<commit_after>{-# OPTIONS_GHC -Wall #-}
module Reporting.Error.Type where

--import Data.Aeson ((.=))
import qualified Data.Aeson as Json

import qualified AST.Type as T
import qualified Reporting.Region as R


data Error
    = Mismatch Mismatch
    | InfiniteType R.Region
    | BadMain T.Canonical


data Mismatch = MismatchInfo
    { hint :: Maybe String
    , leftType :: T.Canonical
    , rightType :: T.Canonical
    }


-- TO STRING

toString :: R.Region -> Error -> String
toString region err =
  case err of
    _ -> error "Type.toString" region


-- TO JSON

toJson :: Error -> Json.Value
toJson err =
  case err of
    _ -> error "Type.toJson"


{'fraction_non_alphanumeric': 0.1006423982869379, 'fraction_numerical': 0.0, 'mean_word_length': 2.830601092896175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7432078', 'n_tokens_mistral': 464, 'n_tokens_neox': 440, 'n_words': 144}