From 0d630077eb12de84f9c7ab8402524d4069535d96 Mon Sep 17 00:00:00 2001 From: Montmorency Date: Mon, 5 Sep 2022 12:20:59 +0100 Subject: [PATCH] added deepseq constraint on Enum so that paramList works as expected. --- IHP/SchemaCompiler.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IHP/SchemaCompiler.hs b/IHP/SchemaCompiler.hs index 0a4896545..4c137d1e7 100644 --- a/IHP/SchemaCompiler.hs +++ b/IHP/SchemaCompiler.hs @@ -142,6 +142,7 @@ compileTypes options schema@(Schema statements) = <> "import qualified Database.PostgreSQL.Simple.Types\n" <> "import IHP.Job.Types\n" <> "import IHP.Job.Queue ()\n" + <> "import qualified Control.DeepSeq as DeepSeq\n" <> "import qualified Data.Dynamic\n" <> "import Data.Scientific\n" @@ -339,6 +340,7 @@ compileEnumDataDefinitions enum@(CreateEnumType { name, values }) = <> "instance Default " <> modelName <> " where def = " <> enumValueToConstructorName (unsafeHead values) <> "\n" <> "instance ToField " <> modelName <> " where\n" <> indent (unlines (map compileToFieldInstanceForValue values)) <> "instance InputValue " <> modelName <> " where\n" <> indent (unlines (map compileInputValue values)) <> "\n" + <> "instance DeepSeq.NFData " <> modelName <> " where\n" <> indent ("rnf a = ()") <> "\n" <> "instance IHP.Controller.Param.ParamReader " <> modelName <> " where readParameter = IHP.Controller.Param.enumParamReader; readParameterJSON = IHP.Controller.Param.enumParamReaderJSON\n" where modelName = tableNameToModelName name