Skip to content

Commit

Permalink
add Hashable instance for SizeSpec2D
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Yorgey committed Nov 28, 2013
1 parent 615527a commit f7a4aca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion diagrams-lib.cabal
Expand Up @@ -102,6 +102,7 @@ Library
tagged >= 0.7,
optparse-applicative >= 0.7 && < 0.8,
filepath,
safe >= 0.2 && < 0.4
safe >= 0.2 && < 0.4,
hashable >= 1.2 && < 1.3
Hs-source-dirs: src
default-language: Haskell2010
7 changes: 6 additions & 1 deletion src/Diagrams/TwoD/Size.hs
@@ -1,3 +1,4 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}

Expand Down Expand Up @@ -35,6 +36,8 @@ import Diagrams.TwoD.Vector

import Control.Applicative (liftA2, (<$>))
import Control.Arrow ((&&&), (***))
import Data.Hashable (Hashable)
import GHC.Generics (Generic)

------------------------------------------------------------
-- Computing diagram sizes
Expand Down Expand Up @@ -93,7 +96,9 @@ data SizeSpec2D = Width !Double -- ^ Specify an explicit
| Absolute -- ^ Absolute size: use whatever
-- size an object already has;
-- do not rescale.
deriving (Eq, Ord, Show)
deriving (Eq, Ord, Show, Generic)

instance Hashable SizeSpec2D

-- | Create a size specification from a possibly-specified width and
-- height.
Expand Down

0 comments on commit f7a4aca

Please sign in to comment.