@@ -14,7 +14,6 @@ module PostgresqlTypes.Bpchar
1414where
1515
1616import qualified Data.Attoparsec.Text as Attoparsec
17- import Data.Hashable (Hashable (.. ))
1817import Data.String
1918import qualified Data.Text as Text
2019import qualified Data.Text.Encoding as Text.Encoding
@@ -43,9 +42,10 @@ import qualified TextBuilder
4342--
4443-- For example, @char(1)@ in SQL is @Bpchar 1@ in Haskell, while @\"char\"@ in SQL is
4544-- 'PostgresqlTypes.Char.Char' in Haskell. These are completely different types in PostgreSQL.
46- data Bpchar (numChars :: TypeLits. Nat ) = Bpchar Text
45+ newtype Bpchar (numChars :: TypeLits. Nat ) = Bpchar Text
4746 deriving stock (Eq , Ord )
4847 deriving (Show , Read , IsString ) via (ViaIsScalar (Bpchar numChars ))
48+ deriving newtype (Hashable )
4949
5050instance (TypeLits. KnownNat numChars ) => Arbitrary (Bpchar numChars ) where
5151 arbitrary = do
@@ -56,9 +56,6 @@ instance (TypeLits.KnownNat numChars) => Arbitrary (Bpchar numChars) where
5656 Nothing -> error " Arbitrary Bpchar: Generated string has incorrect length"
5757 Just char -> pure char
5858
59- instance Hashable (Bpchar numChars ) where
60- hashWithSalt salt (Bpchar txt) = hashWithSalt salt txt
61-
6259instance (TypeLits. KnownNat numChars ) => IsScalar (Bpchar numChars ) where
6360 schemaName = Tagged Nothing
6461 typeName = Tagged " bpchar"
0 commit comments