ndmitchell / extra

Extra Haskell functions
Other
93 stars 37 forks source link

Add the guarded function (lifting into Alternative via predicate) #109

Closed memowe closed 1 month ago

memowe commented 1 year ago

I'd like to add the guarded function, which I often need. It is well known by relude or Protolude.

I was able to run the test suite and I added documentation including code examples, which should lead to auto-generated tests, but I was unable to run Generate.hs in my GHC 9.4.7 environment. Any hints?

TODO

memowe commented 1 year ago

Regarding my problems to auto-generate the tests:

[memowe@rakete haskell-extra]$ runghc Generate.hs

Generate.hs:6:1: error:
    Could not load module ‘Data.List.Extra’
    It is a member of the hidden package ‘extra-1.7.14’.
...

Full error log

However, building and testing the current test suite works fine.

memowe commented 11 months ago

Hi there! Any feedback is much appreciated. :)

ndmitchell commented 10 months ago

Sorry for the delay in replying. I think this would be a good addition. Adding guardedA seems sensible too. https://github.com/ndmitchell/extra/blob/master/Generate.hs now has documentation on how to run it which works (newer Cabal sandboxing means the old version no longer works) - does that work for you?

memowe commented 10 months ago

Awesome, I'll check right now. :)

memowe commented 10 months ago

https://github.com/ndmitchell/extra/blob/master/Generate.hs now has documentation on how to run it which works [...] - does that work for you?

Thanks! Yes, it works now, although I had to manually

λ :set -package quickcheck-instances
memowe commented 9 months ago

I think this should be ready to merge. Is there anything I can do to help? :)

memowe commented 6 months ago

Any news? 😮

ndmitchell commented 1 month ago

Sorry, I kind of fell off the face of the planet as other things became quite busy in life. Apologies for the delay - the code looks great and I'll make a release with it in shortly.

memowe commented 1 month ago

No worries, thank you so much for taking time to merge this. <3