Skip to content

Derive instance {Fractional, RealFrac, Floating, RealFloat} Compose f g a #226

@jship

Description

@jship

In the same vein as #160, seems like Compose could use a few more instances:

deriving instance Fractional (f (g a)) => Fractional (Compose f g a)
deriving instance RealFrac (f (g a)) => RealFrac (Compose f g a)
deriving instance Floating (f (g a)) => Floating (Compose f g a)
deriving instance RealFloat (f (g a)) => RealFloat (Compose f g a)

I'm working with a DSL that is compatible with Compose, so with these instances (in particular, Fractional and Floating) I can make numerical functions that are unconcerned with whether or not Compose is used under the hood for the values.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions