.LHS File Extension
Literate Haskell Script
| Developer | Haskell Community |
| Popularity |
2.4 | 5 Votes |
What is an LHS file?
An LHS file is a script used for writing source code in Haskell, a functional programming language. It enables developers to intersperse code with extensive documentation, facilitating easier understanding and collaboration. LHS files include both program code and human-readable comments, with program lines typically beginning with a > character to distinguish them from the commentary.
More Information
Developers and researchers primarily use LHS files to document Haskell programs comprehensively. These files are commonly found in academic and educational settings, where detailed explanations accompany the Haskell code.
NOTE: While similar to a standard Haskell Script (.HS file), the LHS format's literate programming approach ensures that documentation is an integral part of the source code, enhancing maintainability and readability.
How to open an LHS file
You can open LHS files with any text editor, such as Microsoft TextEdit or Apple TextEdit. However, for best results, especially if you plan to run or compile the Haskell code, use a Haskell development environment such as GHCi or an IDE like Microsoft Visual Studio Code with Haskell extensions. Additionally, you can process LHS files with literate programming tools like lhs2TeX.