-
Notifications
You must be signed in to change notification settings - Fork 14
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
Get rid of Group, with the intention that the groups library is used instead #24
Draft
Ericson2314
wants to merge
19
commits into
develop
Choose a base branch
from
no-group
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
485c592
Bump reflex platform
Ericson2314 f6d4c9a
Delete group class, the groups package should be used instead
Ericson2314 830add4
Move `Additive` to its own module
Ericson2314 57bdb25
Fix GHC < 8.6 build
Ericson2314 a9a9af4
Merge remote-tracking branch 'origin/develop' into no-group
Ericson2314 aacb8a6
Merge branch 'develop' into no-group
Ericson2314 b3a8b00
Fix typo in change log
Ericson2314 758a2ae
Merge branch 'module-for-additive' into no-group
Ericson2314 be84f3e
Merge branch 'module-for-additive' into no-group
Ericson2314 d8b04b4
Fix issue in change log
Ericson2314 a463f02
Merge branch 'proper-orphans-dep' into no-group
Ericson2314 017e012
Merge branch 'proper-orphans-dep' into no-group
Ericson2314 ab32f6a
Merge branch 'proper-orphans-dep' into no-group
Ericson2314 fb2af20
Merge branch 'develop' into no-group
Ericson2314 0f4d634
Actually do need `semialign` / split-these flag
Ericson2314 d54a334
Mention the `split-these` flag is back
Ericson2314 512a1bb
Merge remote-tracking branch 'origin/develop' into no-group
Ericson2314 fc51b29
Merge remote-tracking branch 'origin/develop' into no-group
Ericson2314 c481166
Merge branch 'develop' into no-group
Ericson2314 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
# DO NOT HAND-EDIT THIS FILE | ||
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }: | ||
if !fetchSubmodules && !private then builtins.fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256; | ||
} else (import <nixpkgs> {}).fetchFromGitHub { | ||
inherit owner repo rev sha256 fetchSubmodules private; | ||
}; | ||
in import (fetch (builtins.fromJSON (builtins.readFile ./github.json))) | ||
import (import ./thunk.nix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# DO NOT HAND-EDIT THIS FILE | ||
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }: | ||
if !fetchSubmodules && !private then builtins.fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256; | ||
} else (import <nixpkgs> {}).fetchFromGitHub { | ||
inherit owner repo rev sha256 fetchSubmodules private; | ||
}; | ||
json = builtins.fromJSON (builtins.readFile ./github.json); | ||
in fetch json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
-- | | ||
-- Module: | ||
-- Data.Semigroup.Additive | ||
-- Description: | ||
-- This module defines a class for commutative semigroups, until it is moved | ||
-- to another library. | ||
module Data.Semigroup.Additive | ||
( Additive | ||
) where | ||
|
||
import Data.Functor.Const (Const (..)) | ||
import Data.Functor.Identity | ||
import Data.Proxy | ||
#if !MIN_VERSION_base(4,12,0) | ||
-- for :*: and :.: semigroup instances | ||
import Data.Orphans () | ||
#endif | ||
#if !MIN_VERSION_base(4,11,0) | ||
import Data.Semigroup (Semigroup (..)) | ||
#endif | ||
import GHC.Generics | ||
|
||
-- | An 'Additive' 'Semigroup' is one where (<>) is commutative | ||
class Semigroup q => Additive q where | ||
|
||
-- | Trivial group. | ||
instance Additive () | ||
|
||
-- | Product group. A Pair of groups gives rise to a group | ||
instance (Additive a, Additive b) => Additive (a, b) | ||
|
||
-- See https://gitlab.haskell.org/ghc/ghc/issues/11135#note_111802 for the reason Compose is not also provided. | ||
-- Base does not define Monoid (Compose f g a) so this is the best we can | ||
-- really do for functor composition. | ||
instance Additive (f (g a)) => Additive ((f :.: g) a) | ||
|
||
-- | Product of groups, Functor style. | ||
instance (Additive (f a), Additive (g a)) => Additive ((f :*: g) a) | ||
|
||
-- | Trivial group, Functor style | ||
instance Additive (Proxy x) | ||
|
||
-- | Const lifts groups into a functor. | ||
instance Additive a => Additive (Const a x) | ||
-- | Ideitnty lifts groups pointwise (at only one point) | ||
instance Additive a => Additive (Identity a) | ||
|
||
-- | Functions lift groups pointwise. | ||
instance Additive b => Additive (a -> b) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could get rid of this, and just not provide
:.:
and:*:
Additive
instances before GHC 8.6. I don't care which.