Unify Proxy type applications
This commit is contained in:
parent
e7d494c034
commit
591f4cddfa
@ -151,12 +151,12 @@ instance {-# OVERLAPPABLE #-} (FromField t, KnownSymbol nameSym) => FromRow' (M1
|
|||||||
(Left $ ErrorUnexpectedNull row nameText)
|
(Left $ ErrorUnexpectedNull row nameText)
|
||||||
Right
|
Right
|
||||||
where
|
where
|
||||||
nameText = Text.pack $ symbolVal (Proxy :: Proxy nameSym)
|
nameText = Text.pack $ symbolVal @nameSym Proxy
|
||||||
|
|
||||||
instance {-# OVERLAPPING #-} (KnownSymbol nameSym, FromField t) => FromRow' (M1 S ('MetaSel ('Just nameSym) nu ns dl) (Rec0 (Maybe t))) where
|
instance {-# OVERLAPPING #-} (KnownSymbol nameSym, FromField t) => FromRow' (M1 S ('MetaSel ('Just nameSym) nu ns dl) (Rec0 (Maybe t))) where
|
||||||
fromRow' = decodeField nameText $ const Right
|
fromRow' = decodeField nameText $ const Right
|
||||||
where
|
where
|
||||||
nameText = Text.pack $ symbolVal (Proxy :: Proxy nameSym)
|
nameText = Text.pack $ symbolVal @nameSym Proxy
|
||||||
|
|
||||||
mapLeft :: (b -> c) -> Either b a -> Either c a
|
mapLeft :: (b -> c) -> Either b a -> Either c a
|
||||||
mapLeft f (Left l) = Left $ f l
|
mapLeft f (Left l) = Left $ f l
|
||||||
|
@ -35,7 +35,7 @@ spec = do
|
|||||||
describe "getColumnTable" $ do
|
describe "getColumnTable" $ do
|
||||||
it "Gets the column table for a result" $ \conn -> do
|
it "Gets the column table for a result" $ \conn -> do
|
||||||
Just result <- LibPQ.execParams conn "SELECT name, age FROM person" [] LibPQ.Text
|
Just result <- LibPQ.execParams conn "SELECT name, age FROM person" [] LibPQ.Text
|
||||||
columnTable <- Opium.getColumnTable (Proxy :: Proxy Person) result
|
columnTable <- Opium.getColumnTable @Person Proxy result
|
||||||
columnTable `shouldBe` [0, 1]
|
columnTable `shouldBe` [0, 1]
|
||||||
|
|
||||||
it "Gets the numbers right for funky configurations" $ \conn -> do
|
it "Gets the numbers right for funky configurations" $ \conn -> do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user