qfpl / applied-fp-course

Applied Functional Programming Course - Move from exercises to a working app!
http://qfpl.io/projects/professional-fp-courses/
Other
624 stars 181 forks source link

rework 'prepareAppReqs' function #60

Closed mankyKitty closed 5 years ago

mankyKitty commented 6 years ago

The AppM is parametrised over the error type, but could be useful when writing this function if it was. Either introduce and guide through ExceptT as a use case, or provide instructions on parameterising over the e type for the AppM.

mankyKitty commented 6 years ago

Musings:

AppM shouldn't be parameterised over the "error" type, it makes more sense to have your newtype'd application monad have the concrete types.

Stands as good motivation to introduce isolated use of ExceptT. The generality and flexibility of monad transformers is part of the appeal.

Level 07 might benefit from changing out AppM to a refactoring to use the mtl package transformers (ReaderT and ExceptT). Changing our custom newtype to a more common(?) use case of wrapper for existing transformers.

mankyKitty commented 5 years ago

Refactored, initial feedback from students is good.