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

Haddock "source" links are broken since the OsPath transition #198

Open
sol opened this issue Jul 2, 2023 · 6 comments
Open

Haddock "source" links are broken since the OsPath transition #198

sol opened this issue Jul 2, 2023 · 6 comments

Comments

@sol
Copy link
Member

sol commented Jul 2, 2023

Before: https://hackage.haskell.org/package/filepath-1.4.2.2/docs/src/System.FilePath.Posix.html#takeFileName

After: https://hackage.haskell.org/package/filepath-1.4.100.3/docs/src/System.FilePath.Posix.html#takeFileName

@hasufell I think I understand the underlying motivation, and I am generally sympathetic to DRYing things up, this is why so far I refrained from reporting this as a bug.

However, I think that this puts us into an unfortunate situation:

  1. Most importantly, code is far more often read than written. This is why personally I would not be willing to sacrifice readability for DRYness.

  2. But also, CPP is a real challenge for tooling. This does not only affect you if you work on a package that makes heavy use of CPP. It also makes it difficult to e.g. implement a "go to definition" that works across packages. By my book less CPP is always a good thing.

  3. For me, the final straw is that it's not only filepath, but that I see a spreading pattern here (directory, file-io, ...).

@hasufell
Copy link
Member

hasufell commented Jul 2, 2023

@sol
Copy link
Member Author

sol commented Jul 2, 2023

Backpack would not be my first choice.

@hasufell
Copy link
Member

hasufell commented Jul 2, 2023

Backpack would not be my first choice.

This does not require backpack. See the comment:

If we’re spitballing alternative methods of achieving backpack…

You could possibly also use convenience 3 internal libraries, make them share the same source module that you want to have multiple implementations, but each import their parameter (types, implementations) from a module in isolated source directories. To instantiate them you’d use PackageImports. No CPP required (although could be used).

That would serve the local project case, but wouldn’t serve the open world case that backpack does.

@sol
Copy link
Member Author

sol commented Jul 2, 2023

That sounds much better. But at least for file-io it could be even simpler. PR coming.

@sol
Copy link
Member Author

sol commented Jul 2, 2023

haskell/file-io#9

@hasufell
Copy link
Member

hasufell commented Jul 4, 2023

If you want to do the same for filepath, feel free... but it's going to be a little more work.

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

No branches or pull requests

2 participants