{-# START_FILE package.yaml #-} # This YAML file describes your package. Stack will automatically generate a # Cabal file when you run `stack build`. See the hpack website for help with # this file: . name: {{ name }} version: '0.0.0' github: "{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}" license: MIT author: "{{author-name}}{{^author-name}}Author name here{{/author-name}}" maintainer: "{{author-name}}{{^author-name}}Author name here{{/author-name}}" # synopsis: A new Haskeleton package. # description: {{ name }} is a new Haskeleton package. # category: Other extra-source-files: - CHANGELOG.md - LICENSE.md - package.yaml - README.md - stack.yaml default-extensions: - ApplicativeDo - BangPatterns - ConstraintKinds - DataKinds - DefaultSignatures - DeriveAnyClass - DeriveFoldable - DeriveFunctor - DeriveGeneric - DeriveLift - DeriveTraversable - DerivingStrategies - DuplicateRecordFields - EmptyCase - ExistentialQuantification - FlexibleContexts - FlexibleInstances - FunctionalDependencies - GADTs - GeneralizedNewtypeDeriving - InstanceSigs - KindSignatures - LambdaCase - MultiParamTypeClasses - MultiWayIf - NamedFieldPuns - OverloadedStrings - PatternSynonyms - RankNTypes - RecordWildCards - ScopedTypeVariables - StandaloneDeriving - TupleSections - TypeApplications - TypeFamilies - TypeFamilyDependencies - TypeOperators when: - condition: "impl(ghc >= 8.4.4)" then: ghc-options: - -Wall - -Wcompat - -Werror - -Widentities - -Wincomplete-record-updates - -Wincomplete-uni-patterns - -Wmissing-export-lists - -Wpartial-fields - -Wredundant-constraints - -fhide-source-paths - -Wno-unused-do-bind else: ghc-options: - -Wall - -Wcompat - -Werror - -Widentities - -Wincomplete-record-updates - -Wincomplete-uni-patterns - -Wredundant-constraints - -fhide-source-paths - -Wno-unused-do-bind library: dependencies: - base-noprelude - containers - relude - text source-dirs: src executables: {{ name }}: source-dirs: app main: Main.hs dependencies: - base-noprelude - {{ name }} - relude ghc-options: - -rtsopts - -threaded - -with-rtsopts=-N benchmarks: {{ name }}-benchmarks: source-dirs: benchmark main: Main.hs dependencies: - base-noprelude - {{ name }} - criterion tests: {{ name }}-test: source-dirs: test main: Main.hs dependencies: - base-noprelude - {{ name }} - relude - tasty - tasty-hspec {-# START_FILE .gitignore #-} # Stack uses this directory as scratch space. /.stack-work/ {-# START_FILE CHANGELOG.md #-} # Change log {{ name }} uses [Semantic Versioning][]. The change log is available through the [releases on GitHub][]. [Semantic Versioning]: http://semver.org/spec/v2.0.0.html [releases on GitHub]: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{ name }}/releases {-# START_FILE LICENSE.md #-} [The MIT License (MIT)][] Copyright (c) {{year}}{{^year}}2019{{/year}} {{author-name}}{{^author-name}}Author name here{{/author-name}} Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [The MIT License (MIT)]: https://opensource.org/licenses/MIT {-# START_FILE stack.yaml #-} resolver: lts-15.8 extra-deps: - base-noprelude-4.13.0.0 nix: enable: true packages: [glpk, pcre, zlib] {-# START_FILE README.md #-} # [{{ name }}][] ``` sh # Build the project. stack build # Run the test suite. stack test # Run the benchmarks. stack bench # Generate documentation. stack haddock ``` [{{ name }}]: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{ name }} {-# START_FILE Setup.hs #-} -- This script is used to build and install your package. Typically you don't -- need to change it. The Cabal documentation has more information about this -- file: . import qualified Distribution.Simple main :: IO () main = Distribution.Simple.defaultMain {-# START_FILE benchmark/Main.hs #-} -- You can benchmark your code quickly and effectively with Criterion. See its -- website for help: . import Criterion.Main main :: IO () main = defaultMain [bench "const" (whnf const ())] {-# START_FILE app/Main.hs #-} module Main (main) where main :: IO () main = putTextLn "Hello!" {-# START_FILE src/Prelude.hs #-} module Prelude (module Relude ) where import Relude {-# START_FILE test/Main.hs #-} module Main (main) where -- Tasty makes it easy to test your code. It is a test framework that can -- combine many different types of tests into one suite. See its website for -- help: . import qualified Test.Tasty -- Hspec is one of the providers for Tasty. It provides a nice syntax for -- writing tests. Its website has more info: . import Test.Tasty.Hspec main :: IO () main = do test <- testSpec "{{ name }}" spec Test.Tasty.defaultMain test spec :: Spec spec = parallel $ do it "is trivially true" $ do True `shouldBe` True