{-# LANGUAGE GADTs #-}
module TypeMachine.Log (
TypeMachineLog,
fieldNotInType,
emptyResultType,
fieldNotOptional,
duplicateKey,
noTypeParameter,
formatLog,
) where
type TypeMachineLog = String
formatLog :: TypeMachineLog -> String
formatLog :: TypeMachineLog -> TypeMachineLog
formatLog = TypeMachineLog -> TypeMachineLog -> TypeMachineLog
forall a. [a] -> [a] -> [a]
(++) TypeMachineLog
"TypeMachine: "
fieldNotInType :: String -> TypeMachineLog
fieldNotInType :: TypeMachineLog -> TypeMachineLog
fieldNotInType TypeMachineLog
f = TypeMachineLog
"Field '" TypeMachineLog -> TypeMachineLog -> TypeMachineLog
forall a. [a] -> [a] -> [a]
++ TypeMachineLog
f TypeMachineLog -> TypeMachineLog -> TypeMachineLog
forall a. [a] -> [a] -> [a]
++ TypeMachineLog
"' not in type."
emptyResultType :: TypeMachineLog
emptyResultType :: TypeMachineLog
emptyResultType = TypeMachineLog
"Result type is empty."
fieldNotOptional :: String -> TypeMachineLog
fieldNotOptional :: TypeMachineLog -> TypeMachineLog
fieldNotOptional TypeMachineLog
f = TypeMachineLog
"Field '" TypeMachineLog -> TypeMachineLog -> TypeMachineLog
forall a. [a] -> [a] -> [a]
++ TypeMachineLog
f TypeMachineLog -> TypeMachineLog -> TypeMachineLog
forall a. [a] -> [a] -> [a]
++ TypeMachineLog
"' is not optional."
noTypeParameter :: TypeMachineLog
noTypeParameter :: TypeMachineLog
noTypeParameter = TypeMachineLog
"There are no type parameters in this type."
duplicateKey :: TypeMachineLog
duplicateKey :: TypeMachineLog
duplicateKey = TypeMachineLog
"Some keys are duplicated."