Last active
November 21, 2018 07:05
-
-
Save m-renaud/4a89c4e88bb0113f9b2deb2f5c4dafd0 to your computer and use it in GitHub Desktop.
Default project template for `cabal init`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- File: src/Lib.hs | |
module Lib (greeting) where | |
greeting :: String | |
greeting = "Hello, world!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- File: test/src/LibSpec.hs | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main (main) where | |
import qualified Lib | |
import Test.Hspec | |
main :: IO () | |
main = hspec spec | |
spec :: Spec | |
spec = do | |
describe "greeting test" $ do | |
it "is hello world" $ do | |
Lib.greeting `shouldBe` "Hello, world!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- File: app/Main.hs | |
module Main where | |
import qualified Lib | |
main :: IO () | |
main = putStrLn Lib.greeting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cabal-version: 2.4 | |
name: myproject | |
version: 0.1.0.0 | |
synopsis: myproject synopsis. | |
description: myproject description. | |
license: BSD-3-Clause | |
license-file: LICENSE | |
author: Matt Renaud | |
maintainer: [email protected] | |
build-type: Simple | |
extra-source-files: CHANGELOG.md | |
library internal-lib | |
default-language: Haskell2010 | |
hs-source-dirs: src | |
exposed-modules: | |
Lib, | |
build-depends: | |
base >=4.12 && <4.13, | |
executable myproject | |
default-language: Haskell2010 | |
hs-source-dirs: app | |
main-is: Main.hs | |
build-depends: | |
base >=4.12 && < 4.13, | |
internal-lib, | |
test-suite internal-lib-test | |
default-language: Haskell2010 | |
hs-source-dirs: test/src | |
type: exitcode-stdio-1.0 | |
main-is: LibSpec.hs | |
build-depends: | |
base >=4.12 && <4.13, | |
internal-lib, | |
hspec, | |
ghc-options: | |
-threaded -rtsopts -with-rtsopts=-N |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment