Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cotransverse #66

Merged
merged 1 commit into from
Jan 27, 2019
Merged

Add cotransverse #66

merged 1 commit into from
Jan 27, 2019

Conversation

Lysxia
Copy link
Contributor

@Lysxia Lysxia commented Jan 27, 2019

Some kind of dual to transverse.

For an example, this can be used to define thing here: https://www.reddit.com/r/haskell/comments/aj2xwn/is_there_something_deeper_in_this_stateful_tree/

@phadej
Copy link
Contributor

phadej commented Jan 27, 2019

So obvious when you see it, great!

@Lysxia
Copy link
Contributor Author

Lysxia commented Jan 27, 2019

I need to fix the property, distribute is the wrong way around...

@phadej phadej merged commit 495827d into recursion-schemes:master Jan 27, 2019
@phadej
Copy link
Contributor

phadej commented Jan 27, 2019

I took liberty to add few examples in f05582d (EDIT: and following typo fix)

@gelisam
Copy link
Collaborator

gelisam commented Jan 28, 2019

I took liberty to add few examples in f05582d

I'm surprised to see the $setup stanza, does that mean we have a doctest test suite somewhere I haven't noticed? If not, let's add one :)

@phadej
Copy link
Contributor

phadej commented Jan 28, 2019

@gelisam I use doctest Data/Functor/Foldable.hs locally. We can add something like that to Travis-CI. Alternative is to make a proper test-suite, but it would currently require changing to build-type: Custom, which I largely dislike.

@gelisam
Copy link
Collaborator

gelisam commented Jan 28, 2019

Alternative is to make a proper test-suite, but it would currently require changing to build-type: Custom

Which part requires build-type: Custom? I don't see this requirement in the documentation of doctest nor doctest-discover.

@gelisam gelisam mentioned this pull request Jan 28, 2019
@phadej
Copy link
Contributor

phadej commented Jan 28, 2019

Which part requires build-type: Custom? I don't see this requirement in the documentation of doctest nor doctest-discover.

doctest executable doesn't require even a package to exist, only source files somewhere. But in package test-suite case, we need to provide doctest right package environment (dependencies), paths (source files, autogenerated ones), etc (e.g. default-extensions) flags. Historically, doctest was created when all dependencies where in a global package database. It's not true with cabal new-build or stack.

The iterations of Edward's custom Setup.hs lead to creation of https://github.com/phadej/cabal-doctest, so we don't need to copy&paste Setup.hs scripts. Sadly seems we are missing a motivation/introduction from its README.

Without custom-setup you'll get headache making doctest test-suite work with cabal-install, stack, nix derivations etc. ekmett/lens#701 was a ~starting point to cabal-doctest library.


TL;DR the current approach, doctest running in CI relying on .ghc.environment.* files is simplest (even there I cheat a little so we don't need to look for Paths_recursion_schemes.hs); the downside is that /Stackage/ won't run them, but it's IMHO a small price to pay.

Alternative is to use cabal-doctest, but I'd rather not turn any package to use build-type: Custom at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants