polysemy-methodology - Polysemy

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

locallycompact

I've put together this package to decompose high level business problems into components by type applications and then fill in the blanks with simpler functions. I've managed to simplify some of my own programs with it and so far I quite like the approach.

https://hackage.haskell.org/package/polysemy-methodology

I'd love to get the thoughts of the polysemy devs on any improvements that might make sense here.

Georgi Lyubenov // googleson78

I think an example of this

This allows you to work up a solution to a domain problem backwards, by running
the program you intend to solve directly and using holes to guide the
requirements.

would be nice

Torsten Schmits

very interesting, but some examples are definitely in order :grinning:

Torsten Schmits

how is the function in the readme of type * -> Constraint?

locallycompact

My README is wrong, sec. I'll fix that and write up an example.

locallycompact

Ok there's more readme now.

Torsten Schmits

you forgot something at A CollectionsPackage indicates.

Torsten Schmits

btw you don't have to release a new version to update the docs!

locallycompact

Oh, I didn't know that. :)

Torsten Schmits

yeah, I should work with cabal publishDoc

Torsten Schmits

very nice! it has a sort of stream transducer feeling to it.

locallycompact

Thanks I don't know what that is but it's going on my list

Torsten Schmits

something like conduit, streaming, streamly

Torsten Schmits

wonder how this would look with a Stream as the final monad

Georgi Lyubenov // googleson78

do you mean to have a Stream of interpreters?

Torsten Schmits

though only conduit would be considered to have transducer semantics, right?

Torsten Schmits

no, stream of Input/Output values

Georgi Lyubenov // googleson78

I think this is really cool btw, it takes something that is "a software engineering practice" and reifies it into a language construction!

Torsten Schmits

this is how you sell polysemy to your product owner

Georgi Lyubenov // googleson78

btw, I'm sure you intend to "fix" some of these, but I think it would help for the example to have as little non-library related code in it (e.g. no optics/dhall/etc), and more importantly for the library to not depend on polysemy-zoo (it's heavy!)

Torsten Schmits

probably better to copy the KVStore into the project

locallycompact

Yeah I'll try and think of something neater as an example. Why is KVStore not in the main library? I use it a lot.

locallycompact

I also use KVStore (Path Rel File) ByteString as a filesystem.

Torsten Schmits

good point, I've reimplemented that, should use KVStore!

Torsten Schmits

if you'd make a PR puling KVStore into polysemy, I'm sure it would be welcome!

locallycompact

ah, also the HList type is from the zoo as well, although that's kind of fine to reimplement I think

locallycompact

Added the ability to intercept the start and end of each submethodology to do bracketed tracing. https://hackage.haskell.org/package/polysemy-methodology