<commit_before>definition module Cloogle

from StdOverloaded import class zero, class fromString, class toString, class <

from Data.Maybe import :: Maybe
from Text.JSON import generic JSONEncode, generic JSONDecode, :: JSONNode

:: Request
	= { unify            :: Maybe String
	  , name             :: Maybe String
	  , className        :: Maybe String
	  , typeName         :: Maybe String
	  , modules          :: Maybe [String]
	  , libraries        :: Maybe [String]
	  , include_builtins :: Maybe Bool
	  , include_core     :: Maybe Bool
	  , page             :: Maybe Int
	  }

:: Response
	= { return         :: Int
	  , data           :: [Result]
	  , msg            :: String
	  , more_available :: Maybe Int
	  , suggestions    :: Maybe [(Request, Int)]
	  }

:: Result
	= FunctionResult FunctionResult
	| TypeResult TypeResult
	| ClassResult ClassResult
	| MacroResult MacroResult
	| ModuleResult ModuleResult

:: BasicResult
	= { library  :: String
	  , filename :: String
	  , modul    :: String
	  , dcl_line :: Maybe Int
	  , icl_line :: Maybe Int
	  , distance :: Int
	  , builtin  :: Maybe Bool
	  }

:: FunctionResult :== (BasicResult, FunctionResultExtras)
:: FunctionResultExtras
	= { func                :: String
	  , unifier             :: Maybe StrUnifier
	  , cls                 :: Maybe ShortClassResult
	  , constructor_of      :: Maybe String
	  , recordfield_of      :: Maybe String
	  , generic_derivations :: Maybe [(String, [LocationResult])]
	  }

:: TypeResult :== (BasicResult, TypeResultExtras)
:: TypeResultExtras
	= { type             :: String
	  , type_instances   :: [(String, [String], [LocationResult])]
	  , type_derivations :: [(String, [LocationResult])]
	  }

:: ClassResult :== (BasicResult, ClassResultExtras)
:: ClassResultExtras
	= { class_name      :: String
	  , class_heading   :: String
	  , class_funs      :: [String]
	  , class_instances :: [([String], [LocationResult])]
	  }

:: MacroResult :== (BasicResult, MacroResultExtras)
:: MacroResultExtras
	= { macro_name           :: String
	  , macro_representation :: String
	  }

:: ModuleResult :== (BasicResult, ModuleResultExtras)
:: ModuleResultExtras
	= { module_is_core :: Bool
	  }

:: LocationResult :== (String, String, Maybe Int, Maybe Int)

:: StrUnifier :== ([(String,String)], [(String,String)])

:: ErrorResult = MaybeError Int String

:: ShortClassResult = { cls_name :: String, cls_vars :: [String] }

derive JSONEncode Request, Response, Result, ShortClassResult, BasicResult,
	FunctionResultExtras, TypeResultExtras, ClassResultExtras,
	MacroResultExtras, ModuleResultExtras
derive JSONDecode Request, Response, Result, ShortClassResult, BasicResult,
	FunctionResultExtras, TypeResultExtras, ClassResultExtras,
	MacroResultExtras, ModuleResultExtras

instance zero Request
instance zero Response

instance toString Request
instance toString Response<commit_msg>Remove unused code<commit_after>definition module Cloogle

from StdOverloaded import class zero, class fromString, class toString, class <

from Data.Maybe import :: Maybe
from Text.JSON import generic JSONEncode, generic JSONDecode, :: JSONNode

:: Request
	= { unify            :: Maybe String
	  , name             :: Maybe String
	  , className        :: Maybe String
	  , typeName         :: Maybe String
	  , modules          :: Maybe [String]
	  , libraries        :: Maybe [String]
	  , include_builtins :: Maybe Bool
	  , include_core     :: Maybe Bool
	  , page             :: Maybe Int
	  }

:: Response
	= { return         :: Int
	  , data           :: [Result]
	  , msg            :: String
	  , more_available :: Maybe Int
	  , suggestions    :: Maybe [(Request, Int)]
	  }

:: Result
	= FunctionResult FunctionResult
	| TypeResult TypeResult
	| ClassResult ClassResult
	| MacroResult MacroResult
	| ModuleResult ModuleResult

:: BasicResult
	= { library  :: String
	  , filename :: String
	  , modul    :: String
	  , dcl_line :: Maybe Int
	  , icl_line :: Maybe Int
	  , distance :: Int
	  , builtin  :: Maybe Bool
	  }

:: FunctionResult :== (BasicResult, FunctionResultExtras)
:: FunctionResultExtras
	= { func                :: String
	  , unifier             :: Maybe StrUnifier
	  , cls                 :: Maybe ShortClassResult
	  , constructor_of      :: Maybe String
	  , recordfield_of      :: Maybe String
	  , generic_derivations :: Maybe [(String, [LocationResult])]
	  }

:: TypeResult :== (BasicResult, TypeResultExtras)
:: TypeResultExtras
	= { type             :: String
	  , type_instances   :: [(String, [String], [LocationResult])]
	  , type_derivations :: [(String, [LocationResult])]
	  }

:: ClassResult :== (BasicResult, ClassResultExtras)
:: ClassResultExtras
	= { class_name      :: String
	  , class_heading   :: String
	  , class_funs      :: [String]
	  , class_instances :: [([String], [LocationResult])]
	  }

:: MacroResult :== (BasicResult, MacroResultExtras)
:: MacroResultExtras
	= { macro_name           :: String
	  , macro_representation :: String
	  }

:: ModuleResult :== (BasicResult, ModuleResultExtras)
:: ModuleResultExtras
	= { module_is_core :: Bool
	  }

:: LocationResult :== (String, String, Maybe Int, Maybe Int)

:: StrUnifier :== ([(String,String)], [(String,String)])

:: ShortClassResult = { cls_name :: String, cls_vars :: [String] }

derive JSONEncode Request, Response, Result, ShortClassResult, BasicResult,
	FunctionResultExtras, TypeResultExtras, ClassResultExtras,
	MacroResultExtras, ModuleResultExtras
derive JSONDecode Request, Response, Result, ShortClassResult, BasicResult,
	FunctionResultExtras, TypeResultExtras, ClassResultExtras,
	MacroResultExtras, ModuleResultExtras

instance zero Request
instance zero Response

instance toString Request
instance toString Response
{'fraction_non_alphanumeric': 0.10813163851645481, 'fraction_numerical': 0.0, 'mean_word_length': 3.20497803806735, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2837886', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1614, 'n_words': 423}