data-default-instances-new-base

Default instances for types in newer versions of base package.

https://github.com/trskop/data-default-extra

LTS Haskell 19.33:0.0.2
Stackage Nightly 2022-03-17:0.0.2
Latest on Hackage:0.0.2

See all snapshots data-default-instances-new-base appears in

BSD-3-Clause licensed by Peter Trško
Maintained by [email protected]
This version can be pinned in stack with:data-default-instances-new-base-0.0.2@sha256:1f90fe762c978f9fd0fcbf6d4cb6cd191d261e25acf9308505b3444aef8c079f,3227

Module documentation for 0.0.2

Used by 1 package in nightly-2022-02-26(full list with versions):

data-default-instances-new-base

Hackage Hackage Dependencies Haskell Programming Language BSD3 License

Build

Description

Orphan instances for Default type class, which is defined in package data-default-class.

In addition to instances reexported from data-default-instances-base package, following Default instances are provided:

instance Default a => Default (Const a b) where
    def = Const def

instance Monad m => Default (Kleisli m a b) where
    def = Kleisli return

instance Default Version where
    def = Version [] []

Following instances are available only for base >= 4.7.0.0:

instance Default (Proxy a) where
    def = Proxy

instance Default SomeNat where
    def = SomeNat (Proxy :: Proxy 0)

instance Default SomeSymbol where
    def = SomeSymbol (Proxy :: Proxy "")

Following instances are available only for base >= 4.8.0.0:

instance Alternative f => Default (Alt f a) where
    def = Alt empty

instance Default a => Default (Identity a) where
    def = Identity def

instance Default Natural where
    def = 0

Following instances are available only for base >= 4.9.0.0:

instance Default a => Default (NonEmpty a) where
    def = def :| []

instance 'Bounded' a => Default (Min a) where
    def = minBound

instance Bounded a => Default (Max a) where
    def = maxBound

instance 'Default' ('Option' a) where
    def = Option Nothing

This package is intended to be used in conjunction with data-default package or directly with data-default-class package.

License

The BSD 3-Clause License, see LICENSE file for details.

Contributions

Contributions, pull requests and bug reports are welcome! Please don’t be afraid to contact author using GitHub or by e-mail.

Changes

ChangeLog / ReleaseNotes

Version 0.0.1

Version 0.0.1.1

  • Support for data-default-class ==0.1.*.
  • Avoiding dependency on data-default-instances-base when building with data-default-class >=0.1.2.