polysemy-research / polysemy-zoo

:monkey::panda_face: Experimental, user-contributed effects and interpreters for polysemy
BSD 3-Clause "New" or "Revised" License
70 stars 20 forks source link

RandomFu is a huge dependency #16

Closed isovector closed 5 years ago

isovector commented 5 years ago

Dang its real big. Compilation times shot up drastically upon including it. I think we should think about moving it out to a separate package (polysemy-random-fu maybe?).

wreq

isovector commented 5 years ago

Before: wreq2

adamConnerSax commented 5 years ago

Separate package is fine! Or you can just drop it. I still have it in knit-haskell (hadn’t upgraded yet!) so I’m personally indifferent at the moment.

isovector commented 5 years ago

@adamConnerSax would you want to be the maintainer of such a package? I'd prefer it be you instead of me, since I don't know anything about randomfu!

adamConnerSax commented 5 years ago

Sure! You care if it’s on stackage? I’ve never dealt with that.

isovector commented 5 years ago

I don't care! But putting it on stackage turns out to be super easy: https://github.com/commercialhaskell/stackage/pull/4562/files

On Sat, Jun 8, 2019 at 7:30 PM Adam Conner-Sax notifications@github.com wrote:

Sure! You care if it’s on stackage? I’ve never dealt with that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/isovector/polysemy-zoo/issues/16?email_source=notifications&email_token=AACLAF2QQYPX6BB6AR3I5VDPZQ6ITA5CNFSM4HSB23G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXIAQ7Q#issuecomment-500172926, or mute the thread https://github.com/notifications/unsubscribe-auth/AACLAFZU6G5323DLFBVMOWTPZQ6ITANCNFSM4HSB23GQ .

adamConnerSax commented 5 years ago

I’ve seen that! Does it only work if you use hpack or stack? I’m sort of all cabal but willing to learn hpack... You want me to just make a package with just RandomFu and publish or will you do it, leave in this repo and make me the maintainer?

adamConnerSax commented 5 years ago

Bump. Just making sure you're not waiting on me for something... I'm happy to take over whatever when you want me to or to leave things as they are or whatever.

isovector commented 5 years ago

Thanks for the reminder --- totally forgot about this. I'd prefer if you are solely responsible for the package:

  1. Moving it into its own repo
  2. Publishing it on hackage

if you're cool with that. Afterwards I'd be happy to link to your package from this one!

adamConnerSax commented 5 years ago

Sure. Might not happen until next week.
Same namespacing, that is, call the module "Polysemy.RandomFu"? Or do you want something different when they are external? Maybe you should add an "EffectsPackages.md" file here with links? Or a section at the bottom of the readme?

isovector commented 5 years ago

The module name is fine! The dream is that no effects are more privileged than any others. Good idea about the markdown file; will do after the package is published.

On Thu, Jun 13, 2019 at 2:28 PM Adam Conner-Sax notifications@github.com wrote:

Sure. Might not happen until next week. Same namespacing, that is, call the module "Polysemy.RandomFu"? Or do you want something different when they are external? Maybe you should add an "EffectsPackages.md" file here with links? Or a section at the bottom of the readme?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/isovector/polysemy-zoo/issues/16?email_source=notifications&email_token=AACLAF2O2ZIEAHQLTFLALP3P2KGUPA5CNFSM4HSB23G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXUUFVA#issuecomment-501826260, or mute the thread https://github.com/notifications/unsubscribe-auth/AACLAF7SCVGPXBK3UI76UCDP2KGUPANCNFSM4HSB23GQ .

isovector commented 5 years ago

So my plan is to push a new version of polysemy-zoo that exludes Polysemy.RandomFu. Then the module name is available to you, you can link against polysemy-zoo for Polysemy.MTL, and put #20 in your package.

adamConnerSax commented 5 years ago

That works! Also, I've noticed that this (https://github.com/kowainik/co-log/tree/master/co-log-polysemy) exists. I don't know if it has any tests nor have I tried to use it, but it's there, in case you're interested in adding it to the list.

