modular-prelude (empty) → 0.2.0.0
raw patch · 20 files changed
+1022/−0 lines, 20 filesdep +basedep +basic-preludedep +bytestringsetup-changed
Dependencies added: base, basic-prelude, bytestring, classy-prelude, containers, data-default, hashable, system-filepath, text, transformers, unordered-containers, vector
Files
- LICENSE +20/−0
- ModularPrelude.hs +8/−0
- ModularPrelude/ByteString.hs +61/−0
- ModularPrelude/Classy.hs +141/−0
- ModularPrelude/FilePath.hs +31/−0
- ModularPrelude/From.hs +19/−0
- ModularPrelude/HashMap.hs +52/−0
- ModularPrelude/HashSet.hs +50/−0
- ModularPrelude/Import.hs +40/−0
- ModularPrelude/LByteString.hs +61/−0
- ModularPrelude/LHashMap.hs +52/−0
- ModularPrelude/LText.hs +62/−0
- ModularPrelude/List.hs +72/−0
- ModularPrelude/Map.hs +52/−0
- ModularPrelude/Set.hs +50/−0
- ModularPrelude/Text.hs +62/−0
- ModularPrelude/UVector.hs +74/−0
- ModularPrelude/Vector.hs +68/−0
- Setup.hs +2/−0
- modular-prelude.cabal +45/−0
+ 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.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude+ ( module X+ ) where++import CorePrelude as X+import Data.Default as X
+ ModularPrelude/ByteString.hs view
@@ -0,0 +1,61 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.ByteString+ ( ByteStringModule (..)+ , _Data_ByteString_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.ByteString as S+import qualified Filesystem.Path.CurrentOS as F+++data ByteStringModule = ByteString+ { map :: (Word8 -> Word8) -> ByteString -> ByteString+ , concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString+ , filter :: (Word8 -> Bool) -> ByteString -> ByteString+ , length :: ByteString -> Int+ , singleton :: Word8 -> ByteString+ , null :: ByteString -> Bool+ , pack :: [Word8] -> ByteString+ , unpack :: ByteString -> [Word8]+ , empty :: ByteString+ , readFile :: FilePath -> IO ByteString+ , writeFile :: FilePath -> ByteString -> IO ()+ , break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+ , span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+ , dropWhile :: (Word8 -> Bool) -> ByteString -> ByteString+ , takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString+ , any :: (Word8 -> Bool) -> ByteString -> Bool+ , all :: (Word8 -> Bool) -> ByteString -> Bool+ , splitAt :: Int -> ByteString -> (ByteString, ByteString)+ }+++_Data_ByteString_ :: ByteStringModule+_Data_ByteString_ = ByteString+ { map = S.map+ , concatMap = S.concatMap+ , filter = S.filter+ , length = S.length+ , singleton = S.singleton+ , null = S.null+ , pack = S.pack+ , unpack = S.unpack+ , empty = S.empty+ , readFile = S.readFile . F.encodeString+ , writeFile = S.writeFile . F.encodeString+ , break = S.break+ , span = S.span+ , dropWhile = S.dropWhile+ , takeWhile = S.takeWhile+ , any = S.any+ , all = S.all+ , splitAt = S.splitAt+ }+++instance Default ByteStringModule where+ def = _Data_ByteString_+
+ ModularPrelude/Classy.hs view
@@ -0,0 +1,141 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE MultiParamTypeClasses #-}++module ModularPrelude.Classy+ ( ClassyModule (..)+ , _ClassyPrelude_Classes_+ ) where+++import ModularPrelude+import Prelude (Read) -- This should be in CorePrelude+import qualified ClassyPrelude as Classy+import qualified ClassyPrelude.Classes as Classy+import ClassyPrelude () -- Make sure we get all instances+import ClassyPrelude.Classes+ ( CanMap+ , CanConcatMap+ , CanFilter+ , CanLength+ , CanSingleton+ , CanNull+ , CanPack+ , CanMapM+ , CanMapM_+ , CanLookup+ , CanInsert+ , CanDelete+ , CanMember+ , CanReadFile+ , CanWriteFile+ , CanStripPrefix+ , CanBreak+ , CanAny+ , CanSplitAt+ , CanFold+ , CanWords+ , CanSplit+ , CanStripSuffix+ , CanIsInfixOf+ , CanReverse+ , CanReplicate+ )+++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]+ , 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+ }+++_ClassyPrelude_Classes_ :: ClassyModule+_ClassyPrelude_Classes_ = 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+ , show = Classy.show+ , readMay = Classy.readMay+ , repack = Classy.repack+ }+++instance Default ClassyModule where+ def = _ClassyPrelude_Classes_+
+ ModularPrelude/FilePath.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.FilePath+ ( FilePathModule (..)+ , _Filesystem_Path_CurrentOS_+ ) where+++import Prelude (String)+import ModularPrelude+import qualified Filesystem.Path.CurrentOS as F+++data FilePathModule = FilePath+ { pack :: String -> FilePath+ , unpack :: FilePath -> String+ , stripPrefix :: FilePath -> FilePath -> Maybe FilePath+ }+++_Filesystem_Path_CurrentOS_ :: FilePathModule+_Filesystem_Path_CurrentOS_ = FilePath+ { pack = F.decodeString+ , unpack = F.encodeString+ , stripPrefix = F.stripPrefix+ }+++instance Default FilePathModule where+ def = _Filesystem_Path_CurrentOS_+
+ ModularPrelude/From.hs view
@@ -0,0 +1,19 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.From ( module X ) where++import ModularPrelude.ByteString as X (_Data_ByteString_)+import ModularPrelude.LByteString as X (_Data_ByteString_Lazy_)+import ModularPrelude.Text as X (_Data_Text_)+import ModularPrelude.LText as X (_Data_Text_Lazy_)+import ModularPrelude.Vector as X (_Data_Vector_)+import ModularPrelude.UVector as X (_Data_Vector_Unboxed_)+import ModularPrelude.Map as X (_Data_Map_)+import ModularPrelude.HashMap as X (_Data_HashMap_Strict_)+import ModularPrelude.LHashMap as X (_Data_HashMap_Lazy_)+import ModularPrelude.List as X (_Data_List_)+import ModularPrelude.Set as X (_Data_Set_)+import ModularPrelude.HashSet as X (_Data_HashSet_)+import ModularPrelude.FilePath as X (_Filesystem_Path_CurrentOS_)+import ModularPrelude.Classy as X (_ClassyPrelude_Classes_)+
+ ModularPrelude/HashMap.hs view
@@ -0,0 +1,52 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.HashMap+ ( HashMapModule (..)+ , _Data_HashMap_Strict_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.HashMap.Strict as HashMap+++data HashMapModule = HashMap+ { map :: forall k a b. (a -> b) -> HashMap k a -> HashMap k b+ , filter :: forall k a. (k -> a -> Bool) -> HashMap k a -> HashMap k a+ , length :: forall k a. HashMap k a -> Int+ , singleton :: forall k a. Hashable k => k -> a -> HashMap k a+ , null :: forall k a. HashMap k a -> Bool+ , pack :: forall k a. (Eq k, Hashable k) => [(k, a)] -> HashMap k a+ , unpack :: forall k a. HashMap k a -> [(k, a)]+ , fromList :: forall k a. (Eq k, Hashable k) => [(k, a)] -> HashMap k a+ , toList :: forall k a. HashMap k a -> [(k, a)]+ , lookup :: forall k a. (Eq k, Hashable k) => k -> HashMap k a -> Maybe a+ , empty :: forall k a. HashMap k a+ , insert :: forall k a. (Eq k, Hashable k) => k -> a -> HashMap k a -> HashMap k a+ , delete :: forall k a. (Eq k, Hashable k) => k -> HashMap k a -> HashMap k a+ , member :: forall k a. (Eq k, Hashable k) => k -> HashMap k a -> Bool+ }+++_Data_HashMap_Strict_ :: HashMapModule+_Data_HashMap_Strict_ = HashMap+ { map = HashMap.map+ , filter = HashMap.filterWithKey+ , length = HashMap.size+ , singleton = HashMap.singleton+ , null = HashMap.null+ , pack = HashMap.fromList+ , unpack = HashMap.toList+ , fromList = HashMap.fromList+ , toList = HashMap.toList+ , lookup = HashMap.lookup+ , empty = HashMap.empty+ , insert = HashMap.insert+ , delete = HashMap.delete+ , member = HashMap.member+ }+++instance Default HashMapModule where+ def = _Data_HashMap_Strict_+
+ ModularPrelude/HashSet.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.HashSet+ ( HashSetModule (..)+ , _Data_HashSet_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.HashSet as HashSet+++data HashSetModule = HashSet+ { map :: forall a b. (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b+ , filter :: forall a. (a -> Bool) -> HashSet a -> HashSet a+ , length :: forall a. HashSet a -> Int+ , singleton :: forall a. Hashable a => a -> HashSet a+ , null :: forall a. HashSet a -> Bool+ , pack :: forall a. (Eq a, Hashable a) => [a] -> HashSet a+ , unpack :: forall a. HashSet a -> [a]+ , fromList :: forall a. (Eq a, Hashable a) => [a] -> HashSet a+ , toList :: forall a. HashSet a -> [a]+ , empty :: forall a. HashSet a+ , insert :: forall a. (Eq a, Hashable a) => a -> HashSet a -> HashSet a+ , delete :: forall a. (Eq a, Hashable a) => a -> HashSet a -> HashSet a+ , member :: forall a. (Eq a, Hashable a) => a -> HashSet a -> Bool+ }+++_Data_HashSet_ :: HashSetModule+_Data_HashSet_ = HashSet+ { map = HashSet.map+ , filter = HashSet.filter+ , length = HashSet.size+ , singleton = HashSet.singleton+ , null = HashSet.null+ , pack = HashSet.fromList+ , unpack = HashSet.toList+ , fromList = HashSet.fromList+ , toList = HashSet.toList+ , empty = HashSet.empty+ , insert = HashSet.insert+ , delete = HashSet.delete+ , member = HashSet.member+ }+++instance Default HashSetModule where+ def = _Data_HashSet_+
+ ModularPrelude/Import.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.Import where+++import ModularPrelude+import qualified ModularPrelude.From as From+++import qualified ModularPrelude.ByteString as Import+import qualified ModularPrelude.LByteString as Import+import qualified ModularPrelude.Text as Import+import qualified ModularPrelude.LText as Import+import qualified ModularPrelude.Vector as Import+import qualified ModularPrelude.UVector as Import+import qualified ModularPrelude.Map as Import+import qualified ModularPrelude.HashMap as Import+import qualified ModularPrelude.LHashMap as Import+import qualified ModularPrelude.List as Import+import qualified ModularPrelude.Set as Import+import qualified ModularPrelude.HashSet as Import+import qualified ModularPrelude.FilePath as Import+import qualified ModularPrelude.Classy as Import+++import qualified Data.ByteString as ByteString+import qualified Data.ByteString.Lazy as LByteString+import qualified Data.Text as Text+import qualified Data.Text.Lazy as LText+import qualified Data.Vector as Vector+import qualified Data.Vector.Unboxed as UVector+import qualified Data.Map as Map+import qualified Data.HashMap.Strict as HashMap+import qualified Data.HashMap.Lazy as LHashMap+import qualified Data.List as List+import qualified Data.Set as Set+import qualified Data.HashSet as HashSet+import qualified Filesystem.Path.CurrentOS as FilePath+import qualified ClassyPrelude as Classy+
+ ModularPrelude/LByteString.hs view
@@ -0,0 +1,61 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.LByteString+ ( LByteStringModule (..)+ , _Data_ByteString_Lazy_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.ByteString.Lazy as L+import qualified Filesystem.Path.CurrentOS as F+++data LByteStringModule = LByteString+ { map :: (Word8 -> Word8) -> LByteString -> LByteString+ , concatMap :: (Word8 -> LByteString) -> LByteString -> LByteString+ , filter :: (Word8 -> Bool) -> LByteString -> LByteString+ , length :: LByteString -> Int64+ , singleton :: Word8 -> LByteString+ , null :: LByteString -> Bool+ , pack :: [Word8] -> LByteString+ , unpack :: LByteString -> [Word8]+ , empty :: LByteString+ , readFile :: FilePath -> IO LByteString+ , writeFile :: FilePath -> LByteString -> IO ()+ , break :: (Word8 -> Bool) -> LByteString -> (LByteString, LByteString)+ , span :: (Word8 -> Bool) -> LByteString -> (LByteString, LByteString)+ , dropWhile :: (Word8 -> Bool) -> LByteString -> LByteString+ , takeWhile :: (Word8 -> Bool) -> LByteString -> LByteString+ , any :: (Word8 -> Bool) -> LByteString -> Bool+ , all :: (Word8 -> Bool) -> LByteString -> Bool+ , splitAt :: Int64 -> LByteString -> (LByteString, LByteString)+ }+++_Data_ByteString_Lazy_ :: LByteStringModule+_Data_ByteString_Lazy_ = LByteString+ { map = L.map+ , concatMap = L.concatMap+ , filter = L.filter+ , length = L.length+ , singleton = L.singleton+ , null = L.null+ , pack = L.pack+ , unpack = L.unpack+ , empty = L.empty+ , readFile = L.readFile . F.encodeString+ , writeFile = L.writeFile . F.encodeString+ , break = L.break+ , span = L.span+ , dropWhile = L.dropWhile+ , takeWhile = L.takeWhile+ , any = L.any+ , all = L.all+ , splitAt = L.splitAt+ }+++instance Default LByteStringModule where+ def = _Data_ByteString_Lazy_+
+ ModularPrelude/LHashMap.hs view
@@ -0,0 +1,52 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.LHashMap+ ( LHashMapModule (..)+ , _Data_HashMap_Lazy_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.HashMap.Lazy as LHashMap+++data LHashMapModule = LHashMap+ { map :: forall k a b. (a -> b) -> HashMap k a -> HashMap k b+ , filter :: forall k a. (k -> a -> Bool) -> HashMap k a -> HashMap k a+ , length :: forall k a. HashMap k a -> Int+ , singleton :: forall k a. Hashable k => k -> a -> HashMap k a+ , null :: forall k a. HashMap k a -> Bool+ , pack :: forall k a. (Eq k, Hashable k) => [(k, a)] -> HashMap k a+ , unpack :: forall k a. HashMap k a -> [(k, a)]+ , fromList :: forall k a. (Eq k, Hashable k) => [(k, a)] -> HashMap k a+ , toList :: forall k a. HashMap k a -> [(k, a)]+ , lookup :: forall k a. (Eq k, Hashable k) => k -> HashMap k a -> Maybe a+ , empty :: forall k a. HashMap k a+ , insert :: forall k a. (Eq k, Hashable k) => k -> a -> HashMap k a -> HashMap k a+ , delete :: forall k a. (Eq k, Hashable k) => k -> HashMap k a -> HashMap k a+ , member :: forall k a. (Eq k, Hashable k) => k -> HashMap k a -> Bool+ }+++_Data_HashMap_Lazy_ :: LHashMapModule+_Data_HashMap_Lazy_ = LHashMap+ { map = LHashMap.map+ , filter = LHashMap.filterWithKey+ , length = LHashMap.size+ , singleton = LHashMap.singleton+ , null = LHashMap.null+ , pack = LHashMap.fromList+ , unpack = LHashMap.toList+ , fromList = LHashMap.fromList+ , toList = LHashMap.toList+ , lookup = LHashMap.lookup+ , empty = LHashMap.empty+ , insert = LHashMap.insert+ , delete = LHashMap.delete+ , member = LHashMap.member+ }+++instance Default LHashMapModule where+ def = _Data_HashMap_Lazy_+
+ ModularPrelude/LText.hs view
@@ -0,0 +1,62 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.LText+ ( LTextModule (..)+ , _Data_Text_Lazy_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.Text.Lazy as TL+import qualified Data.Text.Lazy.IO as TL+import qualified Filesystem.Path.CurrentOS as F+++data LTextModule = LText+ { map :: (Char -> Char) -> LText -> LText+ , concatMap :: (Char -> LText) -> LText -> LText+ , filter :: (Char -> Bool) -> LText -> LText+ , length :: LText -> Int64+ , singleton :: Char -> LText+ , null :: LText -> Bool+ , pack :: [Char] -> LText+ , unpack :: LText -> [Char]+ , empty :: LText+ , readFile :: FilePath -> IO LText+ , writeFile :: FilePath -> LText -> IO ()+ , break :: (Char -> Bool) -> LText -> (LText, LText)+ , span :: (Char -> Bool) -> LText -> (LText, LText)+ , dropWhile :: (Char -> Bool) -> LText -> LText+ , takeWhile :: (Char -> Bool) -> LText -> LText+ , any :: (Char -> Bool) -> LText -> Bool+ , all :: (Char -> Bool) -> LText -> Bool+ , splitAt :: Int64 -> LText -> (LText, LText)+ }+++_Data_Text_Lazy_ :: LTextModule+_Data_Text_Lazy_ = LText+ { map = TL.map+ , concatMap = TL.concatMap+ , filter = TL.filter+ , length = TL.length+ , singleton = TL.singleton+ , null = TL.null+ , pack = TL.pack+ , unpack = TL.unpack+ , empty = TL.empty+ , readFile = TL.readFile . F.encodeString+ , writeFile = TL.writeFile . F.encodeString+ , break = TL.break+ , span = TL.span+ , dropWhile = TL.dropWhile+ , takeWhile = TL.takeWhile+ , any = TL.any+ , all = TL.all+ , splitAt = TL.splitAt+ }+++instance Default LTextModule where+ def = _Data_Text_Lazy_+
+ ModularPrelude/List.hs view
@@ -0,0 +1,72 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.List+ ( ListModule (..)+ , _Data_List_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.List as List+++data ListModule = List+ { map :: forall a b. (a -> b) -> [a] -> [b]+ , concatMap :: forall a b. (a -> [b]) -> [a] -> [b]+ , filter :: forall a. (a -> Bool) -> [a] -> [a]+ , length :: forall a. [a] -> Int+ , singleton :: forall a. a -> [a]+ , null :: forall a. [a] -> Bool+ , pack :: forall a. [a] -> [a]+ , unpack :: forall a. [a] -> [a]+ , fromList :: forall a. [a] -> [a]+ , toList :: forall a. [a] -> [a]+ , lookup :: forall k a. Eq k => k -> [(k, a)] -> Maybe a+ , empty :: forall a. [a]+ , insert :: forall a. a -> [a] -> [a]+ , delete :: forall a. Eq a => a -> [a] -> [a]+ , member :: forall a. Eq a => a -> [a] -> Bool+ , stripPrefix :: forall a. Eq a => [a] -> [a] -> Maybe [a]+ , break :: forall a. (a -> Bool) -> [a] -> ([a], [a])+ , span :: forall a. (a -> Bool) -> [a] -> ([a], [a])+ , dropWhile :: forall a. (a -> Bool) -> [a] -> [a]+ , takeWhile :: forall a. (a -> Bool) -> [a] -> [a]+ , any :: forall a. (a -> Bool) -> [a] -> Bool+ , all :: forall a. (a -> Bool) -> [a] -> Bool+ , splitAt :: forall a. Int -> [a] -> ([a], [a])+ , fold :: forall a b. (a -> b -> a) -> a -> [b] -> a+ }+++_Data_List_ :: ListModule+_Data_List_ = List+ { map = List.map+ , concatMap = List.concatMap+ , filter = List.filter+ , length = List.length+ , singleton = return+ , null = List.null+ , pack = id+ , unpack = id+ , fromList = id+ , toList = id+ , lookup = List.lookup+ , empty = []+ , insert = (:)+ , delete = List.delete+ , member = List.elem+ , stripPrefix = List.stripPrefix+ , break = List.break+ , span = List.span+ , dropWhile = List.dropWhile+ , takeWhile = List.takeWhile+ , any = List.any+ , all = List.all+ , splitAt = List.splitAt+ , fold = List.foldl'+ }+++instance Default ListModule where+ def = _Data_List_+
+ ModularPrelude/Map.hs view
@@ -0,0 +1,52 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.Map+ ( MapModule (..)+ , _Data_Map_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.Map as Map+++data MapModule = Map+ { map :: forall k a b. (a -> b) -> Map k a -> Map k b+ , filter :: forall k a. Ord k => (k -> a -> Bool) -> Map k a -> Map k a+ , length :: forall k a. Map k a -> Int+ , singleton :: forall k a. k -> a -> Map k a+ , null :: forall k a. Map k a -> Bool+ , pack :: forall k a. Ord k => [(k, a)] -> Map k a+ , unpack :: forall k a. Map k a -> [(k, a)]+ , fromList :: forall k a. Ord k => [(k, a)] -> Map k a+ , toList :: forall k a. Map k a -> [(k, a)]+ , lookup :: forall k a. Ord k => k -> Map k a -> Maybe a+ , empty :: forall k a. Map k a+ , insert :: forall k a. Ord k => k -> a -> Map k a -> Map k a+ , delete :: forall k a. Ord k => k -> Map k a -> Map k a+ , member :: forall k a. Ord k => k -> Map k a -> Bool+ }+++_Data_Map_ :: MapModule+_Data_Map_ = Map+ { map = Map.map+ , filter = Map.filterWithKey+ , length = Map.size+ , singleton = Map.singleton+ , null = Map.null+ , pack = Map.fromList+ , unpack = Map.toList+ , fromList = Map.fromList+ , toList = Map.toList+ , lookup = Map.lookup+ , empty = Map.empty+ , insert = Map.insert+ , delete = Map.delete+ , member = Map.member+ }+++instance Default MapModule where+ def = _Data_Map_+
+ ModularPrelude/Set.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.Set+ ( SetModule (..)+ , _Data_Set_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.Set as Set+++data SetModule = Set+ { map :: forall a b. (Ord a, Ord b) => (a -> b) -> Set a -> Set b+ , filter :: forall a. (a -> Bool) -> Set a -> Set a+ , length :: forall a. Set a -> Int+ , singleton :: forall a. a -> Set a+ , null :: forall a. Set a -> Bool+ , pack :: forall a. Ord a => [a] -> Set a+ , unpack :: forall a. Set a -> [a]+ , fromList :: forall a. Ord a => [a] -> Set a+ , toList :: forall a. Set a -> [a]+ , empty :: forall a. Set a+ , insert :: forall a. Ord a => a -> Set a -> Set a+ , delete :: forall a. Ord a => a -> Set a -> Set a+ , member :: forall a. Ord a => a -> Set a -> Bool+ }+++_Data_Set_ :: SetModule+_Data_Set_ = Set+ { map = Set.map+ , filter = Set.filter+ , length = Set.size+ , singleton = Set.singleton+ , null = Set.null+ , pack = Set.fromList+ , unpack = Set.toList+ , fromList = Set.fromList+ , toList = Set.toList+ , empty = Set.empty+ , insert = Set.insert+ , delete = Set.delete+ , member = Set.member+ }+++instance Default SetModule where+ def = _Data_Set_+
+ ModularPrelude/Text.hs view
@@ -0,0 +1,62 @@+{-# LANGUAGE NoImplicitPrelude #-}++module ModularPrelude.Text+ ( TextModule (..)+ , _Data_Text_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.Text as T+import qualified Data.Text.IO as T+import qualified Filesystem.Path.CurrentOS as F+++data TextModule = Text+ { map :: (Char -> Char) -> Text -> Text+ , concatMap :: (Char -> Text) -> Text -> Text+ , filter :: (Char -> Bool) -> Text -> Text+ , length :: Text -> Int+ , singleton :: Char -> Text+ , null :: Text -> Bool+ , pack :: [Char] -> Text+ , unpack :: Text -> [Char]+ , empty :: Text+ , readFile :: FilePath -> IO Text+ , writeFile :: FilePath -> Text -> IO ()+ , break :: (Char -> Bool) -> Text -> (Text, Text)+ , span :: (Char -> Bool) -> Text -> (Text, Text)+ , dropWhile :: (Char -> Bool) -> Text -> Text+ , takeWhile :: (Char -> Bool) -> Text -> Text+ , any :: (Char -> Bool) -> Text -> Bool+ , all :: (Char -> Bool) -> Text -> Bool+ , splitAt :: Int -> Text -> (Text, Text)+ }+++_Data_Text_ :: TextModule+_Data_Text_ = Text+ { map = T.map+ , concatMap = T.concatMap+ , filter = T.filter+ , length = T.length+ , singleton = T.singleton+ , null = T.null+ , pack = T.pack+ , unpack = T.unpack+ , empty = T.empty+ , readFile = T.readFile . F.encodeString+ , writeFile = T.writeFile . F.encodeString+ , break = T.break+ , span = T.span+ , dropWhile = T.dropWhile+ , takeWhile = T.takeWhile+ , any = T.any+ , all = T.all+ , splitAt = T.splitAt+ }+++instance Default TextModule where+ def = _Data_Text_+
+ ModularPrelude/UVector.hs view
@@ -0,0 +1,74 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.UVector+ ( UVectorModule (..)+ , _Data_Vector_Unboxed_+ , UVector+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.Vector.Unboxed as UV+++data UVectorModule = UVector+ { map :: forall a b. (Unbox a, Unbox b)+ => (a -> b) -> UVector a -> UVector b+ , concatMap :: forall a b. (Unbox a, Unbox b)+ => (a -> UVector b) -> UVector a -> UVector b+ , filter :: forall a. Unbox a => (a -> Bool) -> UVector a -> UVector a+ , length :: forall a. Unbox a => UVector a -> Int+ , singleton :: forall a. Unbox a => a -> UVector a+ , null :: forall a. Unbox a => UVector a -> Bool+ , pack :: forall a. Unbox a => [a] -> UVector a+ , unpack :: forall a. Unbox a => UVector a -> [a]+ , fromList :: forall a. Unbox a => [a] -> UVector a+ , toList :: forall a. Unbox a => UVector a -> [a]+ , mapM :: forall a b m. (Unbox a, Unbox b, Monad m)+ => (a -> m b) -> UVector a -> m (UVector b)+ , mapM_ :: forall a b m. (Unbox a, Unbox b, Monad m)+ => (a -> m b) -> UVector a -> m ()+ , empty :: forall a. Unbox a => UVector a+ , member :: forall a. Unbox a => Eq a => a -> UVector a -> Bool+ , break :: forall a. Unbox a => (a -> Bool) -> UVector a -> (UVector a, UVector a)+ , span :: forall a. Unbox a => (a -> Bool) -> UVector a -> (UVector a, UVector a)+ , dropWhile :: forall a. Unbox a => (a -> Bool) -> UVector a -> UVector a+ , takeWhile :: forall a. Unbox a => (a -> Bool) -> UVector a -> UVector a+ , any :: forall a. Unbox a => (a -> Bool) -> UVector a -> Bool+ , all :: forall a. Unbox a => (a -> Bool) -> UVector a -> Bool+ , splitAt :: forall a. Unbox a => Int -> UVector a -> (UVector a, UVector a)+ , fold :: forall a b. (Unbox a, Unbox b)+ => (a -> b -> a) -> a -> UVector b -> a+ }+++_Data_Vector_Unboxed_ :: UVectorModule+_Data_Vector_Unboxed_ = UVector+ { map = UV.map+ , concatMap = UV.concatMap+ , filter = UV.filter+ , length = UV.length+ , singleton = UV.singleton+ , null = UV.null+ , pack = UV.fromList+ , unpack = UV.toList+ , fromList = UV.fromList+ , toList = UV.toList+ , mapM = UV.mapM+ , mapM_ = UV.mapM_+ , empty = UV.empty+ , member = UV.any . (==)+ , break = UV.break+ , span = UV.span+ , dropWhile = UV.dropWhile+ , takeWhile = UV.takeWhile+ , any = UV.any+ , all = UV.all+ , splitAt = UV.splitAt+ , fold = UV.foldl'+ }+++instance Default UVectorModule where+ def = _Data_Vector_Unboxed_+
+ ModularPrelude/Vector.hs view
@@ -0,0 +1,68 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++module ModularPrelude.Vector+ ( VectorModule (..)+ , _Data_Vector_+ ) where+++import ModularPrelude hiding (empty)+import qualified Data.Vector as V+++data VectorModule = Vector+ { map :: forall a b. (a -> b) -> Vector a -> Vector b+ , concatMap :: forall a b. (a -> Vector b) -> Vector a -> Vector b+ , filter :: forall a. (a -> Bool) -> Vector a -> Vector a+ , length :: forall a. Vector a -> Int+ , singleton :: forall a. a -> Vector a+ , null :: forall a. Vector a -> Bool+ , pack :: forall a. [a] -> Vector a+ , unpack :: forall a. Vector a -> [a]+ , fromList :: forall a. [a] -> Vector a+ , toList :: forall a. Vector a -> [a]+ , mapM :: forall a b m. Monad m => (a -> m b) -> Vector a -> m (Vector b)+ , mapM_ :: forall a b m. Monad m => (a -> m b) -> Vector a -> m ()+ , empty :: forall a. Vector a+ , member :: forall a. Eq a => a -> Vector a -> Bool+ , break :: forall a. (a -> Bool) -> Vector a -> (Vector a, Vector a)+ , span :: forall a. (a -> Bool) -> Vector a -> (Vector a, Vector a)+ , dropWhile :: forall a.(a -> Bool) -> Vector a -> Vector a+ , takeWhile :: forall a.(a -> Bool) -> Vector a -> Vector a+ , any :: forall a.(a -> Bool) -> Vector a -> Bool+ , all :: forall a.(a -> Bool) -> Vector a -> Bool+ , splitAt :: forall a.Int -> Vector a -> (Vector a, Vector a)+ , fold :: forall a b. (a -> b -> a) -> a -> Vector b -> a+ }+++_Data_Vector_ :: VectorModule+_Data_Vector_ = Vector+ { map = V.map+ , concatMap = V.concatMap+ , filter = V.filter+ , length = V.length+ , singleton = V.singleton+ , null = V.null+ , pack = V.fromList+ , unpack = V.toList+ , fromList = V.fromList+ , toList = V.toList+ , mapM = V.mapM+ , mapM_ = V.mapM_+ , empty = V.empty+ , member = V.any . (==)+ , break = V.break+ , span = V.span+ , dropWhile = V.dropWhile+ , takeWhile = V.takeWhile+ , any = V.any+ , all = V.all+ , splitAt = V.splitAt+ , fold = V.foldl'+ }+++instance Default VectorModule where+ def = _Data_Vector_+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ modular-prelude.cabal view
@@ -0,0 +1,45 @@+name: modular-prelude+version: 0.2.0.0+synopsis: A new Prelude featuring first class modules++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+ , ModularPrelude.Import+ , ModularPrelude.FilePath+ , ModularPrelude.From+ , ModularPrelude.Set+ , ModularPrelude.List+ , ModularPrelude.Classy+ , ModularPrelude.LByteString+ , ModularPrelude.Vector+ , ModularPrelude.HashSet+ , ModularPrelude.UVector+ , ModularPrelude.Text+ , ModularPrelude.Map+ , ModularPrelude.LHashMap+ , ModularPrelude.ByteString+ , ModularPrelude.LText+ , ModularPrelude.HashMap++ build-depends: base==4.*+ , basic-prelude==0.2.0.*+ , classy-prelude==0.2.*+ , data-default==0.5.0.*+ , system-filepath==0.4.*+ , hashable+ , bytestring+ , text+ , transformers+ , containers+ , unordered-containers+ , vector