diff --git a/README.md b/README.md index 8f32637..78fcfd4 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/app/Main.hs b/app/Main.hs deleted file mode 100644 index de1c1ab..0000000 --- a/app/Main.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Main where - -import Lib - -main :: IO () -main = someFunc diff --git a/package.yaml b/package.yaml index 7224e52..f7e5109 100644 --- a/package.yaml +++ b/package.yaml @@ -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 +description: Please see the README on GitHub at 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 \ No newline at end of file diff --git a/src/Lib.hs b/src/Lib.hs deleted file mode 100644 index d36ff27..0000000 --- a/src/Lib.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Lib - ( someFunc - ) where - -someFunc :: IO () -someFunc = putStrLn "someFunc" diff --git a/test/Spec.hs b/test/Spec.hs index cd4753f..60bc9f4 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -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. \ No newline at end of file diff --git a/test/Tests/AllTestsSpec.hs b/test/Tests/AllTestsSpec.hs new file mode 100644 index 0000000..f7095bc --- /dev/null +++ b/test/Tests/AllTestsSpec.hs @@ -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