data-default-instances-base 0.1.0 → 0.1.0.3
raw patch · 3 files changed
Files
- Data/Default/Instances/Base.hs +32/−102
- LICENSE +24/−20
- data-default-instances-base.cabal +20/−15
Data/Default/Instances/Base.hs view
@@ -1,115 +1,45 @@ {- -Copyright (c) 2013 Lukas Mai+Copyright (c) 2013, Lukas Mai All rights reserved. -Redistribution and use in source and binary forms, with or without modification,-are permitted provided that the following conditions are met:--* Redistributions of source code must retain the above copyright notice, this- list of conditions and the following disclaimer.-* Redistributions in binary form must reproduce the above copyright notice,- this list of conditions and the following disclaimer in the documentation- and/or other materials provided with the distribution.-* Neither the name of the author nor the names of his contributors- may be used to endorse or promote products derived from this software- without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY LUKAS MAI AND CONTRIBUTORS "AS IS" AND ANY-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE-DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.---}--{-# LANGUAGE CPP #-}+Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met: -module Data.Default.Instances.Base (--- | This module defines 'Default' instances for the types 'Int', 'Int8',--- 'Int16', 'Int32', 'Int64', 'Word', 'Word8', 'Word16', 'Word32', 'Word64',--- 'Integer', 'Float', 'Double', 'Ratio', 'Complex', 'CShort', 'CUShort',--- 'CInt', 'CUInt', 'CLong', 'CULong', 'CLLong', 'CULLong', 'CPtrdiff',--- 'CSize', 'CSigAtomic', 'CIntPtr', 'CUIntPtr', 'CIntMax', 'CUIntMax',--- 'CClock', 'CTime', 'CUSeconds', 'CSUSeconds', 'CFloat', 'CDouble', '(->)',--- 'IO', 'Maybe', '()', '[]', 'Ordering', 'Any', 'All', 'Last', 'First', 'Sum',--- 'Product', 'Endo', 'Dual', and tuples.-) where+ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer. -import Data.Default.Class-import Data.Int-import Data.Word-import Data.Monoid-import Data.Ratio-import Data.Complex-import Foreign.C.Types+ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution. -instance Default Int where def = 0-instance Default Int8 where def = 0-instance Default Int16 where def = 0-instance Default Int32 where def = 0-instance Default Int64 where def = 0-instance Default Word where def = 0-instance Default Word8 where def = 0-instance Default Word16 where def = 0-instance Default Word32 where def = 0-instance Default Word64 where def = 0-instance Default Integer where def = 0-instance Default Float where def = 0-instance Default Double where def = 0-instance (Integral a) => Default (Ratio a) where def = 0-instance (Default a, RealFloat a) => Default (Complex a) where def = def :+ def+ * Neither the name of Lukas Mai nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission. -instance Default CShort where def = 0-instance Default CUShort where def = 0-instance Default CInt where def = 0-instance Default CUInt where def = 0-instance Default CLong where def = 0-instance Default CULong where def = 0-instance Default CLLong where def = 0-instance Default CULLong where def = 0-instance Default CPtrdiff where def = 0-instance Default CSize where def = 0-instance Default CSigAtomic where def = 0-instance Default CIntPtr where def = 0-instance Default CUIntPtr where def = 0-instance Default CIntMax where def = 0-instance Default CUIntMax where def = 0-instance Default CClock where def = 0-instance Default CTime where def = 0-#if MIN_VERSION_base(4, 4, 0)-instance Default CUSeconds where def = 0-instance Default CSUSeconds where def = 0-#endif-instance Default CFloat where def = 0-instance Default CDouble where def = 0+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -instance (Default r) => Default (e -> r) where def = const def-instance (Default a) => Default (IO a) where def = return def+-} -instance Default (Maybe a) where def = Nothing+{-|+Module : Data.Default.Instances.Base+Description : Reëxports the instances from the "Data.Default.Class" module. -instance Default () where def = mempty-instance Default [a] where def = mempty-instance Default Ordering where def = mempty-instance Default Any where def = mempty-instance Default All where def = mempty-instance Default (Last a) where def = mempty-instance Default (First a) where def = mempty-instance (Num a) => Default (Sum a) where def = mempty-instance (Num a) => Default (Product a) where def = mempty-instance Default (Endo a) where def = mempty+This module reëxports the 'Data.Default.Class.Default' instances from the+"Data.Default.Class" module.+-}+module Data.Default.Instances.Base () where -instance (Default a) => Default (Dual a) where def = Dual def-instance (Default a, Default b) => Default (a, b) where def = (def, def)-instance (Default a, Default b, Default c) => Default (a, b, c) where def = (def, def, def)-instance (Default a, Default b, Default c, Default d) => Default (a, b, c, d) where def = (def, def, def, def)-instance (Default a, Default b, Default c, Default d, Default e) => Default (a, b, c, d, e) where def = (def, def, def, def, def)-instance (Default a, Default b, Default c, Default d, Default e, Default f) => Default (a, b, c, d, e, f) where def = (def, def, def, def, def, def)-instance (Default a, Default b, Default c, Default d, Default e, Default f, Default g) => Default (a, b, c, d, e, f, g) where def = (def, def, def, def, def, def, def)+import Data.Default.Class ()
LICENSE view
@@ -1,26 +1,30 @@-Copyright (c) 2013 Lukas Mai+Copyright (c) 2013, Lukas Mai All rights reserved. -Redistribution and use in source and binary forms, with or without modification,-are permitted provided that the following conditions are met:+Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this- list of conditions and the following disclaimer.-* Redistributions in binary form must reproduce the above copyright notice,- this list of conditions and the following disclaimer in the documentation- and/or other materials provided with the distribution.-* Neither the name of the author nor the names of his contributors- may be used to endorse or promote products derived from this software- without specific prior written permission.+ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Lukas Mai nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data-default-instances-base.cabal view
@@ -1,18 +1,23 @@-Name: data-default-instances-base-Version: 0.1.0-Cabal-Version: >= 1.6-Category: Data-Synopsis: Default instances for types in base-Build-Type: Simple-License: BSD3-License-File: LICENSE-Author: Lukas Mai-Maintainer: <l.mai@web.de>+cabal-version: 3.0+name: data-default-instances-base+version: 0.1.0.3+category: Data+synopsis: Default instances for types in base+description:+ This module reëxports the 'Data.Default.Class.Default' instances from the+ "Data.Default.Class" module.+build-type: Simple+license: BSD-3-Clause+license-file: LICENSE+copyright: (c) 2013 Lukas Mai+author: Lukas Mai+maintainer: <lukasmai.403+hackage@gmail.com> source-repository head- type: git- location: https://github.com/mauke/data-default+ type: git+ location: https://github.com/mauke/data-default -Library- Build-Depends: base >=2 && <5, data-default-class- Exposed-Modules: Data.Default.Instances.Base+library+ build-depends: base >=2 && <5, data-default-class ^>=0.1.2.0+ exposed-modules: Data.Default.Instances.Base+ default-language: Haskell98