Skip to content

bhoudebert/haskell-polysemy-example

Repository files navigation

haskell-polysemy-example

WARNING: surely ouf of date.

Here you'll find a very simple implementation of a custom effect (over IO) with Polysemy.

Program play with question/answer (automated) and interpret the effect to call the right function.

The goal here is not to make you polysemy fluent but to understand the purpose of the library and to be production ready with it so the example is simple and doesn't cover everything.

A strong strength of polysemy is that you can mock your effect in during testing. What does it mean? It means that if you have an IO effet calling a database, wrap it into a polysemy effect, lets say DatabaseEffect, and during you're test you will be able to "replace" the DB by a custom function providing the data.

For me it's THE thing about polysemy, you can now play with impure function during your tests!

Execution

stack run

Testing

stack test

Coverage

stack clean --full && stack test --coverage

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published