Skip to content

Commit

Permalink
Address Hlint hints in linear-base integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Jan 4, 2024
1 parent a878411 commit edd581f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ testTerms =
. insertTest
(Proxy @"LinearFromInteger")
mkUnaryTestConfig
(\a -> ([t|Integer|], a))
([t|Integer|],)
[|Data.Num.Linear.fromInteger|]
. insertTest
(Proxy @"LinearFst")
Expand Down Expand Up @@ -332,5 +332,5 @@ testTerms =
(Proxy @"LinearUncurry")
mkUnaryTestConfig
(\(a, b) -> ([t|($a, $b)|], a))
[|Data.Tuple.Linear.uncurry (\x _ -> x)|]
[|Data.Tuple.Linear.uncurry const|]
$ HEmpty1
51 changes: 22 additions & 29 deletions integrations/linear-base/integration-test/test/LinearBase/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ mkTestTerms
( const
[ ( ([t|Identity|], [t|Int64|], [t|Int64|]),
pure
( [|(,) <$> pure (Control.Functor.Linear.pure Prelude.Linear.id) <*> (pure <$> genIntegralBounded)|],
( [|(Control.Functor.Linear.pure Prelude.Linear.id,) <$> (pure <$> genIntegralBounded)|],
[|show . snd|]
)
)
Expand All @@ -89,7 +89,7 @@ mkTestTerms
( const
[ ( ([t|Identity|], [t|Int64|], [t|Int64|]),
pure
( [|(,) <$> pure (Control.Functor.Linear.pure Prelude.Linear.id) <*> (pure <$> genIntegralBounded)|],
( [|(Control.Functor.Linear.pure Prelude.Linear.id,) <$> (pure <$> genIntegralBounded)|],
[|show . snd|]
)
)
Expand All @@ -102,7 +102,7 @@ mkTestTerms
( const
[ ( ([t|Data.V.Linear.V 9|], [t|Int64|], [t|Int64|]),
pure
( [|(,) <$> pure (Data.Functor.Linear.pure Prelude.Linear.id) <*> sequenceA (pure genIntegralBounded)|],
( [|(Data.Functor.Linear.pure Prelude.Linear.id,) <$> sequenceA (pure genIntegralBounded)|],
[|show . snd|]
)
)
Expand All @@ -117,7 +117,7 @@ mkTestTerms
then [] -- No @`Applicative` `Replicator`@
else
[ ( ([t|Int64|], [t|Int64|]),
pure ([|(,) <$> pure (Control.Functor.Linear.pure Prelude.Linear.id) <*> fmap pure genIntegralBounded|], [|show|])
pure ([|(Control.Functor.Linear.pure Prelude.Linear.id,) <$> fmap pure genIntegralBounded|], [|show|])
)
]
)
Expand All @@ -128,7 +128,7 @@ mkTestTerms
( const
[ ( ([t|Int64|], [t|Int64|]),
pure
( [|(,) <$> pure (Data.Functor.Linear.pure Prelude.Linear.id) <*> sequenceA (pure genIntegralBounded)|],
( [|(Data.Functor.Linear.pure Prelude.Linear.id,) <$> sequenceA (pure genIntegralBounded)|],
[|show . snd|]
)
)
Expand Down Expand Up @@ -186,7 +186,7 @@ mkTestTerms
( TestCases
( const
[ ( ([t|Identity|], [t|Word8|], [t|Word8|]),
pure ([|(\x -> (x, Control.Functor.Linear.pure)) . Identity <$> genIntegralBounded|], [|show . fst|])
pure ([|(,Control.Functor.Linear.pure) . Identity <$> genIntegralBounded|], [|show . fst|])
)
]
)
Expand Down Expand Up @@ -245,9 +245,8 @@ mkTestTerms
[ ( ([t|Identity|], [t|Either Word8 Word8|], [t|Word8|]),
pure
( [|
(,)
<$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
<*> (pure <$> Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
(Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
<$> (pure <$> Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
|],
[|show . snd|]
)
Expand All @@ -264,9 +263,8 @@ mkTestTerms
-- [ ( ([t|[]|], [t|Either Word8 Word8|], [t|Word8|]),
-- pure
-- ( [|
-- (,)
-- <$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
-- <*> Gen.list (Range.exponential 1 1024) (Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
-- (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
-- <$> Gen.list (Range.exponential 1 1024) (Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
-- |],
-- [|show . snd|]
-- )
Expand All @@ -281,9 +279,8 @@ mkTestTerms
[ ( ([t|Identity|], [t|Either Word8 Word8|], [t|Word8|]),
pure
( [|
(,)
<$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
<*> (pure <$> Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
(Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
<$> (pure <$> Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
|],
[|show . snd|]
)
Expand All @@ -298,9 +295,8 @@ mkTestTerms
[ ( ([t|[]|], [t|Either Word8 Word8|], [t|Word8|]),
pure
( [|
(,)
<$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
<*> Gen.list (Range.exponential 1 1024) (Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
(Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
<$> Gen.list (Range.exponential 1 1024) (Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
|],
[|show . snd|]
)
Expand Down Expand Up @@ -372,9 +368,8 @@ mkTestTerms
[ ( ([t|Either Word8 Word8|], [t|Word8|]),
pure
( [|
(,)
<$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
<*> Gen.list (Range.exponential 1 1024) (Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
(Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
<$> Gen.list (Range.exponential 1 1024) (Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
|],
[|show . snd|]
)
Expand All @@ -396,9 +391,8 @@ mkTestTerms
[ ( ([t|Either Word8 Word8|], [t|Word8|]),
pure
( [|
(,)
<$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
<*> (pure <$> Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
(Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
<$> (pure <$> Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
|],
[|show|]
)
Expand All @@ -413,9 +407,8 @@ mkTestTerms
[ ( ([t|Either Word8 Word8|], [t|Word8|]),
pure
( [|
(,)
<$> pure (Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id)
<*> sequenceA (pure $ Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
(Data.Either.Linear.either Prelude.Linear.id Prelude.Linear.id,)
<$> sequenceA (pure $ Gen.choice [Left <$> genIntegralBounded, Right <$> genIntegralBounded])
|],
[|show . snd|]
)
Expand Down Expand Up @@ -581,7 +574,7 @@ mkTestTerms
( const
[ ( ([t|Maybe|], [t|Identity|], [t|Word8|]),
pure
( [|(,) <$> pure Control.Functor.Linear.pure <*> (Gen.maybe genIntegralBounded)|],
( [|(Control.Functor.Linear.pure,) <$> Gen.maybe genIntegralBounded|],
[|show . snd|]
)
)
Expand All @@ -594,7 +587,7 @@ mkTestTerms
( const
[ ( ([t|Identity|], [t|Word8|]),
pure
( [|(,) <$> pure Control.Functor.Linear.pure <*> Gen.list (Range.linear 0 100) genIntegralBounded|],
( [|(Control.Functor.Linear.pure,) <$> Gen.list (Range.linear 0 100) genIntegralBounded|],
[|show . snd|]
)
)
Expand Down

0 comments on commit edd581f

Please sign in to comment.