Skip to content

Commit

Permalink
Eliminate uses of List.head
Browse files Browse the repository at this point in the history
These cause deprecation warnings:
haskell/core-libraries-committee#87
  • Loading branch information
Rufflewind committed Jan 22, 2024
1 parent 7592c63 commit abb3b8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/FindFile001.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ main _t = do
for_ (List.permutations ["qux", "bar", "."]) $ \ ds -> do

let (match, noMatch) = List.partition (== "qux") ds
match0 : _ <- pure match
noMatch0 : _ <- pure noMatch

T(expectEq) ds (Just (List.head match </> "foo")) =<<
T(expectEq) ds (Just (match0 </> "foo")) =<<
findFileWith f ds "foo"

T(expectEq) ds ((</> "foo") <$> match) =<< findFilesWith f ds "foo"

T(expectEq) ds (Just (List.head noMatch </> "foo")) =<<
T(expectEq) ds (Just (noMatch0 </> "foo")) =<<
findFileWith ((not <$>) . f) ds "foo"

T(expectEq) ds ((</> "foo") <$> noMatch) =<<
Expand Down

0 comments on commit abb3b8a

Please sign in to comment.