Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 920 Bytes

File metadata and controls

23 lines (20 loc) · 920 Bytes

Cheatsheet

  1. Start from dummy main and imports/pragmas prefilled
  2. let's write a REST server to manage pets -> main with port, call startServer
  3. startServer run port application
  4. write application
  5. decompose runServer into runServant + runEFf
  6. implement handlers as pure ()
  7. compile and run the app
  8. write a test -> addPet returns [thePet]
  9. model business logic as an Eff -> BusinessLogicEffect -> AddPet precanned answer
  10. write a test to add a second Pet -> fails, we need a store
  11. model the store using an MVar + map of ByteString with encode
  12. thread the Store in runEff
  13. change tests to return a Right -> we want to handle errors in Storage
  14. write a test for failing store
  15. implement filaing store as an alternative effect
  • scaffold Servant
  • types for PetStore (Pet,encode...)
  • start at the point where we make a request
  • verbalise the fact people asked about Servant + Eff