isovector commented 5 years ago

polysemy-zoo-0.2.0.0 is up, without the RandomFu stuff, so the ball is now in your court, @adamConnerSax. Thanks again for your work on this!

adamConnerSax commented 5 years ago

Had a few minutes today and it was easier than I thought to re-arrange.

https://hackage.haskell.org/package/polysemy-RandomFu-0.1.0.0

isovector commented 5 years ago

Awesome. I'll add it to the readme.

PS, if you find that hacakge refuses to build your haddocks (it's an issue with the plugin, I think), get back in touch and I can walk you through it.

adamConnerSax commented 5 years ago

I could use that walkthrough! Also effects my knit-haskell package.

isovector commented 5 years ago

I use @ChrisPenner's haddock-up script: https://github.com/ChrisPenner/dotfiles/blob/master/bin/haddock-up -- this lets you upload haddocks, instead of relying on hackage.

But haddock is broken when using plugins: https://github.com/haskell/haddock/issues/900. So the solution is to comment out the -fplugin bits, and to use -fdefer-type-errors. I just switch which parts of this are commented out before running haddock-up:

https://github.com/isovector/polysemy-zoo/blob/488c961945b9bbd64806199e5fe991f57f7e83ac/package.yaml#L32-L37

adamConnerSax commented 5 years ago

Cool. I'll give it a try!

Thanks!

Avi-D-coder commented 5 years ago

@isovector I thought I read somewhere this is fixed in ghc-8.8. Is that true?

isovector commented 5 years ago

@Avi-D-coder I think so

ocharles commented 5 years ago

I mentioned before that uploading docs should just be: cabal upload -d --publish. No need for external tools. I'd be curious if that doesn't work.

isovector commented 5 years ago

@ocharles i don't have cabal! i don't know how to cabal!

ocharles commented 5 years ago

absolute mad lad

adamConnerSax commented 5 years ago

That worked! For clarity, since there was some v1,v2 cabal dancing:

  1. cabal v2-haddock --haddock-for-hackage
  2. cabal upload -d --publish /Path/to/haskell/libs/knit-haskell/dist-newstyle/knit-haskell-0.5.0.0-docs.tar.gz
ocharles commented 5 years ago

Strange, mine doesn't even require two steps. Is this the latest stable Cabal?

adamConnerSax commented 5 years ago

It’s at least 2.4. When I try to just do “publish” it runs into a dependency issue because it seems to be a v1 command? So I build the haddock using the v2 command and then upload. But maybe there’s a better way?

ocharles commented 5 years ago

Yes, cabal upload --publish -d, as I keep saying :stuck_out_tongue: If you show me what that produces, I might be able to see what's going on. I'm sure I did exactly this only a day or so ago with no problems on one of my repos.

adamConnerSax commented 5 years ago

Didn't realize you wanted the details. Here you go!

After cabal --version

cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library 

After cabal upload --publish -d

No documentation tarball specified. Building a documentation tarball with
default settings...
If you need to customise Haddock options, run 'haddock --for-hackage' first to
generate a documentation tarball.
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: polysemy-RandomFu-0.1.0.0 (user goal)
[__1] unknown package: random-source (dependency of polysemy-RandomFu)
[__1] fail (backjumping, conflict set: polysemy-RandomFu, random-source)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: polysemy-RandomFu, random-source
Trying configure anyway.
Configuring polysemy-RandomFu-0.1.0.0...
Warning: The flag --disable-executable-profiling is deprecated. Please use
--disable-profiling instead.
cabal: Encountered missing dependencies:
polysemy >=0.3,
polysemy-plugin >0.2.0.0 && <0.4.0.0,
polysemy-zoo >=0.2,
random-fu >=0.2.5.0 && <0.3.0.0,
random-source >=0.3 && <0.4.0.0
ocharles commented 5 years ago

Strange, it almost looks like you need to cabal update, so cabal knows about random-source