haskell code from hi

Is there possibly a way of getting source code, given a *.hi file? Yes you're right I deleted all my *.hs files, while trying to remove *.hi ones!! Desperately, -- Ozgur Akgun

Ouch... my condolences, but I think you're screwed. I think the .hi
files are purely interface info, and the .o files have all the info on
what to actually do (and getting to .hs files from .hi+.o is gonna be
like going from sausage to pig, in any case). If you haven't messed
with the disk, I think your best bet might be to try and undelete
files. That might be as messy as looking at the raw disk image and
trying to recover disk sectors, or possibly there are still entire
files there that are just not referenced by directory entries. Either
(or any) way, it's a bit chancy...
Uwe
On 11/21/09, Ozgur Akgun
Is there possibly a way of getting source code, given a *.hi file?
Yes you're right I deleted all my *.hs files, while trying to remove *.hi ones!!
Desperately,
-- Ozgur Akgun

On Sun, Nov 22, 2009 at 1:04 AM, Uwe Hollerbach
Ouch... my condolences, but I think you're screwed. I think the .hi files are purely interface info, and the .o files have all the info on what to actually do (and getting to .hs files from .hi+.o is gonna be like going from sausage to pig, in any case). If you haven't messed with the disk, I think your best bet might be to try and undelete files. That might be as messy as looking at the raw disk image and trying to recover disk sectors, or possibly there are still entire files there that are just not referenced by directory entries. Either (or any) way, it's a bit chancy...
And this why you always, *always* use a revision-control system or at least good backups. .hi files actually do contain some code, specifically what ghc decides can be inlined (see ghc --show-iface), but it's not the sort of code you'd get any use from. Have a look, you'll see. -- Svein Ove Aas

I really get the point, and what I should have been doing. Anyways shit
happens!
Thanks for the answers though.
2009/11/22 Svein Ove Aas
On Sun, Nov 22, 2009 at 1:04 AM, Uwe Hollerbach
wrote: Ouch... my condolences, but I think you're screwed. I think the .hi files are purely interface info, and the .o files have all the info on what to actually do (and getting to .hs files from .hi+.o is gonna be like going from sausage to pig, in any case). If you haven't messed with the disk, I think your best bet might be to try and undelete files. That might be as messy as looking at the raw disk image and trying to recover disk sectors, or possibly there are still entire files there that are just not referenced by directory entries. Either (or any) way, it's a bit chancy...
And this why you always, *always* use a revision-control system or at least good backups.
.hi files actually do contain some code, specifically what ghc decides can be inlined (see ghc --show-iface), but it's not the sort of code you'd get any use from. Have a look, you'll see.
-- Svein Ove Aas
-- Ozgur Akgun
participants (3)
-
Ozgur Akgun
-
Svein Ove Aas
-
Uwe Hollerbach