packages feed

modular-prelude-classy (empty) → 0.1.0.0

raw patch · 6 files changed

+218/−0 lines, 6 filesdep +basedep +classy-preludedep +modular-preludesetup-changed

Dependencies added: base, classy-prelude, modular-prelude

Files

+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2012 Dan Burton++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ ModularPrelude/Classy.hs view
@@ -0,0 +1,41 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides the core type classes+-- from "ClassyPrelude" necessary to conveniently interact+-- with the standard modules provided with modular-prelude-classy.+-- +-- It is recommended that you always import this module+-- -- *as well as "ModularPrelude"* --+-- when using other modules from modular-prelude-classy.+module ModularPrelude.Classy+  ( C.CanMap+  , C.CanConcatMap+  , C.CanFilter+  , C.CanLength+  , C.CanSingleton+  , C.CanNull+  , C.CanPack+  , C.CanMapM+  , C.CanMapM_+  , C.CanLookup+  , C.CanInsert+  , C.CanDelete+  , C.CanMember+  , C.CanReadFile+  , C.CanWriteFile+  , C.CanStripPrefix+  , C.CanBreak+  , C.CanAny+  , C.CanSplitAt+  , C.CanFold+  , C.CanWords+  , C.CanSplit+  , C.CanStripSuffix+  , C.CanIsInfixOf+  , C.CanReverse+  , C.CanReplicate+  ) where+++import qualified ClassyPrelude.Classes as C+
+ ModularPrelude/From/Classy.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE NoImplicitPrelude #-}++-- | Here you will find the polymorphic value+-- which represents all of the interfaces+-- that "ClassyPrelude" can fulfill.+module ModularPrelude.From.Classy+  ( X._ClassyPrelude_+  ) where++import ModularPrelude.Module.Classy as X (_ClassyPrelude_)+
+ ModularPrelude/Module/Classy.hs view
@@ -0,0 +1,121 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE MultiParamTypeClasses #-}++-- | This module provides the first-class version+-- of the "ClassyPrelude" module.+module ModularPrelude.Module.Classy+  ( -- * Module interface+    ClassyModule (..)+    -- * Module contents+  , ClassyPreludeImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import ModularPrelude.Classy++import qualified ClassyPrelude as Classy+import qualified ClassyPrelude.Classes as Classy (replicate)++data ClassyModule = Classy+  { map         :: CanMap       f i o => (i -> o) -> f+  , concatMap   :: CanConcatMap f i o => (i -> o) -> f+  , filter      :: CanFilter    f a   => (a -> Bool) -> f+  , length      :: CanLength    c i   => c -> i+  , singleton   :: CanSingleton c i   => i -> c+  , null        :: CanNull      c     => c -> Bool+  , pack        :: CanPack      c i   => [i] -> c+  , unpack      :: CanPack      c i   => c -> [i]+  , mapM        :: CanMapM    f m i o => (i -> m o) -> f+  , mapM_       :: CanMapM_   f m i   => (i -> m o) -> f+  , lookup      :: CanLookup    c k v => k -> c -> Maybe v+  , insert      :: CanInsert    f     => f+  , delete      :: CanDelete    c k   => k -> c -> c+  , member      :: CanMember    c k   => k -> c -> Bool+  , readFile    :: CanReadFile    a   => FilePath -> a+  , writeFile   :: CanWriteFile   a   => FilePath -> a+  , stripPrefix :: CanStripPrefix a   => a -> a -> Maybe a+  , break       :: CanBreak     c i   => (i -> Bool) -> c -> (c, c)+  , span        :: CanBreak     c i   => (i -> Bool) -> c -> (c, c)+  , dropWhile   :: CanBreak     c i   => (i -> Bool) -> c -> c+  , takeWhile   :: CanBreak     c i   => (i -> Bool) -> c -> c+  , any         :: CanAny       c i   => (i -> Bool) -> c -> Bool+  , all         :: CanAny       c i   => (i -> Bool) -> c -> Bool+  , splitAt     :: CanSplitAt   c i   => i -> c -> (c, c)+  , take        :: CanSplitAt   c i   => i -> c -> c+  , drop        :: CanSplitAt   c i   => i -> c -> c+  , fold        :: CanFold  f a accum => (accum -> a -> accum) -> accum -> f+  , words       :: CanWords       t   => t -> [t]+  , unwords     :: CanWords       t   => [t] -> t+  , lines       :: CanWords       t   => t -> [t]+  , unlines     :: CanWords       t   => [t] -> t+  , split       :: CanSplit     c i   => (i -> Bool) -> c -> [c]+  , stripSuffix :: CanStripSuffix a   => a -> a -> Maybe a+  , isSuffixOf  :: CanStripSuffix a   => a -> a -> Bool+  , isInfixOf   :: CanIsInfixOf   a   => a -> a -> Bool+  , reverse     :: CanReverse     a   => a -> a+  , replicate   :: CanReplicate a i l => l -> i -> a+  , fromList    :: CanPack      c i   => [i] -> c+  , toList      :: CanPack      c i   => c -> [i]+  , empty       :: Monoid w           => w+  , show        :: (Show a, CanPack c Char) => a -> c  +  , readMay     :: (Read b, CanPack a Char) => a -> Maybe b+  , repack      :: (CanPack a i, CanPack b i) => a -> b+  }+++class ClassyPreludeImplements interface where+  _ClassyPrelude_ :: interface++instance ClassyPreludeImplements ClassyModule where+  _ClassyPrelude_ = Classy+    { map         = Classy.map+    , concatMap   = Classy.concatMap+    , filter      = Classy.filter+    , length      = Classy.length+    , singleton   = Classy.singleton+    , null        = Classy.null+    , pack        = Classy.pack+    , unpack      = Classy.unpack+    , mapM        = Classy.mapM+    , mapM_       = Classy.mapM_+    , lookup      = Classy.lookup+    , insert      = Classy.insert+    , delete      = Classy.delete+    , member      = Classy.member+    , readFile    = Classy.readFile+    , writeFile   = Classy.writeFile+    , stripPrefix = Classy.stripPrefix+    , break       = Classy.break+    , span        = Classy.span+    , dropWhile   = Classy.dropWhile+    , takeWhile   = Classy.takeWhile+    , any         = Classy.any+    , all         = Classy.all+    , splitAt     = Classy.splitAt+    , take        = Classy.take+    , drop        = Classy.drop+    , fold        = Classy.fold+    , words       = Classy.words+    , unwords     = Classy.unwords+    , lines       = Classy.lines+    , unlines     = Classy.unlines+    , split       = Classy.split+    , stripSuffix = Classy.stripSuffix+    , isSuffixOf  = Classy.isSuffixOf+    , isInfixOf   = Classy.isInfixOf+    , reverse     = Classy.reverse+    , replicate   = Classy.replicate+    , fromList    = Classy.fromList+    , toList      = Classy.toList+    , empty       = Classy.empty+    , show        = Classy.show+    , readMay     = Classy.readMay+    , repack      = Classy.repack+    }+++instance Default ClassyModule where+  def = _ClassyPrelude_+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ modular-prelude-classy.cabal view
@@ -0,0 +1,23 @@+name:                modular-prelude-classy+version:             0.1.0.0+synopsis:            Reifying ClassyPrelude a la ModularPrelude++homepage:            https://github.com/DanBurton/modular-prelude#readme+license:             MIT+license-file:        LICENSE+author:              Dan Burton+maintainer:          danburton.email@gmail.com++category:            Control+build-type:          Simple+cabal-version:       >=1.8++library+  exposed-modules:     ModularPrelude.Classy+                     ,   ModularPrelude.From.Classy+                     ,   ModularPrelude.Module.Classy++  build-depends:       base==4.*+                     , classy-prelude==0.2.*+                     , modular-prelude==0.3.*+