---
title: "Haskell | CoderPad"
description: "Learn more about Haskell from CoderPad."
canonical: "https://coderpad.io/languages/haskell/"
last_modified: "2025-12-04 03:53:46"
---
# Haskell online IDE & code editor for technical interviews

Running GHC 9.0 – IntelliSense is not available

### Experience the Haskell IDE yourself

See just how easy and intuitive CoderPad Interview is to use below.

[Launch the environment](https://embed.coderpad.io/sandbox?question_id=247218&use_question_button)

## Guidelines to use Haskell in this online IDE

Your code is run with`runghc solution.hs`. Your code runs in interpreted mode, so you don’t need a special entrypoint.

We have a couple testing options available. Simple tests using [Hspec](https://hspec.github.io/) are straightforward:

```
import Test.Hspec
import Test.QuickCheck
import Control.Exception (evaluate)

main :: IO ()
main = hspec $ do
  describe "Prelude.head" $ do
    it "returns the first element of a list" $ do
      head [23 ..] `shouldBe` (23 :: Int)

    it "returns the first element of an *arbitrary* list" $
      property $ \x xs -> head (x:xs) == (x :: Int)

    it "throws an exception if used with an empty list" $ do
      evaluate (head []) `shouldThrow` anyException
Code language: Haskell (haskell)
```

You can also use [QuickCheck’s](http://hackage.haskell.org/package/QuickCheck) more powerful test generation framework directly (this test fails):

```
import Test.QuickCheck

prop_revapp :: [Int] -> [Int] -> Bool
prop_revapp xs ys = reverse (xs++ys) == reverse xs ++ reverse ys

main = quickCheck prop_revapp
Code language: Haskell (haskell)
```

We install a variety of packages in the Haskell environment (including`req`for HTTP requests). The output of`cabal list --installed --simple`is below:

Package | Version
HUnit | 1.6.2.0
QuickCheck | 2.14.2
SHA | 1.6.4.4
bytestring | 0.11.3.1
hashtables | 1.3.1
hspec | 2.10.8
network | 3.1.2.7
parsec | 3.1.15.1
req | 3.13.0
split | 0.2.3.5
text | 2.0.1
unordered-containers | 0.2.19.1
vector | 0.13.0.0
vector-algorithms | 0.9.0.1

## Need a better way to interview candidates?

[Request a demo](https://coderpad.io/sales/)
