Ticket #4834 (closed proposal: invalid)

Opened 2 years ago

Last modified 2 years ago

New Functor => Applicative => Monad Hierarchy

Reported by: gidyn Owned by:
Priority: normal Milestone: Not GHC
Component: libraries/base Version: 7.0.1
Keywords: Cc: gideon@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The standard class hierarchy is a consequence of Haskell's historical development, rather than logic. I would therefore like to propose a reform of the Functor, Applicative, and Monad type classes. The new hierarchy is logical, eliminates many duplicate names from the standard type class definitions, and removes the need for boilerplate Monad -> Applicative instance declarations.

The proposal is detailed in  the wiki, along with an example of a legacy module to provide some backwards-compatibility.

Attachments

ghc_new_monad_hierarchy.dpatch Download (110.0 KB) - added by basvandijk 2 years ago.
Prepare GHC for the new monad hierarchy
base_new_monad_hierarchy.dpatch Download (81.4 KB) - added by basvandijk 2 years ago.
Patch for base that implements the new monad hierarchy
functor_and_applicative_instance_HappyIdentity.dpatch Download (1.7 KB) - added by basvandijk 2 years ago.
Patch for happy that generates a Functor and Applicative instance for HappyIdentity?

Change History

Changed 2 years ago by gidyn

  • cc gideon@… added

Changed 2 years ago by gidyn

Formally proposing this on the mailing lists, with a discussion deadline of 1 February.

Changed 2 years ago by basvandijk

Prepare GHC for the new monad hierarchy

Changed 2 years ago by basvandijk

Patch for base that implements the new monad hierarchy

Changed 2 years ago by basvandijk

Patch for happy that generates a Functor and Applicative instance for HappyIdentity?

Changed 2 years ago by basvandijk

All my patches can also be pulled from my publicly available ghc repository:

darcs pull http://bifunctor.homelinux.net/~bas/ghc/
darcs pull http://bifunctor.homelinux.net/~bas/ghc/libraries/base
darcs pull http://bifunctor.homelinux.net/~bas/ghc/...

Also see the  generated haddock documentation of the base library with the patches applied.

Changed 2 years ago by gidyn

Please note that the attached patches only implement the new Applicative => Monad hierarchy, but do not change any names (as proposed on the wiki page). The deprecation/renaming of redundant definitions may be proposed in a separate ticket.

Changed 2 years ago by igloo

  • milestone set to Not GHC

Changed 2 years ago by igloo

  • status changed from new to closed
  • resolution set to invalid

Proposal tickets are no longer needed as part of the library submissions process. Instead, a normal ticket should be created once consensus has been achieved. Please see the  process description for details.

Note: See TracTickets for help on using tickets.