The data-default-instances-new-base package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

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

[Skip to ReadMe]

Properties

Versions0.0.1, 0.0.2, 0.0.2
Change logChangeLog.md
Dependenciesbase (==4.*), data-default-class (>=0.0 && <0.2), data-default-instances-base (>=0.0 && <0.1.0.1) [details]
LicenseBSD3
Copyright(c) 2015-2017, Peter Trško
AuthorPeter Trško
Maintainerpeter.trsko@gmail.com
CategoryData
Home pagehttps://github.com/trskop/data-default-extra
Bug trackerhttps://github.com/trskop/data-default-extra/issues
Source repositoryhead: git clone git://github.com/trskop/data-default-extra.git
this: git clone git://github.com/trskop/data-default-extra.git(tag class-0.1.2)
UploadedThu Jan 5 22:06:34 UTC 2017 by PeterTrsko

Modules

[Index]

Flags

NameDescriptionDefaultType
old-data-default-classDepend on (old) data-default-class >=0.0 && <0.1.2DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for data-default-instances-new-base-0.0.2

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.