How to open a .hs file
Quick, free ways to open Haskell on any system.
A .hs file is a Haskell Source File. If double-clicking does nothing, your computer simply does not have an app that reads Haskell yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .hs file step by step
- Confirm the file really is a .hs. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with VS Code (Haskell) or GHCi.
- On Mac, use VS Code (Haskell) or GHCi.
- On Linux, try VS Code (Haskell) or GHCi.
- Still stuck? Convert the .hs to exe (via GHC), which opens more widely.
Best apps to open .hs files
Windows
- VS Code (Haskell)
- GHCi
- any text editor
macOS
- VS Code (Haskell)
- GHCi
- any text editor
Linux
- VS Code (Haskell)
- GHCi
- any text editor
Frequently asked questions
Why can't I open my .hs file?
Almost always because no installed app understands Haskell. Install one of the apps above, or convert the file to a format your existing software already reads.
How do I run a .hs file?
Load it in GHCi (the interactive Haskell shell) with ghci file.hs, or compile it with ghc file.hs and run the resulting binary. The tools stack and cabal manage projects.
What makes Haskell different from other languages?
It is purely functional and lazily evaluated, with a strong static type system. Side effects are tracked in the types, which makes programs predictable and easy to reason about.