Comments (1)
Adding runAppM
is correct. However you've updated the test to suit what your code was doing, not what the test is trying to check for, which is not correct.
The expectation is that you implement the readConfFile
function so when you runAppM
the value that is returned is Right
when you successfully read the file, or Left
with reason that reading the file failed. Using the try
function or something else from Control.Exception
we're able to execute functions and not let exceptions escape.
This will require that you be explicit about what type of exception you're going to want to catch. Since we're reading a file, the choice of IOException
is the most appropriate. Since things like ArithException
and AsyncException
don't make much sense in this context.
The undefined
can then be updated to be the constructor from ConfigError
that you create to wrap the exception. Using show
on the exception is sufficient for this exercise.
from applied-fp-course.
Related Issues (20)
- Breadcrumbs run out in later levels
- Consistent Qualified Imports
- More instruction regarding "logging" function in Level07
- Tests now working? HOT 6
- Condense tests to a single suite? HOT 1
- Visual Studio Code with vscode-ghc-simple HOT 1
- Please add `cabal-install` to default.nix HOT 1
- Course Feedback HOT 2
- Haddock generation fails with : src/Level04/Types.hs:42:1-6: error: parse error on input βimportβ HOT 2
- Check syntax of stack commands HOT 3
- Check GHC 8.8.1 Support HOT 3
- References to transformers
- HKD Bonus stage for Config HOT 2
- Make callout to runDBAction more explicit HOT 1
- Data.Monoid.Last will be deprecated HOT 1
- Remove `return` from `Monad` instances
- How to update nix json files? HOT 1
- Setup Github codespaces!!! HOT 2
- Data.Monoid.First is here to stay HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applied-fp-course.