From 57ee32cc9c9079a9f3574d433f4e8ba0d4a2307c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 9 Oct 2017 22:42:02 +0200 Subject: [PATCH] Instances for Rating --- src/Handler/Utils/Zip/Rating.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Handler/Utils/Zip/Rating.hs b/src/Handler/Utils/Zip/Rating.hs index 79ef3775e..6837fccfd 100644 --- a/src/Handler/Utils/Zip/Rating.hs +++ b/src/Handler/Utils/Zip/Rating.hs @@ -4,6 +4,7 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DeriveGeneric, DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} @@ -30,6 +31,9 @@ import qualified Data.ByteString.Lazy as Lazy (ByteString) import Text.Read (readEither) +import GHC.Generics (Generic) +import Data.Typeable (Typeable) + instance HasResolution prec => Pretty (Fixed prec) where pretty = pretty . show @@ -41,8 +45,7 @@ data Rating = Rating , ratingSubmissionId :: SubmissionId , ratingComment :: Maybe Text , ratingPoints :: Maybe Points - } - + } deriving (Read, Show, Eq, Generic, Typeable) getRating :: SubmissionId -> YesodDB UniWorX (Maybe Rating)