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 universum-prelude #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Martoon-00
Copy link
Member

@Martoon-00 Martoon-00 commented Aug 9, 2021

Description

Add an easy way to implicitly import Universum in other projects.

I'm yet about to test it. Unfortunately, the maintainer of base-noprelude is away for some time already, and base-noprelude is now too outdated to be used in any of our projects, see haskell-hvr/base-noprelude#11.

I didn't update cI workflows, since stack build already covers the new module, and the new package is too small to test it with cabal too.

Related issues(s)

✓ Checklist for your Pull Request

Ideally a PR has all of the checkmarks set.

If something in this list is irrelevant to your PR, you should still set this
checkmark indicating that you are sure it is dealt with (be that by irrelevance).

  • I made sure my PR addresses a single concern, or multiple concerns which
    are inextricably linked. Otherwise I should open multiple PR's.
  • If your PR fixes/relates to an open issue then the description should
    reference this issue. See also auto linking on
    github
    .

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    I checked whether I should update the docs and did so if necessary:

  • Record your changes

    • I added an entry to the changelog if my changes are visible to the users
      and
    • provided a migration guide for breaking changes if possible

Stylistic guide (mandatory)

  • My commit history is clean (only contains changes relating to my
    issue/pull request and no reverted-my-earlier-commit changes) and commit
    messages start with identifiers of related issues in square brackets.

    Example: [#42] Short commit description

    If necessary both of these can be achieved even after the commits have been
    made/pushed using rebase and squash.

prelude/LICENSE Outdated
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2016-2017, Stephen Diehl, 2017, Serokell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU it's a completely new package, we can treat it as completely new work that started in 2021. Moreover, I am not sure if we should use MIT here (for consistency with universum itself) or MPL-2.0 (which is our default choice for such things). Both are fine to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, somehow missed that the license file can include year/authors too.

Hope for such a small package it does not really matter which license to choose.


Add a dependency on `universum-prelude` that provides `Prelude` with all the `universum` functionality.

Also, replace `base` dependency with `base-noprelude` to avoid conflicts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, it's completely unfair not to mention the mixin approach. Yes, it breaks some tools and for many people it's a critical downside, but apart from that it sounds like the cleanest solution which one should prefer if they don't care about broken tools.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I completely forgot that this is also an option and worth enlisting here.

@Martoon-00 Martoon-00 force-pushed the martoon/#240-prelude-package branch from 7d6e652 to 551c597 Compare August 12, 2021 15:28
Problem: in some projects, like `xrefcheck`, we would like to use
`universum` without constant explicit `import Universum`.

Solution: add a dedicated package that allows doing so.

One another way is using mixins feature, but it does not yet work really
well (`stack ghci` tends to fail, as well as Haskell language server),
so we better look at this feature again at its better times.
@Martoon-00 Martoon-00 force-pushed the martoon/#240-prelude-package branch from 551c597 to 1d1347d Compare August 12, 2021 15:47
@dcastro
Copy link
Member

dcastro commented Mar 12, 2022

I think this can be merged, right?

@Martoon-00
Copy link
Member Author

I failed to test the new universum-prelude (I tried in xrefcheck) because base-noprelude was not updated for a while and there is no version that would match the LTS we use. And looks like base-noprelude's maintainer is yet gone, so we are in a quite unpleasant situation for now 😿

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.

3 participants