[GHC] #9759: Add Alternative wrapper to Data.Monoid
#9759: Add Alternative wrapper to Data.Monoid -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: Core Libraries | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: hour) | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- As discussed on the libraries list, {{{#!hs -- | Monoid under @<|>@. newtype Alt f a = Alt {getAlt :: f a} deriving (Generic, Generic1, Read, Show, Eq, Ord, Num, Enum, Monad, MonadPlus, Applicative, Alternative, Functor) instance forall f a . Alternative f => Monoid (Alt f a) where mempty = Alt empty mappend = coerce ((<|>) :: f a -> f a -> f a) }}} The documentation for `Data.Monoid.First` and `Data.Monoid.Last` should also be expanded to explain that `First a` is isomorphic to `Alt Maybe a` and `Last a` is isomorphic to `Dual (Alt Maybe a)`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9759> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9759: Add Alternative wrapper to Data.Monoid -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D422 | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => patch * differential: => Phab:D422 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9759#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9759: Add Alternative wrapper to Data.Monoid -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D422 | -------------------------------------+------------------------------------- Comment (by dfeuer): Mailing list thread supporting addition: https://www.haskell.org/pipermail/libraries/2014-October/024045.html -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9759#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9759: Add Alternative wrapper to Data.Monoid -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D422 | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"49fde3b6764d4b7bb149ef1c2c56d00cf0878ddb/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="49fde3b6764d4b7bb149ef1c2c56d00cf0878ddb" Add `Alternative` wrapper to Data.Monoid Complete #9759. Use `coerce` to get nicer definitions of `Sum` and `Product`; update documentation for `First` and `Last`. Reviewed By: hvr Differential Revision: https://phabricator.haskell.org/D422 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9759#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9759: Add Alternative wrapper to Data.Monoid -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: closed Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D422 | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9759#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC