general-prelude (empty) → 0.1
raw patch · 4 files changed
+167/−0 lines, 4 filesdep +basedep +lensdep +pointless-funsetup-changed
Dependencies added: base, lens, pointless-fun, strict, system-filepath
Files
- LICENSE +30/−0
- Prelude/General.hs +111/−0
- Setup.hs +2/−0
- general-prelude.cabal +24/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c)2010, Svein Ove Aas++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 Svein Ove Aas 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.
+ Prelude/General.hs view
@@ -0,0 +1,111 @@+-- | Prelude replacement, use the NoImplicitPrelude extension before importing+-- this.++module Prelude.General(+ module Control.Applicative+ , module Control.Arrow+ , module Control.Category+ , module Control.Exception+ , module Control.Lens+ , module Control.Monad+ , module Data.Bool+ , module Data.Either+ , module Data.Eq+ , module Data.Foldable+ , module Data.Function+ , module Data.Function.Pointless+ , module Data.Int+ , module Data.List+ , module Data.Maybe+ , module Data.Monoid+ , module Data.Ord+ , module Data.String+ , module Data.Traversable+ , module Data.Tuple+ , module Filesystem.Path+ , module System.IO+ , module Text.Show++ , (+), (-), (*), (/), mod+ , seq, ($!)+ , undefined+ , fromIntegral++ , if'+ , filter+ ) where++import Control.Applicative+import Control.Arrow ( first+ , second )+import Control.Category+import Control.Exception+import Control.Lens hiding ( lefts+ , rights )+import Control.Monad hiding ( forM+ , forM_+ , mapM+ , mapM_+ , msum+ , sequence+ , sequence_ )+import Data.Bool+import Data.Either+import Data.Eq+import Data.Foldable+import Data.Function hiding ( (.)+ , id )+import Data.Function.Pointless+import Data.Int+import Data.List hiding ( all+ , and+ , any+ , concat+ , concatMap+ , elem+ , filter+ , find+ , foldl+ , foldl'+ , foldl1+ , foldr+ , foldr1+ , mapAccumL+ , mapAccumR+ , maximum+ , maximumBy+ , minimum+ , minimumBy+ , notElem+ , or+ , product+ , sum )+import Data.Maybe+import Data.Monoid+import Data.Ord+import Data.String+import Data.Traversable+import Data.Tuple+import Filesystem.Path hiding ( (<.>)+ , concat+ , empty+ , null+ , stripPrefix )+import System.IO hiding ( FilePath )+import Text.Show++import qualified Prelude+import Prelude ( (+), (-), (*), (/), mod+ , seq, ($!)+ , undefined, fromIntegral )++-- | An either/maybe equivalent for Bool, often known as if'+if' :: a -- ^ Returned if the bool is True+ -> a -- ^ Returned if the bool is False+ -> Bool+ -> a+if' a _ True = a+if' _ a False = a++filter :: (Monad m, Monoid (m a), Foldable t) => (a -> Bool) -> t a -> m a+filter p = foldMap (\a -> if' (return a) mempty (p a))
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ general-prelude.cabal view
@@ -0,0 +1,24 @@+Name: general-prelude+Version: 0.1+Synopsis: Prelude replacement using generalized type classes where possible+Description: This Prelude prefers more general and performance-oriented types,+ such as Category, Foldable, Traversable, Data.Text and Control.Lens.+License: BSD3+License-file: LICENSE+Author: John Wiegley, Svein Ove Aas+Maintainer: johnw@newartisans.com+Category: Control, Data+Build-type: Simple+Cabal-version: >=1.10+Stability: Experimental++Library+ default-language: Haskell2010+ default-extensions: NoImplicitPrelude++ Build-Depends: base >= 4 && < 5+ , lens >= 3.0+ , pointless-fun >= 1.1.0.1+ , strict >= 0.3.2+ , system-filepath >= 0.4.7+ Exposed-modules: Prelude.General