data-default-instances-case-insensitive (empty) → 0.0.1
raw patch · 6 files changed
+197/−0 lines, 6 filesdep +case-insensitivedep +data-default-classsetup-changed
Dependencies added: case-insensitive, data-default-class
Files
- ChangeLog.md +13/−0
- LICENSE +30/−0
- README.md +56/−0
- Setup.hs +2/−0
- data-default-instances-case-insensitive.cabal +50/−0
- src/Data/Default/Instances/CaseInsensitive.hs +46/−0
+ ChangeLog.md view
@@ -0,0 +1,13 @@+# ChangeLog / ReleaseNotes+++## Version 0.0.1++* First public release.+* Uploaded to [Hackage][]: <http://hackage.haskell.org/package/data-default-instances-case-insensitive-0.0.1>++++[Hackage]:+ http://hackage.haskell.org/+ "HackageDB (or just Hackage) is a collection of releases of Haskell packages."
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2015-2016, Peter Trško++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 Peter Trško 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.
+ README.md view
@@ -0,0 +1,56 @@+# data-default-instances-case-insensitive++[][data-default-instances-case-insensitive]+[](http://packdeps.haskellers.com/reverse/data-default-instances-case-insensitive)+[][Haskell.org]+[][tl;dr Legal: BSD3]++[](https://travis-ci.org/trskop/data-default-extra)+++# Description++`Default` instance for `CI` type from [case-insensitive][] package:++```Haskell+instance (Default s, FoldCase s) => Default (CI s) where+ def = CI.mk def+```++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.++++[case-insensitive]:+ https://hackage.haskell.org/package/case-insensitive+ "The case-insensitive package on Hackage"+[data-default]:+ https://hackage.haskell.org/package/data-default+ "Package data-default on Hackage"+[data-default-class]:+ https://hackage.haskell.org/package/data-default-class+ "Package data-default-class on Hackage"+[data-default-instances-case-insensitive]:+ https://hackage.haskell.org/package/data-default-instances-case-insensitive+ "Package data-default-instances-case-insensitive on Hackage"+[Haskell.org]:+ http://www.haskell.org+ "The Haskell Programming Language"+[LICENSE]:+ https://github.com/trskop/data-default-extra/blob/master/instances-case-insensitive/LICENSE+ "License of data-default-instances-case-insensitive package."+[tl;dr Legal: BSD3]:+ https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29+ "BSD 3-Clause License (Revised)"
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ data-default-instances-case-insensitive.cabal view
@@ -0,0 +1,50 @@+name: data-default-instances-case-insensitive+version: 0.0.1+synopsis: Default instance for CI type from case-insensitive package.+description:+ Default instances for (lazy and strict) ByteString, Builder and+ ShortByteString.+description:+ Orphan instances for @Default@ type class, which is defined in package+ <https://hackage.haskell.org/package/data-default-class data-default-class>.+ .+ Following @Default@ instances are provided:+ .+ > instance (Default s, FoldCase s) => Default (CI s) where+ > def = mk def++homepage: https://github.com/trskop/data-default-extra+bug-reports: https://github.com/trskop/data-default-extra/issues+license: BSD3+license-file: LICENSE+author: Peter Trško+maintainer: peter.trsko@gmail.com+copyright: (c) 2015-2016, Peter Trško+category: Data+build-type: Simple+cabal-version: >=1.10++extra-source-files: ChangeLog.md, README.md++library+ hs-source-dirs: src+ exposed-modules: Data.Default.Instances.CaseInsensitive+ -- other-modules:++ default-language: Haskell2010+ other-extensions: NoImplicitPrelude++ build-depends:+ case-insensitive >=0.1 && <2+ , data-default-class ==0.0.*++ ghc-options: -Wall -fwarn-tabs++source-repository head+ type: git+ location: git://github.com/trskop/data-default-extra.git++source-repository this+ type: git+ location: git://github.com/trskop/data-default-extra.git+ tag: case-insensitive-v0.0.1
+ src/Data/Default/Instances/CaseInsensitive.hs view
@@ -0,0 +1,46 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}+-- |+-- Module: $HEADER$+-- Description: Default instance for CI type from case-insensitive package.+-- Copyright: (c) 2015, Peter Trško+-- License: BSD3+--+-- Maintainer: peter.trsko@gmail.com+-- Stability: stable+-- Portability: CPP, DataKinds (for base >=4.7.0.0), FlexibleInstances,+-- NoImplicitPrelude+--+-- 'Default' instance for 'CI' type from+-- <https://hackage.haskell.org/package/case-insensitive case-insensitive>+-- package.+module Data.Default.Instances.CaseInsensitive+ ( -- $providedInstances+ )+ where++import Data.CaseInsensitive (CI, FoldCase)+import qualified Data.CaseInsensitive as CI (mk)++import Data.Default.Class (Default(def))+++-- Another option would be to use:+--+-- instance (IsString s, FoldCase s) => Default (CI s) where+-- def = CI.mk (fromString "")+--+-- Problem with the above definition is if someone defines his/her+-- newtype with IsString instance that should have different default+-- value then "". In example hostname for connecting to, etc.++instance (Default s, FoldCase s) => Default (CI s) where+ def = CI.mk def+ {-# INLINE def #-}++-- $providedInstances+--+-- @+-- instance ('Default' s, 'FoldCase' s) => 'Default' ('CI' s) where+-- 'def' = 'CI.mk' 'def'+-- @