.hs

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

  1. Confirm the file really is a .hs. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
  2. On Windows, open it with VS Code (Haskell) or GHCi.
  3. On Mac, use VS Code (Haskell) or GHCi.
  4. On Linux, try VS Code (Haskell) or GHCi.
  5. 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
!
Before you open it: Caution. A .hs file is program source. Compiling and running it executes its code; review unfamiliar files first.

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.

Learn more about .hs