diff --git a/IHP/HSX/Parser.hs b/IHP/HSX/Parser.hs index 95a96fcc7..f90e73125 100644 --- a/IHP/HSX/Parser.hs +++ b/IHP/HSX/Parser.hs @@ -21,6 +21,7 @@ import qualified Language.Haskell.Meta as Haskell import qualified Language.Haskell.TH.Syntax as Haskell import qualified "template-haskell" Language.Haskell.TH as TH import qualified Data.Set as Set +import qualified Data.Containers.ListUtils as List data AttributeValue = TextValue !Text | ExpressionValue !Haskell.Exp deriving (Eq, Show) @@ -125,7 +126,7 @@ hsxNodeAttributes end = staticAttributes attributes <- manyTill (hsxNodeAttribute <|> hsxSplicedAttributes) end let staticAttributes = List.filter isStaticAttribute attributes let keys = List.map (\(StaticAttribute name _) -> name) staticAttributes - let uniqueKeys = List.nub keys + let uniqueKeys = List.nubOrd keys unless (keys == uniqueKeys) (fail $ "Duplicate attribute found in tag: " <> show (keys List.\\ uniqueKeys)) pure attributes diff --git a/IHP/Pagination/ViewFunctions.hs b/IHP/Pagination/ViewFunctions.hs index 26843d716..5590dd3ed 100644 --- a/IHP/Pagination/ViewFunctions.hs +++ b/IHP/Pagination/ViewFunctions.hs @@ -19,6 +19,7 @@ import IHP.View.Classes import qualified Network.Wai as Wai import qualified Network.HTTP.Types.URI as Query import IHP.ViewSupport (theRequest) +import qualified Data.Containers.ListUtils as List -- | Render a navigation for your pagination. This is to be used in your view whenever @@ -134,7 +135,7 @@ renderPagination pagination@Pagination {currentPage, window, pageSize} = if window > totalPages then [1..getLastPage pagination] else - nub $ 1 : [max 1 lowerBound..min (getLastPage pagination) upperBound] ++ [totalPages] + List.nubInt $ 1 : [max 1 lowerBound..min (getLastPage pagination) upperBound] ++ [totalPages] -- | Render a filtering box in your view. Allows the user to type in a query and filter -- results according to what they type.