data-default 0.3.0 → 0.4.0
raw patch · 3 files changed
+39/−3 lines, 3 filesdep +old-localePVP ok
version bump matches the API change (PVP)
Dependencies added: old-locale
API changes (from Hackage documentation)
+ Data.Default: instance (Default a, RealFloat a) => Default (Complex a)
+ Data.Default: instance Default TimeLocale
Files
- Data/Default.hs +36/−0
- LICENSE +1/−1
- data-default.cabal +2/−2
Data/Default.hs view
@@ -1,3 +1,34 @@+{-++Copyright (c) 2010, 2012 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.++-}+ module Data.Default ( -- | This module defines a class for types with a default value. Instances are -- provided for '()', 'S.Set', 'M.Map', 'Int', 'Integer', 'Float', 'Double',@@ -7,6 +38,7 @@ import Data.Monoid import Data.Ratio+import Data.Complex import qualified Data.Set as S import qualified Data.Map as M import Data.IntMap (IntMap)@@ -14,6 +46,7 @@ import Data.Sequence (Seq) import Data.Tree (Tree(..)) import Data.DList (DList)+import System.Locale -- | A class for types with a default value. class Default a where@@ -32,6 +65,7 @@ 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 instance (Default r) => Default (e -> r) where def = const def instance (Default a) => Default (IO a) where def = return def@@ -56,3 +90,5 @@ 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 TimeLocale where def = defaultTimeLocale
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2010, Lukas Mai+Copyright (c) 2010, 2012 Lukas Mai All rights reserved.
data-default.cabal view
@@ -1,5 +1,5 @@ Name: data-default-Version: 0.3.0+Version: 0.4.0 Cabal-Version: >= 1.2 Category: Data Synopsis: A class for types with a default value@@ -10,6 +10,6 @@ Maintainer: <l.mai@web.de> Library- Build-Depends: base >=2 && <5, containers, dlist+ Build-Depends: base >=2 && <5, containers, dlist, old-locale Exposed-Modules: Data.Default Ghc-Options: -Wall -O2