Skip to content

ghc-internal: Store file seekability in Handle__ (#24220)

Maciej Wasilewski requested to merge MaciejWas/ghc:wip/maciejwas/T24220 into master

Fixes #24220

Where is the key part of this patch? That is, what should reviewers look at first?

libraries/ghc-internal/src/GHC/Internal/IO/Handle/Types.hs

Notes

if your MR may break existing programs (e.g. touches base or causes the compiler to reject programs), please describe the expected breakage and add the user-facing label. This will run ghc/head.hackage> to characterise the effect of your change on Hackage.

This change might alter behaviour of programs if a device changes it's seekability (output of IODevice.isSeekable) after creating a Handle__. I'm not sure in what circumstances this could ever happen.

add a testcase to the testsuite.

I'm not sure how to implement an automated test for this change. The goal of change is to get rid of an unnecessary system call and I've been unable to find test cases which test this kind of thing

Edited by Maciej Wasilewski

Merge request reports