[GHC] #10023: Relax Monad constraint in traceM and traceShowM to Applicative

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: | Owner: RyanGlScott | Status: new Type: feature | Milestone: request | Version: 7.10.1-rc1 Priority: normal | Operating System: Unknown/Multiple Component: | Type of failure: Other libraries/base | Blocked By: Keywords: | Related Tickets: Architecture: | Unknown/Multiple | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Now that {{{Applicative}}} is a superclass of {{{Monad}}} in GHC 7.10, the current type signatures of {{{traceM}}} and {{{traceShowM}}} from {{{Debug.Trace}}} are too constricted: {{{#!hs traceM :: Monad m => String -> m () traceM string = trace string $ return () traceShowM :: (Show a, Monad m) => a -> m () traceShowM = traceM . show }}} These can be equivalently defined with {{{Applicative}}}: {{{#!hs traceM :: Applicative m => String -> m () traceM string = trace string $ pure () traceShowM :: (Show a, Applicative m) => a -> m () traceShowM = traceM . show }}} However, the {{{M}}} suffixes probably won't make sense after changing the type signatures, so it might be wise to create new {{{traceA}}} and {{{traceShowA}}} functions and deprecate {{{traceM}}} and {{{traceShowM}}}. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Other | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ekmett): We've adopted the practice of generalizing the existing fooM Combinators in base where possible as part of 7.10 but not giving a new set of fooA names to avoid namespace pollution, needless constraints and a complex deprecation cycle. It seemed the lesser of evils was to generalize the M suffix than ask literally everyone to retool. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Other | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by RyanGlScott): I can live without the names {{{traceA}}}/{{{traceShowA}}}, but it would be nice to generalize the type signatures in the same vein as {{{when}}}/{{{unless}}}/{{{guard}}}. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Other | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ekmett): No problem here with generalizing the types. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: libraries/base | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Other | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * milestone: => 7.12.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: libraries/base | Version: 7.10.1-rc1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Other | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => newcomer Comment: For Newcomers: easy ticket. Also add an entry in `libraries/base/changelog.md`, and add `hvr` as a reviewer. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | RyanGlScott Priority: normal | Status: new Component: libraries/base | Milestone: 7.12.1 Resolution: | Version: 7.10.1-rc1 Operating System: Unknown/Multiple | Keywords: newcomer Type of failure: Other | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by RyanGlScott): * owner: => RyanGlScott -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | RyanGlScott Priority: normal | Status: new Component: libraries/base | Milestone: 7.12.1 Resolution: | Version: 7.10.1-rc1 Operating System: Unknown/Multiple | Keywords: newcomer Type of failure: Other | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: Phab:D1029 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * differential: => Phab:D1029 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10023: Relax Monad constraint in traceM and traceShowM to Applicative
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: feature request | RyanGlScott
Priority: normal | Status: new
Component: libraries/base | Milestone: 7.12.1
Resolution: | Version: 7.10.1-rc1
Operating System: Unknown/Multiple | Keywords: newcomer
Type of failure: Other | Architecture:
Blocked By: | Unknown/Multiple
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions: Phab:D1029
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10023: Relax Monad constraint in traceM and traceShowM to Applicative -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | RyanGlScott Priority: normal | Status: closed Component: libraries/base | Milestone: 7.12.1 Resolution: fixed | Version: 7.10.1-rc1 Operating System: Unknown/Multiple | Keywords: newcomer Type of failure: Other | Architecture: Blocked By: | Unknown/Multiple Related Tickets: | Test Case: | Blocking: | Differential Revisions: Phab:D1029 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10023#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC