Skip to content

Commit 4b077a9

Browse files
committed
Drop use of partial List functions
Ghc-9.10 and later warn about use of partial functions like `List.head`.
1 parent 18ea549 commit 4b077a9

File tree

1 file changed

+1
-1
lines changed
  • cardano-db-sync/src/Cardano/DbSync/Ledger

1 file changed

+1
-1
lines changed

cardano-db-sync/src/Cardano/DbSync/Ledger/State.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ listMemorySnapshots env = do
705705
case AS.toNewestFirst $ ledgerDbCheckpoints ldb of
706706
[] -> []
707707
[a] -> [a]
708-
ls -> [List.head ls, List.last ls]
708+
(h : ls) -> catMaybes [Just h, lastMay ls]
709709
notGenesis GenesisPoint = False
710710
notGenesis (BlockPoint _ _) = True
711711

0 commit comments

Comments
 (0)