mirror of
https://github.com/typeable/inflections-hs.git
synced 2024-08-15 17:10:21 +03:00
We don't want to have overlapping instances
This commit is contained in:
parent
212d0cb3e7
commit
feac25f60c
@ -64,7 +64,7 @@ mkAcronym txt =
|
||||
|
||||
-- | A 'Text' value that should be kept whole through applied inflections.
|
||||
data Word (t :: WordType) = Word Text
|
||||
deriving (Eq, Ord, Show)
|
||||
deriving (Eq, Ord)
|
||||
|
||||
instance Show (Word 'Normal) where
|
||||
show (Word x) = "Word " ++ show x
|
||||
@ -85,7 +85,7 @@ unWord (Word s) = s
|
||||
-- apply 'unWord' on it, of course. This is faciliated by 'unSomeWord'.
|
||||
|
||||
data SomeWord where
|
||||
SomeWord :: Transformable (Word t) => Word t -> SomeWord
|
||||
SomeWord :: (Transformable (Word t), Show (Word t)) => Word t -> SomeWord
|
||||
-- NOTE The constraint is only needed because GHC is not smart enough
|
||||
-- (yet?) to figure out that t cannot be anything other than Normal and
|
||||
-- Acronym and thus all cases are already covered by the instances
|
||||
|
Loading…
Reference in New Issue
Block a user