1
1
mirror of https://github.com/thma/WhyHaskellMatters.git synced 2024-07-07 09:56:28 +03:00
This commit is contained in:
Mahler, Thomas 2020-03-05 17:26:30 +01:00
parent 90f2710ee5
commit fd3195ec54
6 changed files with 21 additions and 32 deletions

View File

@ -1,5 +1,4 @@
# GentleIntroductionToHaskell
# Why Haskell Matters
- Funktionen sind 1st class citizens (higher order functions, Funktionen könen neue Funktionen erzeugen und andere Funktionen als Argumente haben)

View File

@ -1,6 +0,0 @@
module Main where
import Lib
main :: IO ()
main = someFunc

View File

@ -1,6 +1,6 @@
name: GentleIntroductionToHaskell
name: WhyHaskellMatters
version: 0.1.0.0
github: "githubuser/GentleIntroductionToHaskell"
github: "thma/WhyHaskellMatters"
license: Apache-2.0
author: "Thomas Mahler"
maintainer: "thma@apache.org"
@ -16,7 +16,7 @@ extra-source-files:
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/thma/GentleIntroductionToHaskell#readme>
description: Please see the README on GitHub at <https://github.com/thma/WhyHaskellMatters#readme>
dependencies:
- base >= 4.7 && < 5
@ -25,19 +25,8 @@ dependencies:
library:
source-dirs: src
executables:
GentleIntroductionToHaskell-exe:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- GentleIntroductionToHaskell
tests:
GentleIntroductionToHaskell-test:
WhyHaskellMatters-test:
main: Spec.hs
source-dirs: test
ghc-options:
@ -45,4 +34,6 @@ tests:
- -rtsopts
- -with-rtsopts=-N
dependencies:
- GentleIntroductionToHaskell
- WhyHaskellMatters
- hspec
- QuickCheck

View File

@ -1,6 +0,0 @@
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"

View File

@ -1,2 +1 @@
main :: IO ()
main = putStrLn "Test suite not yet implemented"
{-# OPTIONS_GHC -F -pgmF hspec-discover #-} -- this compiler pragma allows GHC to automatically discover all Hspec Test Specs.

View File

@ -0,0 +1,12 @@
module Tests.AllTestsSpec where
import Test.Hspec
import Test.QuickCheck
import Functions
spec :: Spec
spec =
describe "Why Haskell matters" $ do
it "it has functions" $
property $ \x -> square x `shouldBe` x*x