How to open .LHS files on Android
To open .LHS files on Android, open it with a text-editor app as plain text; for compiling/running with GHC, transfer it to a desktop or Linux environment (GHC toolchains are typically used on desktop/server platforms).
Step-by-step instructions
- Open it with a text-editor app as plain text; for compiling/running with GHC, transfer it to a desktop or Linux environment (GHC toolchains are typically used on desktop/server platforms).
Common issues
The file opens, but the code parts look wrong
Literate Haskell relies on specific conventions to distinguish documentation from code; viewing it in a word processor or with incorrect text settings can make the code blocks hard to identify.
- Open the file in a plain-text/code editor rather than a word processor.
- If you are compiling, use GHC (it applies the literate pre-processor for .lhs) and confirm the file follows literate conventions described in the Haskell report.
Compilation fails because it is treated like normal .hs source
If the toolchain is not using a literate-aware compilation path, the documentation lines can be interpreted as code and cause errors.
- Compile with GHC using the .lhs file directly so the literate pre-processor stage is applied.
- Confirm you did not rename a .hs file to .lhs (or vice versa) without adjusting the file’s content to match literate conventions.
My system does not recognize .lhs / opens it with the wrong app
File-type associations vary by platform; some systems may not have a built-in association for Literate Haskell.
- Use “Open with…” and choose a text editor, then set it as the default for .lhs if desired.
- On Linux desktops, recognition can depend on the shared MIME database installed on the system.
Still can’t open your .LHS file?
Recover a deleted or lost .LHS file
If the file was deleted by mistake or the drive was formatted, data recovery software may be able to get it back. Stop writing to that drive right away, because new data can overwrite what you want to recover.
Windows software that recovers deleted or lost files from PCs and external drives such as HDDs, SSDs, USB drives and memory cards, after deletion, formatting or a crash.
Wondershare RecoveritWindows and Mac software that recovers deleted or lost files from computers and external drives such as HDDs, SSDs, USB drives and SD cards.
We may earn a commission when you use affiliate links. This supports our free file extension guides.
Security note
.lhs files are plain text, but they can contain Haskell code that may run arbitrary actions when compiled/executed; treat untrusted .lhs files like any other source code you might run.
