time icon indicating copy to clipboard operation
time copied to clipboard

Re CLC issue 292 Avoid using partial init and last

Open mpilgrem opened this issue 1 year ago • 1 comments

The motivation for this pull request is:

  • https://github.com/haskell/core-libraries-committee/issues/292

At some point, GHC versions may warn that init and last are partial, giving advice about alternatives (including unsnoc). This pull request seeks to anticipate that, by avoiding the use of partial functions at the two places where the time package uses init and/or last.

mpilgrem avatar Nov 09 '24 22:11 mpilgrem

I have converted the pull request to draft because it has been suggested that, compared to other approaches, unsnoc has performance issues. I am looking into that.

mpilgrem avatar Nov 11 '24 09:11 mpilgrem

Sorry, I missed this PR when submitting #275, which superseds it. I think the PR can be closed now.

Bodigrim avatar Jul 12 '25 17:07 Bodigrim

test code still needs fixing. Lemme go fix it.

AshleyYakeley avatar Jul 14 '25 02:07 AshleyYakeley

OK done.

AshleyYakeley avatar Jul 14 '25 02:07 AshleyYakeley