Skip to content

Introduce Data.Enum and Data.Bounded #208

Closed
@bgamari

Description

@bgamari

In #146 I noticed that the Enum and Bounded typeclasses currently have no proper home (currently exposed only via Prelude and GHC.Enum). I propose that we remedy this by introducing a pair of new modules, Data.Bounded and Data.Enum, to base:

module Data.Bounded where

class Bounded a where
  minBound :: a
  maxBound :: a

module Data.Enum where

class Enum a where
  succ :: a -> a
  pred :: a -> a
  toEnum :: GHC.Types.Int -> a
  fromEnum :: a -> GHC.Types.Int
  enumFrom :: a -> [a]
  enumFromThen :: a -> a -> [a]
  enumFromTo :: a -> a -> [a]
  enumFromThenTo :: a -> a -> a -> [a]

This has been implemented in !10422 and !11347.

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedApproved by CLC votebase-4.20Implemented in base-4.20 (GHC 9.10)base-4.21Implemented in base-4.21 (GHC 9.12)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions