stefan@stefans-MacBook-Pro curs9 % ghci ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Prelude> :l curs9.hs :l curs9.hs : error: can't find file: curs9.hs Failed, no modules loaded. Prelude> :l curs9.hs :l curs9.hs [1 of 1] Compiling Main ( curs9.hs, interpreted ) Ok, one module loaded. *Main> :q :q Leaving GHCi. stefan@stefans-MacBook-Pro curs9 % ghc -o curs9 curs9.hs ghc -o curs9 curs9.hs [1 of 1] Compiling Main ( curs9.hs, curs9.o ) Linking curs9 ... stefan@stefans-MacBook-Pro curs9 % ./curs9 ./curs9 Hello! Succ (Succ (Succ (Succ (Succ Zero)))) stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2688 drwxr-xr-x 7 stefan staff 224 Apr 20 18:16 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 553 Apr 20 18:16 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 8 stefan staff 256 Apr 20 18:18 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 377 Apr 20 18:18 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 194 Apr 20 18:17 nat.hs stefan@stefans-MacBook-Pro curs9 % ghci ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Prelude> :l curs9 :l curs9 [1 of 2] Compiling Nat ( Nat.hs, interpreted ) [2 of 2] Compiling Main ( curs9.hs, interpreted ) Ok, two modules loaded. *Main> :q :q Leaving GHCi. stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 8 stefan staff 256 Apr 20 18:19 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 462 Apr 20 18:19 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 194 Apr 20 18:17 nat.hs stefan@stefans-MacBook-Pro curs9 % mv nat.hs ceva.hs mv nat.hs ceva.hs stefan@stefans-MacBook-Pro curs9 % ghci ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Prelude> :l curs9 :l curs9 [1 of 1] Compiling Main ( curs9.hs, interpreted ) curs9.hs:11:1: error: Could not find module ‘Nat’ Use -v (or `:set -v` in ghci) to see a list of the files searched for. | 11 | import Nat | ^^^^^^^^^^ Failed, no modules loaded. Prelude> :q :q Leaving GHCi. stefan@stefans-MacBook-Pro curs9 % mv ceva.hs nat.hs mv ceva.hs nat.hs stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 8 stefan staff 256 Apr 20 18:19 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 462 Apr 20 18:19 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 194 Apr 20 18:17 nat.hs stefan@stefans-MacBook-Pro curs9 % mkdir utils mkdir utils stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 9 stefan staff 288 Apr 20 18:20 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 462 Apr 20 18:19 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 194 Apr 20 18:17 nat.hs drwxr-xr-x 2 stefan staff 64 Apr 20 18:20 cd stefan@stefans-MacBook-Pro curs9 % cd utils cd utils stefan@stefans-MacBook-Pro utils % ls -al ls -al total 0 drwxr-xr-x 2 stefan staff 64 Apr 20 18:20 . drwxr-xr-x 9 stefan staff 288 Apr 20 18:20 .. stefan@stefans-MacBook-Pro utils % touch intreg.hs touch intreg.hs stefan@stefans-MacBook-Pro utils % ls -al ls -al total 0 drwxr-xr-x 3 stefan staff 96 Apr 20 18:20 . drwxr-xr-x 9 stefan staff 288 Apr 20 18:20 .. -rw-r--r-- 1 stefan staff 0 Apr 20 18:20 intreg.hs stefan@stefans-MacBook-Pro utils % cd .. cd .. stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 9 stefan staff 288 Apr 20 18:20 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 462 Apr 20 18:19 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 194 Apr 20 18:17 nat.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:21 utils stefan@stefans-MacBook-Pro curs9 % ghci ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Prelude> :l curs9 :l curs9 [1 of 2] Compiling Nat ( Nat.hs, interpreted ) [2 of 2] Compiling Main ( curs9.hs, interpreted ) Ok, two modules loaded. *Main> :r :r [2 of 3] Compiling Utils.Intreg ( Utils/Intreg.hs, interpreted ) [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:18:18: error: Ambiguous occurrence ‘add’ It could refer to either ‘Nat.add’, imported from ‘Nat’ at curs9.hs:11:1-10 (and originally defined at Nat.hs:6:1-3) or ‘Utils.Intreg.add’, imported from ‘Utils.Intreg’ at curs9.hs:12:1-19 (and originally defined at Utils/Intreg.hs:6:1-3) | 18 | print (add two three) | ^^^ Failed, two modules loaded. *Utils.Intreg> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> main main Hello! Succ (Succ (Succ (Succ (Succ Zero)))) *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> main main Hello! Succ (Succ (Succ (Succ (Succ Zero)))) Cons 10 *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:19:18: error: Not in scope: ‘Utils.Intreg.add’ | 19 | print (Utils.Intreg.add (Utils.Intreg.Cons 7) (Utils.Intreg.Cons 3)) | ^^^^^^^^^^^^^^^^ curs9.hs:19:36: error: Not in scope: data constructor ‘Utils.Intreg.Cons’ | 19 | print (Utils.Intreg.add (Utils.Intreg.Cons 7) (Utils.Intreg.Cons 3)) | ^^^^^^^^^^^^^^^^^ curs9.hs:19:58: error: Not in scope: data constructor ‘Utils.Intreg.Cons’ | 19 | print (Utils.Intreg.add (Utils.Intreg.Cons 7) (Utils.Intreg.Cons 3)) | ^^^^^^^^^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> main main Hello! Succ (Succ (Succ (Succ (Succ Zero)))) Cons 14 *Main> :r :r [2 of 3] Compiling Nat ( Nat.hs, interpreted ) [3 of 3] Compiling Main ( curs9.hs, interpreted ) [Nat changed] curs9.hs:18:26: error: Not in scope: ‘Nat.two’ Module ‘Nat’ does not export ‘two’. | 18 | print (Nat.add Nat.two Nat.three) | ^^^^^^^ curs9.hs:18:34: error: Not in scope: ‘Nat.three’ Module ‘Nat’ does not export ‘three’. | 18 | print (Nat.add Nat.two Nat.three) | ^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg> :r :r [2 of 3] Compiling Nat ( Nat.hs, interpreted ) [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:21:18: error: Not in scope: ‘Nat.addAux’ Perhaps you meant ‘Nat.add’ (imported from Nat) Module ‘Nat’ does not export ‘addAux’. | 21 | print (Nat.addAux Nat.two Nat.three) | ^^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg> :r :r [2 of 3] Compiling Nat ( Nat.hs, interpreted ) [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> main main Hello! Succ (Succ (Succ (Succ (Succ Zero)))) Cons 14 *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> main main Hello! Succ (Succ (Succ (Succ (Succ Zero)))) Succ (Succ (Succ Zero)) Cons 14 *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:20:27: error: Not in scope: data constructor ‘Nat.Succ’ Module ‘Nat’ does not export ‘Succ’. | 20 | print (Nat.add (Nat.Succ Nat.Zero) Nat.three) | ^^^^^^^^ Failed, two modules loaded. *Utils.Intreg> :q :q Leaving GHCi. stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 9 stefan staff 288 Apr 20 18:32 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 845 Apr 20 18:32 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 332 Apr 20 18:30 nat.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:21 utils stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 9 stefan staff 288 Apr 20 18:33 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 1029 Apr 20 18:33 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 332 Apr 20 18:30 nat.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:21 utils stefan@stefans-MacBook-Pro curs9 % stack new demo stack new demo Downloading template "new-template" to create project "demo" in demo/ ... The following parameters were needed by the template but not provided: author-name You can provide them in /Users/stefan/.stack/config.yaml, like this: templates: params: author-name: value Or you can pass each one as parameters like this: stack new demo new-template -p "author-name:value" The following parameters were needed by the template but not provided: author-email, author-name, category, copyright, github-username You can provide them in /Users/stefan/.stack/config.yaml, like this: templates: params: author-email: value author-name: value category: value copyright: value github-username: value Or you can pass each one as parameters like this: stack new demo new-template -p "author-email:value" -p "author-name:value" -p "category:value" -p "copyright:value" -p "github-username:value" Looking for .cabal or package.yaml files to use to init the project. Using cabal packages: - demo/ Selecting the best among 21 snapshots... * Matches https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/4.yaml Selected resolver: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/4.yaml Initialising configuration using resolver: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/4.yaml Total number of user packages considered: 1 Writing configuration to file: demo/stack.yaml All done. /Users/stefan/.stack/templates/new-template.hsfiles: 6.06 KiB downloaded... stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 1029 Apr 20 18:33 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 13 stefan staff 416 Apr 20 18:34 demo drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 332 Apr 20 18:30 nat.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:21 utils stefan@stefans-MacBook-Pro curs9 % cd demo cd demo stefan@stefans-MacBook-Pro demo % ls -al ls -al total 64 drwxr-xr-x 13 stefan staff 416 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % cat .gitignore cat .gitignore .stack-work/ stefan@stefans-MacBook-Pro demo % ls -al ls -al total 64 drwxr-xr-x 13 stefan staff 416 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % stack setup stack setup stack will use a sandboxed GHC it installed For more information on paths, see 'stack path' and 'stack exec env' To use this GHC and packages outside of a project, consider using: stack ghc, stack ghci, stack runghc, or stack exec stefan@stefans-MacBook-Pro demo % stack path stack path snapshot-doc-root: /Users/stefan/.stack/snapshots/x86_64-osx/3d753b5e376864d6cdcde1187dcf509d5f0cdd7140b468b530d27e452aae3676/9.0.2/doc local-doc-root: /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/3d753b5e376864d6cdcde1187dcf509d5f0cdd7140b468b530d27e452aae3676/9.0.2/doc local-hoogle-root: /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/hoogle/x86_64-osx/3d753b5e376864d6cdcde1187dcf509d5f0cdd7140b468b530d27e452aae3676/9.0.2 stack-root: /Users/stefan/.stack project-root: /Users/stefan/teaching/pf-2021-2022/curs9/demo config-location: /Users/stefan/teaching/pf-2021-2022/curs9/demo/stack.yaml bin-path: /Users/stefan/.stack/snapshots/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/bin:/Users/stefan/.stack/compiler-tools/x86_64-osx/ghc-9.0.2/bin:/Users/stefan/.stack/programs/x86_64-osx/ghc-9.0.2/bin:/Users/stefan/.opam/4.09.1/bin:/Users/stefan/software/spass39:/Users/stefan/software/java-semantics/bin/:/Users/stefan/software/dafny:/usr/local/opt/openjdk/bin:/Users/stefan/software/z3-4.8.5-x64-osx-10.14.2/bin:/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Developer/CommandLineTools/usr/bin:/Library/TeX/texbin:/Users/stefan/.dotnet/tools:/usr/local/opt/yices2/bin programs: /Users/stefan/.stack/programs/x86_64-osx compiler-exe: /Users/stefan/.stack/programs/x86_64-osx/ghc-9.0.2/bin/ghc-9.0.2 compiler-bin: /Users/stefan/.stack/programs/x86_64-osx/ghc-9.0.2/bin compiler-tools-bin: /Users/stefan/.stack/compiler-tools/x86_64-osx/ghc-9.0.2/bin local-bin: /Users/stefan/.local/bin extra-include-dirs: extra-library-dirs: snapshot-pkg-db: /Users/stefan/.stack/snapshots/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/pkgdb local-pkg-db: /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/pkgdb global-pkg-db: /Users/stefan/.stack/programs/x86_64-osx/ghc-9.0.2/lib/ghc-9.0.2/lib/package.conf.d ghc-package-path: /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/pkgdb:/Users/stefan/.stack/snapshots/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/pkgdb:/Users/stefan/.stack/programs/x86_64-osx/ghc-9.0.2/lib/ghc-9.0.2/lib/package.conf.d snapshot-install-root: /Users/stefan/.stack/snapshots/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2 local-install-root: /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2 dist-dir: .stack-work/dist/x86_64-osx/Cabal-3.4.1.0 local-hpc-root: /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/hpc local-bin-path: /Users/stefan/.local/bin ghc-paths: /Users/stefan/.stack/programs/x86_64-osx stefan@stefans-MacBook-Pro demo % stack ghci stack ghci Using main module: 1. Package `demo' component demo:exe:demo-exe with main-is file: /Users/stefan/teaching/pf-2021-2022/curs9/demo/app/Main.hs Building all executables for `demo' once. After a successful build of all of them, only specified executables will be rebuilt. demo> configure (lib + exe) Configuring demo-0.1.0.0... demo> initial-build-steps (lib + exe) The following GHC options are incompatible with GHCi and have not been passed to it: -threaded Configuring GHCi with the following packages: demo * * * * * * * * Warning: Multiple files use the same module name: * Paths_demo found at the following paths * /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build/autogen/Paths_demo.hs (demo:lib) * /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build/demo-exe/autogen/Paths_demo.hs (demo:exe:demo-exe) * * * * * * * * GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help [1 of 3] Compiling Lib ( /Users/stefan/teaching/pf-2021-2022/curs9/demo/src/Lib.hs, interpreted ) [2 of 3] Compiling Main ( /Users/stefan/teaching/pf-2021-2022/curs9/demo/app/Main.hs, interpreted ) [3 of 3] Compiling Paths_demo ( /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build/autogen/Paths_demo.hs, interpreted ) Ok, three modules loaded. Loaded GHCi configuration from /private/var/folders/fz/fc0rvjms0vdgllq7mwph1tfr0000gn/T/haskell-stack-ghci/3bda9763/ghci-script ghci> :q :q Leaving GHCi. stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:35 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % cd app cd app stefan@stefans-MacBook-Pro app % ls -al ls -al total 8 drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 . drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 .. -rw------- 1 stefan staff 61 Apr 20 18:33 Main.hs stefan@stefans-MacBook-Pro app % ec Main.hs ec Main.hs stefan@stefans-MacBook-Pro app % ls -al ls -al total 8 drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 . drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 .. -rw------- 1 stefan staff 61 Apr 20 18:33 Main.hs stefan@stefans-MacBook-Pro app % cd .. cd .. stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:35 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % cd src cd src stefan@stefans-MacBook-Pro src % ls -al ls -al total 8 drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 . drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 .. -rw------- 1 stefan staff 88 Apr 20 18:33 Lib.hs stefan@stefans-MacBook-Pro src % ec Lib.hs ec Lib.hs stefan@stefans-MacBook-Pro src % cd .. cd .. stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:35 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % stack build stack build Building all executables for `demo' once. After a successful build of all of them, only specified executables will be rebuilt. demo> build (lib + exe) Preprocessing library for demo-0.1.0.0.. Building library for demo-0.1.0.0.. [1 of 2] Compiling Lib [2 of 2] Compiling Paths_demo Preprocessing executable 'demo-exe' for demo-0.1.0.0.. Building executable 'demo-exe' for demo-0.1.0.0.. [1 of 2] Compiling Main [2 of 2] Compiling Paths_demo Linking .stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build/demo-exe/demo-exe ... demo> copy/register Installing library in /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/lib/x86_64-osx-ghc-9.0.2/demo-0.1.0.0-C5XAIqiCJc63SqPPWXiBd7 Installing executable demo-exe in /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/bin Registering library for demo-0.1.0.0.. stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:37 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % stack exec demo-exe stack exec demo-exe someFunc stefan@stefans-MacBook-Pro demo % ec src/Lib.hs ec src/Lib.hs stefan@stefans-MacBook-Pro demo % stack build stack build demo-0.1.0.0: unregistering (local file changes: src/Lib.hs) demo> build (lib + exe) Preprocessing library for demo-0.1.0.0.. Building library for demo-0.1.0.0.. [2 of 2] Compiling Lib Preprocessing executable 'demo-exe' for demo-0.1.0.0.. Building executable 'demo-exe' for demo-0.1.0.0.. [1 of 2] Compiling Main [Lib changed] Linking .stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build/demo-exe/demo-exe ... demo> copy/register Installing library in /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/lib/x86_64-osx-ghc-9.0.2/demo-0.1.0.0-C5XAIqiCJc63SqPPWXiBd7 Installing executable demo-exe in /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/bin Registering library for demo-0.1.0.0.. stefan@stefans-MacBook-Pro demo % stack exec demo-exe stack exec demo-exe Hello, World! stefan@stefans-MacBook-Pro demo % stack run stack run Hello, World! stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:37 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:38 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % cd .stack-work/ cd .stack-work/ stefan@stefans-MacBook-Pro .stack-work % ls -al ls -al total 88 drwxr-xr-x 7 stefan staff 224 Apr 20 18:37 . drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 .. drwxr-xr-x 3 stefan staff 96 Apr 20 18:35 dist drwxr-xr-x 3 stefan staff 96 Apr 20 18:35 ghci drwxr-xr-x 3 stefan staff 96 Apr 20 18:35 install -rw-r--r-- 1 stefan staff 45056 Apr 20 18:37 stack.sqlite3 -rw-r--r-- 1 stefan staff 0 Apr 20 18:34 stack.sqlite3.pantry-write-lock stefan@stefans-MacBook-Pro .stack-work % cd dist cd dist stefan@stefans-MacBook-Pro dist % ls ls x86_64-osx stefan@stefans-MacBook-Pro dist % cd x86_64-osx/ cd x86_64-osx/ stefan@stefans-MacBook-Pro x86_64-osx % ls ls Cabal-3.4.1.0 stefan@stefans-MacBook-Pro x86_64-osx % cd Cabal-3.4.1.0/ cd Cabal-3.4.1.0/ stefan@stefans-MacBook-Pro Cabal-3.4.1.0 % ls ls build setup-config stack-setup-config-mod build-lock stack-build-caches package.conf.inplace stack-cabal-mod stefan@stefans-MacBook-Pro Cabal-3.4.1.0 % cd build/ cd build/ stefan@stefans-MacBook-Pro build % ls ls Lib.dyn_hi Lib.dyn_o Lib.hi Lib.o Paths_demo.dyn_hi Paths_demo.dyn_o Paths_demo.hi Paths_demo.o autogen demo-exe libHSdemo-0.1.0.0-C5XAIqiCJc63SqPPWXiBd7-ghc9.0.2.dylib libHSdemo-0.1.0.0-C5XAIqiCJc63SqPPWXiBd7.a stefan@stefans-MacBook-Pro build % ./demo-exe/demo-exe ./demo-exe/demo-exe Hello, World! stefan@stefans-MacBook-Pro build % pwd pwd /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build stefan@stefans-MacBook-Pro build % cd .. cd .. stefan@stefans-MacBook-Pro Cabal-3.4.1.0 % cd .. cd .. stefan@stefans-MacBook-Pro x86_64-osx % cd .. cd .. stefan@stefans-MacBook-Pro dist % cd .. cd .. stefan@stefans-MacBook-Pro .stack-work % cd .. cd .. stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:33 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:37 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:38 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo %ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:40 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:37 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:38 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % ec demo.cabal ec demo.cabal stefan@stefans-MacBook-Pro demo % ec stack.yaml ec stack.yaml stefan@stefans-MacBook-Pro demo % ec package.yaml ec package.yaml stefan@stefans-MacBook-Pro demo % cd test cd test stefan@stefans-MacBook-Pro test % ls ls Spec.hs stefan@stefans-MacBook-Pro test % ec Spec.hs ec Spec.hs stefan@stefans-MacBook-Pro test % cd .. cd .. stefan@stefans-MacBook-Pro demo % stack --help stack --help stack - The Haskell Tool Stack Usage: stack [--help] [--version] [--numeric-version] [--hpack-numeric-version] [--docker*] [--nix*] [--verbosity VERBOSITY | (-v|--verbose) | --silent] [--[no-]time-in-log] [--stack-root STACK-ROOT] [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc] [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD] [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR] [--custom-preprocessor-extensions EXT] [--with-gcc PATH-TO-GCC] [--with-hpack HPACK] [--[no-]skip-ghc-check] [--[no-]skip-msys] [--local-bin-path DIR] [--setup-info-yaml URL] [--[no-]modify-code-page] [--[no-]allow-different-user] [--[no-]dump-logs] [--color|--colour WHEN] [--snapshot-location-base URL] [--resolver RESOLVER] [--compiler COMPILER] [--[no-]terminal] [--stack-colors|--stack-colours STYLES] [--terminal-width INT] [--stack-yaml STACK-YAML] [--lock-file ARG] COMMAND|FILE Available options: --help Show this help text --version Show version --numeric-version Show only version number --hpack-numeric-version Show only hpack's version number --docker* Run 'stack --docker-help' for details --nix* Run 'stack --nix-help' for details --verbosity VERBOSITY Verbosity: silent, error, warn, info, debug -v,--verbose Enable verbose mode: verbosity level "debug" --silent Enable silent mode: verbosity level "silent" --[no-]time-in-log Enable/disable inclusion of timings in logs, for the purposes of using diff with logs (default: enabled) --stack-root STACK-ROOT Absolute path to the global stack root directory (Overrides any STACK_ROOT environment variable) --work-dir WORK-DIR Relative path of work directory (Overrides any STACK_WORK environment variable, default is '.stack-work') --[no-]system-ghc Enable/disable using the system installed GHC (on the PATH) if it is available and its version matches. Disabled by default. --[no-]install-ghc Enable/disable downloading and installing GHC if necessary (can be done manually with stack setup) (default: enabled) --arch ARCH System architecture, e.g. i386, x86_64 --ghc-variant VARIANT Specialized GHC variant, e.g. integersimple (incompatible with --system-ghc) --ghc-build BUILD Specialized GHC build, e.g. 'gmp4' or 'standard' (usually auto-detected) -j,--jobs JOBS Number of concurrent jobs to run --extra-include-dirs DIR Extra directories to check for C header files --extra-lib-dirs DIR Extra directories to check for libraries --custom-preprocessor-extensions EXT Extensions used for custom preprocessors --with-gcc PATH-TO-GCC Use gcc found at PATH-TO-GCC --with-hpack HPACK Use HPACK executable (overrides bundled Hpack) --[no-]skip-ghc-check Enable/disable skipping the GHC version and architecture check (default: disabled) --[no-]skip-msys Enable/disable skipping the local MSYS installation (Windows only) (default: disabled) --local-bin-path DIR Install binaries to DIR --setup-info-yaml URL Alternate URL or relative / absolute path for stack dependencies --[no-]modify-code-page Enable/disable setting the codepage to support UTF-8 (Windows only) (default: enabled) --[no-]allow-different-user Enable/disable permission for users other than the owner of the stack root directory to use a stack installation (POSIX only) (default: true inside Docker, otherwise false) --[no-]dump-logs Enable/disable dump the build output logs for local packages to the console (default: dump warning logs) --color,--colour WHEN Specify when to use color in output; WHEN is 'always', 'never', or 'auto'. On Windows versions before Windows 10, for terminals that do not support color codes, the default is 'never'; color may work on terminals that support color codes --snapshot-location-base URL The base location of LTS/Nightly snapshots --resolver RESOLVER Override resolver in project file --compiler COMPILER Use the specified compiler --[no-]terminal Enable/disable overriding terminal detection in the case of running in a false terminal --stack-colors,--stack-colours STYLES Specify stack's output styles; STYLES is a colon-delimited sequence of key=value, where 'key' is a style name and 'value' is a semicolon-delimited list of 'ANSI' SGR (Select Graphic Rendition) control codes (in decimal). Use 'stack ls stack-colors --basic' to see the current sequence. In shells where a semicolon is a command separator, enclose STYLES in quotes. --terminal-width INT Specify the width of the terminal, used for pretty-print messages --stack-yaml STACK-YAML Override project stack.yaml file (overrides any STACK_YAML environment variable) --lock-file ARG Specify how to interact with lock files. Default: read/write. If resolver is overridden: read-only Available commands: build Build the package(s) in this directory/configuration install Shortcut for 'build --copy-bins' uninstall DEPRECATED: This command performs no actions, and is present for documentation only test Shortcut for 'build --test' bench Shortcut for 'build --bench' haddock Shortcut for 'build --haddock' new Create a new project from a template. Run `stack templates' to see available templates. Note: you can also specify a local file or a remote URL as a template. templates Show how to find templates available for `stack new'. `stack new' can accept a template from a remote repository (default: github), local file or remote URL. Note: this downloads the help file. init Create stack project config from cabal or hpack package specifications setup Get the appropriate GHC for your project path Print out handy path information ls List command. (Supports snapshots, dependencies and stack's styles) unpack Unpack one or more packages locally update Update the package index upgrade Upgrade to the latest stack upload Upload a package to Hackage sdist Create source distribution tarballs dot Visualize your project's dependency graph using Graphviz dot ghc Run ghc hoogle Run hoogle, the Haskell API search engine. Use the '-- ARGUMENT(S)' syntax to pass Hoogle arguments, e.g. stack hoogle -- --count=20, or stack hoogle -- server --local. exec Execute a command. If the command is absent, the first of any arguments is taken as the command. run Build and run an executable. Defaults to the first available executable if none is provided as the first argument. ghci Run ghci in the context of package(s) (experimental) repl Run ghci in the context of package(s) (experimental) (alias for 'ghci') runghc Run runghc runhaskell Run runghc (alias for 'runghc') script Run a Stack Script eval Evaluate some haskell code inline. Shortcut for 'stack exec ghc -- -e CODE' clean Delete build artefacts for the project packages. purge Delete the project stack working directories (.stack-work by default). Shortcut for 'stack clean --full' query Query general build information (experimental) list List package id's in snapshot (experimental) ide IDE-specific commands docker Subcommands specific to Docker use config Subcommands for accessing and modifying configuration values hpc Subcommands specific to Haskell Program Coverage stack's documentation is available at https://docs.haskellstack.org/ stefan@stefans-MacBook-Pro demo % stack test stack test demo-0.1.0.0: unregistering (components added: test:demo-test) demo> configure (lib + exe + test) Configuring demo-0.1.0.0... demo> build (lib + exe + test) Preprocessing library for demo-0.1.0.0.. Building library for demo-0.1.0.0.. Preprocessing executable 'demo-exe' for demo-0.1.0.0.. Building executable 'demo-exe' for demo-0.1.0.0.. Preprocessing test suite 'demo-test' for demo-0.1.0.0.. Building test suite 'demo-test' for demo-0.1.0.0.. [1 of 2] Compiling Main [2 of 2] Compiling Paths_demo Linking .stack-work/dist/x86_64-osx/Cabal-3.4.1.0/build/demo-test/demo-test ... demo> copy/register Installing library in /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/lib/x86_64-osx-ghc-9.0.2/demo-0.1.0.0-C5XAIqiCJc63SqPPWXiBd7 Installing executable demo-exe in /Users/stefan/teaching/pf-2021-2022/curs9/demo/.stack-work/install/x86_64-osx/9aeb53f2c52bea9d45f1cbe10ef78af73e82726e036c5af5da8d0cc4b8b61ae2/9.0.2/bin Registering library for demo-0.1.0.0.. demo> test (suite: demo-test) Progress 1/2: demoTest suite not yet implemented demo> Test suite demo-test passed Completed 2 action(s). stefan@stefans-MacBook-Pro demo % cat test/Spec.hs cat test/Spec.hs main :: IO () main = putStrLn "Test suite not yet implemented" stefan@stefans-MacBook-Pro demo % ls -al ls -al total 72 drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 . drwxr-xr-x 10 stefan staff 320 Apr 20 18:40 .. -rw------- 1 stefan staff 15 Apr 20 18:33 .gitignore drwxr-xr-x 7 stefan staff 224 Apr 20 18:44 .stack-work -rw------- 1 stefan staff 44 Apr 20 18:33 ChangeLog.md -rw------- 1 stefan staff 1529 Apr 20 18:33 LICENSE -rw------- 1 stefan staff 7 Apr 20 18:33 README.md -rw------- 1 stefan staff 46 Apr 20 18:33 Setup.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 app -rw-r--r-- 1 stefan staff 1375 Apr 20 18:33 demo.cabal -rw------- 1 stefan staff 1149 Apr 20 18:33 package.yaml drwxr-xr-x 3 stefan staff 96 Apr 20 18:38 src -rw------- 1 stefan staff 2208 Apr 20 18:34 stack.yaml -rw------- 1 stefan staff 539 Apr 20 18:34 stack.yaml.lock drwxr-xr-x 3 stefan staff 96 Apr 20 18:33 test stefan@stefans-MacBook-Pro demo % stack --help stack --help stack - The Haskell Tool Stack Usage: stack [--help] [--version] [--numeric-version] [--hpack-numeric-version] [--docker*] [--nix*] [--verbosity VERBOSITY | (-v|--verbose) | --silent] [--[no-]time-in-log] [--stack-root STACK-ROOT] [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc] [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD] [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR] [--custom-preprocessor-extensions EXT] [--with-gcc PATH-TO-GCC] [--with-hpack HPACK] [--[no-]skip-ghc-check] [--[no-]skip-msys] [--local-bin-path DIR] [--setup-info-yaml URL] [--[no-]modify-code-page] [--[no-]allow-different-user] [--[no-]dump-logs] [--color|--colour WHEN] [--snapshot-location-base URL] [--resolver RESOLVER] [--compiler COMPILER] [--[no-]terminal] [--stack-colors|--stack-colours STYLES] [--terminal-width INT] [--stack-yaml STACK-YAML] [--lock-file ARG] COMMAND|FILE Available options: --help Show this help text --version Show version --numeric-version Show only version number --hpack-numeric-version Show only hpack's version number --docker* Run 'stack --docker-help' for details --nix* Run 'stack --nix-help' for details --verbosity VERBOSITY Verbosity: silent, error, warn, info, debug -v,--verbose Enable verbose mode: verbosity level "debug" --silent Enable silent mode: verbosity level "silent" --[no-]time-in-log Enable/disable inclusion of timings in logs, for the purposes of using diff with logs (default: enabled) --stack-root STACK-ROOT Absolute path to the global stack root directory (Overrides any STACK_ROOT environment variable) --work-dir WORK-DIR Relative path of work directory (Overrides any STACK_WORK environment variable, default is '.stack-work') --[no-]system-ghc Enable/disable using the system installed GHC (on the PATH) if it is available and its version matches. Disabled by default. --[no-]install-ghc Enable/disable downloading and installing GHC if necessary (can be done manually with stack setup) (default: enabled) --arch ARCH System architecture, e.g. i386, x86_64 --ghc-variant VARIANT Specialized GHC variant, e.g. integersimple (incompatible with --system-ghc) --ghc-build BUILD Specialized GHC build, e.g. 'gmp4' or 'standard' (usually auto-detected) -j,--jobs JOBS Number of concurrent jobs to run --extra-include-dirs DIR Extra directories to check for C header files --extra-lib-dirs DIR Extra directories to check for libraries --custom-preprocessor-extensions EXT Extensions used for custom preprocessors --with-gcc PATH-TO-GCC Use gcc found at PATH-TO-GCC --with-hpack HPACK Use HPACK executable (overrides bundled Hpack) --[no-]skip-ghc-check Enable/disable skipping the GHC version and architecture check (default: disabled) --[no-]skip-msys Enable/disable skipping the local MSYS installation (Windows only) (default: disabled) --local-bin-path DIR Install binaries to DIR --setup-info-yaml URL Alternate URL or relative / absolute path for stack dependencies --[no-]modify-code-page Enable/disable setting the codepage to support UTF-8 (Windows only) (default: enabled) --[no-]allow-different-user Enable/disable permission for users other than the owner of the stack root directory to use a stack installation (POSIX only) (default: true inside Docker, otherwise false) --[no-]dump-logs Enable/disable dump the build output logs for local packages to the console (default: dump warning logs) --color,--colour WHEN Specify when to use color in output; WHEN is 'always', 'never', or 'auto'. On Windows versions before Windows 10, for terminals that do not support color codes, the default is 'never'; color may work on terminals that support color codes --snapshot-location-base URL The base location of LTS/Nightly snapshots --resolver RESOLVER Override resolver in project file --compiler COMPILER Use the specified compiler --[no-]terminal Enable/disable overriding terminal detection in the case of running in a false terminal --stack-colors,--stack-colours STYLES Specify stack's output styles; STYLES is a colon-delimited sequence of key=value, where 'key' is a style name and 'value' is a semicolon-delimited list of 'ANSI' SGR (Select Graphic Rendition) control codes (in decimal). Use 'stack ls stack-colors --basic' to see the current sequence. In shells where a semicolon is a command separator, enclose STYLES in quotes. --terminal-width INT Specify the width of the terminal, used for pretty-print messages --stack-yaml STACK-YAML Override project stack.yaml file (overrides any STACK_YAML environment variable) --lock-file ARG Specify how to interact with lock files. Default: read/write. If resolver is overridden: read-only Available commands: build Build the package(s) in this directory/configuration install Shortcut for 'build --copy-bins' uninstall DEPRECATED: This command performs no actions, and is present for documentation only test Shortcut for 'build --test' bench Shortcut for 'build --bench' haddock Shortcut for 'build --haddock' new Create a new project from a template. Run `stack templates' to see available templates. Note: you can also specify a local file or a remote URL as a template. templates Show how to find templates available for `stack new'. `stack new' can accept a template from a remote repository (default: github), local file or remote URL. Note: this downloads the help file. init Create stack project config from cabal or hpack package specifications setup Get the appropriate GHC for your project path Print out handy path information ls List command. (Supports snapshots, dependencies and stack's styles) unpack Unpack one or more packages locally update Update the package index upgrade Upgrade to the latest stack upload Upload a package to Hackage sdist Create source distribution tarballs dot Visualize your project's dependency graph using Graphviz dot ghc Run ghc hoogle Run hoogle, the Haskell API search engine. Use the '-- ARGUMENT(S)' syntax to pass Hoogle arguments, e.g. stack hoogle -- --count=20, or stack hoogle -- server --local. exec Execute a command. If the command is absent, the first of any arguments is taken as the command. run Build and run an executable. Defaults to the first available executable if none is provided as the first argument. ghci Run ghci in the context of package(s) (experimental) repl Run ghci in the context of package(s) (experimental) (alias for 'ghci') runghc Run runghc runhaskell Run runghc (alias for 'runghc') script Run a Stack Script eval Evaluate some haskell code inline. Shortcut for 'stack exec ghc -- -e CODE' clean Delete build artefacts for the project packages. purge Delete the project stack working directories (.stack-work by default). Shortcut for 'stack clean --full' query Query general build information (experimental) list List package id's in snapshot (experimental) ide IDE-specific commands docker Subcommands specific to Docker use config Subcommands for accessing and modifying configuration values hpc Subcommands specific to Haskell Program Coverage stack's documentation is available at https://docs.haskellstack.org/ stefan@stefans-MacBook-Pro demo % cd .. cd .. stefan@stefans-MacBook-Pro curs9 % ls -al ls -al total 2696 drwxr-xr-x 10 stefan staff 320 Apr 20 18:46 . drwxr-xr-x 16 stefan staff 512 Apr 20 15:39 .. -rwxr-xr-x 1 stefan staff 1352784 Apr 20 18:16 curs9 -rw-r--r-- 1 stefan staff 1162 Apr 20 18:16 curs9.hi -rw-r--r-- 1 stefan staff 1190 Apr 20 18:46 curs9.hs -rw-r--r-- 1 stefan staff 11296 Apr 20 18:16 curs9.o drwxr-xr-x 15 stefan staff 480 Apr 20 18:34 demo drwxr-xr-x 15 stefan staff 480 Apr 20 15:40 my-test-project -rw-r--r-- 1 stefan staff 332 Apr 20 18:30 nat.hs drwxr-xr-x 3 stefan staff 96 Apr 20 18:21 utils stefan@stefans-MacBook-Pro curs9 % ghci ghci GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help Prelude> :l curs9 :l curs9 [1 of 3] Compiling Nat ( Nat.hs, interpreted ) [2 of 3] Compiling Utils.Intreg ( Utils/Intreg.hs, interpreted ) [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:41:34: error: • No instance for (Num [Int]) arising from a use of ‘+’ • In the second argument of ‘(++)’, namely ‘[x] + (filter (> x) xs)’ In the expression: (filter (<= x) xs) ++ [x] + (filter (> x) xs) In an equation for ‘qs’: qs (x : xs) = (filter (<= x) xs) ++ [x] + (filter (> x) xs) | 41 | qs (x:xs) = (filter (<=x) xs) ++ [x] + (filter (>x) xs) | ^^^^^^^^^^^^^^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> qs [3,7,6] qs [3,7,6] [3,7,6] *Main> qs [3,7,5,6] qs [3,7,5,6] [3,7,5,6] *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> qs' [3, 7, 5, 6] qs' [3, 7, 5, 6] *** Exception: curs9.hs:44:1-69: Non-exhaustive patterns in function qs' *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> qs' [3, 7, 5, 6] qs' [3, 7, 5, 6] [3,5,6,7] *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:51:32: error: • Couldn't match expected type ‘Bool’ with actual type ‘[Bool]’ • In the second argument of ‘(&&)’, namely ‘(sorted y : xs)’ In the expression: (x <= y) && (sorted y : xs) In an equation for ‘sorted’: sorted (x : y : xs) = (x <= y) && (sorted y : xs) | 51 | sorted (x:y:xs) = (x <= y) && (sorted y:xs) | ^^^^^^^^^^^ curs9.hs:51:39: error: • Couldn't match expected type ‘[Int]’ with actual type ‘Int’ • In the first argument of ‘sorted’, namely ‘y’ In the first argument of ‘(:)’, namely ‘sorted y’ In the second argument of ‘(&&)’, namely ‘(sorted y : xs)’ | 51 | sorted (x:y:xs) = (x <= y) && (sorted y:xs) | ^ curs9.hs:51:41: error: • Couldn't match type ‘Int’ with ‘Bool’ Expected type: [Bool] Actual type: [Int] • In the second argument of ‘(:)’, namely ‘xs’ In the second argument of ‘(&&)’, namely ‘(sorted y : xs)’ In the expression: (x <= y) && (sorted y : xs) | 51 | sorted (x:y:xs) = (x <= y) && (sorted y:xs) | ^^ Failed, two modules loaded. *Utils.Intreg> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> sorted [4, 7, 8] sorted [4, 7, 8] True *Main> sorted [4, 6, 7, 8] sorted [4, 6, 7, 8] True *Main> sorted [4, 6, 7, 5, 8] sorted [4, 6, 7, 5, 8] False *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> testqs' [4,7,3] testqs' [4,7,3] True *Main> testqs' [4,7,3,2] testqs' [4,7,3,2] True *Main> testqs' [4,7,3,2,9] testqs' [4,7,3,2,9] True *Main> testqs' [4,7,3,10,2,9] testqs' [4,7,3,10,2,9] True *Main> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main> testqs [3, 7, 3] testqs [3, 7, 3] True *Main> qs [3, 7, 3] qs [3, 7, 3] [3,3,7] *Main> testqs [3, 5, 7, 3] testqs [3, 5, 7, 3] True *Main> testqs [3, 5, 7, 3, 6] testqs [3, 5, 7, 3, 6] False *Main> :m + Test.QuickCheck :m + Test.QuickCheck : error: Could not find module ‘Test.QuickCheck’ It is not a module in the current program, or in any known package. *Main> :q :q Leaving GHCi. stefan@stefans-MacBook-Pro curs9 % stack ghci stack ghci Note: No local targets specified, so a plain ghci will be started with no package hiding or package options. You are using snapshot: lts-17.8 If you want to use package hiding and options, then you can try one of the following: * If you want to start a different project configuration than /Users/stefan/.stack/global-project/stack.yaml, then you can use stack init to create a new stack.yaml for the packages in the current directory. * If you want to use the project configuration at /Users/stefan/.stack/global-project/stack.yaml, then you can add to its 'packages' field. Configuring GHCi with the following packages: GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /private/var/folders/fz/fc0rvjms0vdgllq7mwph1tfr0000gn/T/haskell-stack-ghci/2a3bbd58/ghci-script Prelude> :m + Test.QuickCheck :m + Test.QuickCheck Prelude Test.QuickCheck> quickCheck testqs' quickCheck testqs' :2:12: error: Variable not in scope: testqs' Prelude Test.QuickCheck> :l curs9 :l curs9 [1 of 3] Compiling Nat ( Nat.hs, interpreted ) [2 of 3] Compiling Utils.Intreg ( Utils/Intreg.hs, interpreted ) [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs' quickCheck testqs' +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 7 tests and 4 shrinks): [0,2,1] *Main Test.QuickCheck> testqs [0,2,1] testqs [0,2,1] False *Main Test.QuickCheck> qs [0,2,1] qs [0,2,1] [0,2,1] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 7 tests and 6 shrinks): [0,0,-1] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 11 tests and 7 shrinks): [0,0,-1] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 6 tests and 4 shrinks): [1,1,0] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 10 tests and 7 shrinks): [0,0,-1] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 11 tests and 7 shrinks): [0,0,-1] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 9 tests and 9 shrinks): [-1,1,0] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 6 tests and 5 shrinks): [0,2,1] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 5 tests and 1 shrink): [0,2,1] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 9 tests and 8 shrinks): [-2,0,-1] *Main Test.QuickCheck> quickCheck testqs quickCheck testqs *** Failed! Falsified (after 9 tests and 6 shrinks): [-2,0,-1] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs'1 quickCheck testqs'1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck testqs'1 quickCheck testqs'1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck testqs'1 quickCheck testqs'1 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 *** Failed! Falsified (after 7 tests and 2 shrinks): [-3,-3] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> :r :r Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 *** Failed! Falsified (after 6 tests and 2 shrinks): [-4,-4] *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 *** Failed! Falsified (after 12 tests and 3 shrinks): [-2,-2] *Main Test.QuickCheck> quickCheck testqs1 quickCheck testqs1 *** Failed! Falsified (after 7 tests and 2 shrinks): [0,0] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> convert 3 convert 3 Succ (Succ (Succ Zero)) *Main Test.QuickCheck> convert 13 convert 13 Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero)))))))))))) *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> convert' Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero)))))))))))) c (Succ (Succ (Succ (Succ (Succ Zero)))))))))))) :41:10: error: • Data constructor not in scope: Succ :: Nat.Nat • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:16: error: • Data constructor not in scope: Succ :: t1 -> t0 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:22: error: • Data constructor not in scope: Succ :: t2 -> t1 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:28: error: • Data constructor not in scope: Succ :: t3 -> t2 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:34: error: • Data constructor not in scope: Succ :: t4 -> t3 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:40: error: • Data constructor not in scope: Succ :: t5 -> t4 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:46: error: • Data constructor not in scope: Succ :: t6 -> t5 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:52: error: • Data constructor not in scope: Succ :: t7 -> t6 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:58: error: • Data constructor not in scope: Succ :: t8 -> t7 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:64: error: • Data constructor not in scope: Succ :: t9 -> t8 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:70: error: • Data constructor not in scope: Succ :: t10 -> t9 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:76: error: • Data constructor not in scope: Succ :: t11 -> t10 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:82: error: • Data constructor not in scope: Succ :: t12 -> t11 • Perhaps you meant one of these: ‘Nat.Succ’ (imported from Nat), variable ‘succ’ (imported from Prelude) :41:87: error: • Data constructor not in scope: Zero • Perhaps you meant ‘Nat.Zero’ (imported from Nat) *Main Test.QuickCheck> convert' (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ (Nat.Succ Nat.Zero))))))))))))) at.Succ Nat.Zero))))))))))))) 13 *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> prop1 3 prop1 3 True *Main Test.QuickCheck> prop1 13 prop1 13 True *Main Test.QuickCheck> prop1 10 prop1 10 True *Main Test.QuickCheck> quickCheck prop1 quickCheck prop1 ^C ^C^CInterrupted. *Main Test.QuickCheck> prop1 (-10) prop1 (-10) ^C ^C^CInterrupted. *Main Test.QuickCheck> convert (-10) convert (-10) Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ ^C ^C^C (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (SuccInterrupted. *Main Test.QuickCheck> ^C ^C *Main Test.QuickCheck> ^C ^C *Main Test.QuickCheck> ^C ^C *Main Test.QuickCheck> ^C ^C *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> prop1 (-10) prop1 (-10) True *Main Test.QuickCheck> :r :r Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop1 quickCheck prop1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop1 quickCheck prop1 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop1 quickCheck prop1 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:86:9: error: • Conflicting definitions for ‘y’ Bound at: curs9.hs:86:9 curs9.hs:86:15 • In an equation for ‘insert’ | 86 | insert (y:ys) y = if x <= y then x:y:ys | ^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:87:44: error: • Couldn't match expected type ‘[Int]’ with actual type ‘Int’ • In the first argument of ‘insert’, namely ‘x’ In the second argument of ‘(:)’, namely ‘(insert x ys)’ In the expression: y : (insert x ys) | 87 | else y:(insert x ys) | ^ curs9.hs:87:46: error: • Couldn't match expected type ‘Int’ with actual type ‘[Int]’ • In the second argument of ‘insert’, namely ‘ys’ In the second argument of ‘(:)’, namely ‘(insert x ys)’ In the expression: y : (insert x ys) | 87 | else y:(insert x ys) | ^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> insert 3 [1,4,7] insert 3 [1,4,7] [1,3,4,7] *Main Test.QuickCheck> insert 0 [1,4,7] insert 0 [1,4,7] [0,1,4,7] *Main Test.QuickCheck> insert 9 [1,4,7] insert 9 [1,4,7] [1,4,7,9] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:90:13: error: • Couldn't match expected type ‘[Int]’ with actual type ‘Bool’ • In the expression: sorted (insert x l) In an equation for ‘prop2’: prop2 x l = sorted (insert x l) | 90 | prop2 x l = sorted (insert x l) | ^^^^^^^^^^^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:90:13: error: • Couldn't match expected type ‘[Int]’ with actual type ‘Bool’ • In the expression: sorted (insert x l) In an equation for ‘prop2’: prop2 x l = sorted (insert x l) | 90 | prop2 x l = sorted (insert x l) | ^^^^^^^^^^^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 5 tests and 4 shrinks): 0 [1,0] *Main Test.QuickCheck> insert 0 [1, 0] insert 0 [1, 0] [0,1,0] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:90:14: error: Variable not in scope: (!) :: t0 -> Bool -> t1 | 90 | prop2 x l = (!sorted l) || sorted (insert x l) | ^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :t not :t not not :: Bool -> Bool *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 4 tests and 3 shrinks): 0 [1] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 12 tests and 4 shrinks): 0 [1] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 11 tests and 6 shrinks): 0 [1] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 25 tests and 4 shrinks): 0 [1] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 1 test): 0 [] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 3 tests and 2 shrinks): 0 [0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 2 tests and 1 shrink): 0 [0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 2 tests and 1 shrink): 0 [0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 3 tests and 3 shrinks): 0 [0] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 7 tests and 2 shrinks): 0 [0,0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 3 tests and 3 shrinks): 0 [0,0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 3 tests and 2 shrinks): 0 [0,0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 9 tests and 8 shrinks): 0 [0,0] *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 20 tests and 5 shrinks): 0 [0,0] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> p p :115:1: error: Variable not in scope: p *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 *** Failed! Falsified (after 2 tests): 0 [-1] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop2 quickCheck prop2 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:95:13: error: • Couldn't match expected type ‘Bool’ with actual type ‘Property’ • In the expression: (not (sorted l)) ==> sorted (insert x l) In an equation for ‘prop3’: prop3 x l = (not (sorted l)) ==> sorted (insert x l) | 95 | prop3 x l = (not (sorted l)) ==> sorted (insert x l) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :t (==>) :t (==>) (==>) :: Testable prop => Bool -> prop -> Property *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop3 quickCheck prop3 *** Failed! Falsified (after 1 test and 2 shrinks): 0 [0,-1] *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop3 quickCheck prop3 *** Gave up! Passed only 69 tests; 1000 discarded tests. *Main Test.QuickCheck> quickCheck prop3 quickCheck prop3 *** Gave up! Passed only 82 tests; 1000 discarded tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop1' quickCheck prop1' *** Exception: stack overflow *Main Test.QuickCheck> ^C ^C *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop1' quickCheck prop1' +++ OK, passed 100 tests; 64 discarded. *Main Test.QuickCheck> quickCheck prop1' quickCheck prop1' +++ OK, passed 100 tests; 91 discarded. *Main Test.QuickCheck> quickCheck prop1' quickCheck prop1' +++ OK, passed 100 tests; 111 discarded. *Main Test.QuickCheck> quickCheck prop1' quickCheck prop1' +++ OK, passed 100 tests; 83 discarded. *Main Test.QuickCheck> quickCheck prop1' quickCheck prop1' +++ OK, passed 100 tests; 107 discarded. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:100:1: error: The type signature for ‘prop4’ lacks an accompanying binding Perhaps you meant one of these: ‘prop1’ (Defined at curs9.hs:80:1), ‘prop2’ (Defined at curs9.hs:93:1), ‘prop3’ (Defined at curs9.hs:98:1) | 100 | prop4 :: Nat -> Property | ^^^^^ curs9.hs:100:10: error: Not in scope: type constructor or class ‘Nat’ Perhaps you meant ‘Nat.Nat’ (imported from Nat) | 100 | prop4 :: Nat -> Property | ^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:100:1: error: The type signature for ‘prop4’ lacks an accompanying binding Perhaps you meant one of these: ‘prop1’ (Defined at curs9.hs:80:1), ‘prop2’ (Defined at curs9.hs:93:1), ‘prop3’ (Defined at curs9.hs:98:1) | 100 | prop4 :: Nat -> Bool | ^^^^^ curs9.hs:100:10: error: Not in scope: type constructor or class ‘Nat’ Perhaps you meant ‘Nat.Nat’ (imported from Nat) | 100 | prop4 :: Nat -> Bool | ^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:100:1: error: The type signature for ‘prop4’ lacks an accompanying binding Perhaps you meant one of these: ‘prop1’ (Defined at curs9.hs:80:1), ‘prop2’ (Defined at curs9.hs:93:1), ‘prop3’ (Defined at curs9.hs:98:1) | 100 | prop4 :: Nat.Nat -> Bool | ^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop4 quickCheck prop4 :140:1: error: • No instance for (Arbitrary Nat.Nat) arising from a use of ‘quickCheck’ • In the expression: quickCheck prop4 In an equation for ‘it’: it = quickCheck prop4 *Main Test.QuickCheck> :i Arbitrary :i Arbitrary type Arbitrary :: * -> Constraint class Arbitrary a where arbitrary :: Gen a shrink :: a -> [a] {-# MINIMAL arbitrary #-} -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary UnicodeString -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Arbitrary a, Ord a) => Arbitrary (SortedList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Smart a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Integral a => Arbitrary (Small a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Arbitrary a, ShrinkState s a) => Arbitrary (Shrinking s a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Shrink2 a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary PrintableString -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (Positive a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Ord a, Arbitrary a) => Arbitrary (OrderedList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Eq a, Arbitrary a) => Arbitrary (NonZero a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (NonPositive a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (NonNegative a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (NonEmptyList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (Negative a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Integral a, Bounded a) => Arbitrary (Large a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (InfiniteList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Fixed a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Blind a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary ASCIIString -- Defined in ‘Test.QuickCheck.Modifiers’ instance [safe] (Function a, CoArbitrary a, Arbitrary b) => Arbitrary (Fun a b) -- Defined in ‘Test.QuickCheck.Function’ instance Arbitrary a => Arbitrary [a] -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Word -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Ordering -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary a => Arbitrary (Maybe a) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Integer -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Int -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Float -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b) => Arbitrary (Either a b) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Double -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Char -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Bool -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (CoArbitrary a, Arbitrary b) => Arbitrary (a -> b) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h, Arbitrary i, Arbitrary j) => Arbitrary (a, b, c, d, e, f, g, h, i, j) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h, Arbitrary i) => Arbitrary (a, b, c, d, e, f, g, h, i) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h) => Arbitrary (a, b, c, d, e, f, g, h) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g) => Arbitrary (a, b, c, d, e, f, g) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f) => Arbitrary (a, b, c, d, e, f) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e) => Arbitrary (a, b, c, d, e) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => Arbitrary (a, b, c, d) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c) => Arbitrary (a, b, c) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b) => Arbitrary (a, b) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary () -- Defined in ‘Test.QuickCheck.Arbitrary’ *Main Test.QuickCheck> :i Gen :i Gen type Gen :: * -> * newtype Gen a = Test.QuickCheck.Gen.MkGen {Test.QuickCheck.Gen.unGen :: Test.QuickCheck.Random.QCGen -> Int -> a} -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Applicative Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Functor Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Monad Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Testable prop => Testable (Gen prop) -- Defined in ‘Test.QuickCheck.Property’ *Main Test.QuickCheck> :i Test.QuickCheck.Random.QCGen :i Test.QuickCheck.Random.QCGen type Test.QuickCheck.Random.QCGen :: * newtype Test.QuickCheck.Random.QCGen = Test.QuickCheck.Random.QCGen System.Random.SplitMix.SMGen -- Defined in ‘Test.QuickCheck.Random’ instance Show Test.QuickCheck.Random.QCGen -- Defined in ‘Test.QuickCheck.Random’ instance Read Test.QuickCheck.Random.QCGen -- Defined in ‘Test.QuickCheck.Random’ instance Arbitrary Test.QuickCheck.Random.QCGen -- Defined in ‘Test.QuickCheck.Arbitrary’ *Main Test.QuickCheck> :i System.Random.SplitMix.SMGen :i System.Random.SplitMix.SMGen type System.Random.SplitMix.SMGen :: * data System.Random.SplitMix.SMGen = System.Random.SplitMix.SMGen {-# UNPACK #-}GHC.Word.Word64 {-# UNPACK #-}GHC.Word.Word64 -- Defined in ‘System.Random.SplitMix’ instance Show System.Random.SplitMix.SMGen -- Defined in ‘System.Random.SplitMix’ instance Read System.Random.SplitMix.SMGen -- Defined in ‘System.Random.SplitMix’ *Main Test.QuickCheck> :i Gen :i Gen type Gen :: * -> * newtype Gen a = Test.QuickCheck.Gen.MkGen {Test.QuickCheck.Gen.unGen :: Test.QuickCheck.Random.QCGen -> Int -> a} -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Applicative Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Functor Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Monad Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Testable prop => Testable (Gen prop) -- Defined in ‘Test.QuickCheck.Property’ *Main Test.QuickCheck> :i Arbitrary :i Arbitrary type Arbitrary :: * -> Constraint class Arbitrary a where arbitrary :: Gen a shrink :: a -> [a] {-# MINIMAL arbitrary #-} -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary UnicodeString -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Arbitrary a, Ord a) => Arbitrary (SortedList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Smart a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Integral a => Arbitrary (Small a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Arbitrary a, ShrinkState s a) => Arbitrary (Shrinking s a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Shrink2 a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary PrintableString -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (Positive a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Ord a, Arbitrary a) => Arbitrary (OrderedList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Eq a, Arbitrary a) => Arbitrary (NonZero a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (NonPositive a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (NonNegative a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (NonEmptyList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Num a, Ord a, Arbitrary a) => Arbitrary (Negative a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance (Integral a, Bounded a) => Arbitrary (Large a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (InfiniteList a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Fixed a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary a => Arbitrary (Blind a) -- Defined in ‘Test.QuickCheck.Modifiers’ instance Arbitrary ASCIIString -- Defined in ‘Test.QuickCheck.Modifiers’ instance [safe] (Function a, CoArbitrary a, Arbitrary b) => Arbitrary (Fun a b) -- Defined in ‘Test.QuickCheck.Function’ instance Arbitrary a => Arbitrary [a] -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Word -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Ordering -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary a => Arbitrary (Maybe a) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Integer -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Int -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Float -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b) => Arbitrary (Either a b) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Double -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Char -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary Bool -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (CoArbitrary a, Arbitrary b) => Arbitrary (a -> b) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h, Arbitrary i, Arbitrary j) => Arbitrary (a, b, c, d, e, f, g, h, i, j) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h, Arbitrary i) => Arbitrary (a, b, c, d, e, f, g, h, i) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g, Arbitrary h) => Arbitrary (a, b, c, d, e, f, g, h) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f, Arbitrary g) => Arbitrary (a, b, c, d, e, f, g) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f) => Arbitrary (a, b, c, d, e, f) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e) => Arbitrary (a, b, c, d, e) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => Arbitrary (a, b, c, d) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b, Arbitrary c) => Arbitrary (a, b, c) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance (Arbitrary a, Arbitrary b) => Arbitrary (a, b) -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary () -- Defined in ‘Test.QuickCheck.Arbitrary’ *Main Test.QuickCheck> :i Gen :i Gen type Gen :: * -> * newtype Gen a = Test.QuickCheck.Gen.MkGen {Test.QuickCheck.Gen.unGen :: Test.QuickCheck.Random.QCGen -> Int -> a} -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Applicative Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Functor Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Monad Gen -- Defined in ‘Test.QuickCheck.Gen’ instance [safe] Testable prop => Testable (Gen prop) -- Defined in ‘Test.QuickCheck.Property’ *Main Test.QuickCheck> :i oneOf :i oneOf :1:1: error: Not in scope: ‘oneOf’ *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:108:23: error: parse error on input ‘where’ | 108 | instace Arbitrary Nat where | ^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :i oneOf :i oneOf :1:1: error: Not in scope: ‘oneOf’ *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> :i oneOf :i oneOf :1:1: error: Not in scope: ‘oneOf’ *Main Test.QuickCheck> :i oneof :i oneof oneof :: [Gen a] -> Gen a -- Defined in ‘Test.QuickCheck.Gen’ *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:108:23: error: parse error on input ‘where’ | 108 | instace Arbitrary Nat where | ^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:108:23: error: parse error on input ‘where’ | 108 | instace Arbitrary Nat where | ^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :i Nat :i Nat :1:1: error: Not in scope: ‘Nat’ *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:108:27: error: parse error on input ‘where’ | 108 | instace Arbitrary Nat.Nat where | ^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:109:15: error: • Variable not in scope: oneOf :: [m0 Nat.Nat] -> Gen Nat.Nat • Perhaps you meant ‘oneof’ (imported from Test.QuickCheck) | 109 | arbitrary = oneOf [ return Nat.Zero, return (Nat.Succ Nat.Zero), return (Nat.Succ (Nat.Succ Nat.Zero)) ] | ^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop4 quickCheck prop4 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop4 quickCheck prop4 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop4 quickCheck prop4 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop4 quickCheck prop4 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop4 quickCheck prop4 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 +++ OK, passed 100 tests. *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 +++ OK, passed 100 tests. *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 *** Failed! Falsified (after 5 tests): Succ (Succ (Succ Zero)) *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 *** Failed! Falsified (after 3 tests): Succ (Succ (Succ Zero)) *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 *** Failed! Falsified (after 4 tests): Succ (Succ (Succ Zero)) *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 *** Failed! Falsified (after 2 tests): Succ (Succ (Succ Zero)) *Main Test.QuickCheck> quickCheck prop5 quickCheck prop5 *** Failed! Falsified (after 2 tests): Succ (Succ (Succ Zero)) *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:61:29: error: Variable not in scope: trivial :: Bool -> Bool -> Bool | 61 | testqs' l = (length l <= 1) `trivial` sorted (qs' l) | ^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:61:29: error: Variable not in scope: trivial :: Bool -> Bool -> Property | 61 | testqs' l = (length l <= 1) `trivial` sorted (qs' l) | ^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :i trivial :i trivial :1:1: error: Not in scope: ‘trivial’ *Utils.Intreg Test.QuickCheck> :r trivial :r trivial : error: no such module: ‘trivial’ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) curs9.hs:61:29: error: Variable not in scope: trivial :: Bool -> Bool -> Property | 61 | testqs' l = (length l <= 1) `trivial` sorted (qs' l) | ^^^^^^^^^ Failed, two modules loaded. *Utils.Intreg Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> :i trivial :i trivial :1:1: error: Not in scope: ‘trivial’ *Main Test.QuickCheck> :i classify :i classify classify :: Testable prop => Bool -> String -> prop -> Property -- Defined in ‘Test.QuickCheck.Property’ *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs' quickCheck testqs' +++ OK, passed 100 tests (10% triviale). *Main Test.QuickCheck> :r :r [3 of 3] Compiling Main ( curs9.hs, interpreted ) Ok, three modules loaded. *Main Test.QuickCheck> quickCheck testqs' quickCheck testqs' +++ OK, passed 100 tests: 8% triviale 1% simple *Main Test.QuickCheck>