Instances for Rating

This commit is contained in:
Gregor Kleen 2017-10-09 22:42:02 +02:00
parent 674a17acbe
commit 57ee32cc9c

View File

@ -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)