1
1
mirror of https://github.com/qfpl/applied-fp-course.git synced 2024-11-22 11:23:01 +03:00

Doc updates

This commit is contained in:
Jack Kelly 2020-01-31 14:52:30 +10:00
parent 95598cf30b
commit 2623e3b5db
2 changed files with 9 additions and 16 deletions

View File

@ -48,7 +48,7 @@ import qualified Level04.Core as Core
#### Property-Based Testing [Optional]
For more advanced testing, there is the [hedgehog] property-based testing
package, and the [tasty] integration component [tasty-hedgehog].
package, and the [tasty] integration component [tasty-hedgehog].
Property based testing is a technique of testing whereby you specify the
properties that your function satisfies. Hedgehog then generates random input to
@ -63,21 +63,12 @@ behaviour and has lead to the notion of "property driven development".
#### Running the Tests
For a cabal sandbox:
If you're using cabal or greater:
```shell
$ cabal sandbox init
$ cabal install --only-dependencies --enable-tests
$ cabal configure --enable-tests
$ cabal test
```
If you're using Cabal 2.0 or greater (You can check your cabal version with `$ cabal --version`):
```shell
$ cabal new-configure --enable-tests
$ cabal new-build --enable-tests
$ cabal new-test
$ cabal v2-configure --enable-tests
$ cabal v2-build --enable-tests
$ cabal v2-test
```
For a stack environment:
@ -90,7 +81,7 @@ To load the tests in the REPL:
```shell
# Cabal
$ cabal new-repl app-fp-tests
$ cabal v2-repl app-fp-tests
# Stack
$ stack ghci applied-fp-course:test:app-fp-tests
@ -108,4 +99,3 @@ Start in ``tests/Test.hs``.
[tasty]: (https://hackage.haskell.org/package/tasty)
[tasty-wai]: (https://hackage.haskell.org/package/tasty-wai)
[doctest]: (https://hackage.haskell.org/package/doctest)

View File

@ -87,5 +87,8 @@ instance Bifunctor AppM where
-- throwError :: MonadError e m => e -> m a
-- pure :: Applicative m => a -> m a
--
-- Once you have this working with `throwError` and `pure`, you should
-- be able to factor it down into an equivalent but radically simpler
-- implementation.
liftEither :: Either e a -> AppM e a
liftEither = error "liftEither not implemented"