packages feed

modular-prelude 0.2.0.0 → 0.3.0.0

raw patch · 31 files changed

+911/−964 lines, 31 filesdep −classy-prelude

Dependencies removed: classy-prelude

Files

ModularPrelude.hs view
@@ -1,8 +1,19 @@ {-# LANGUAGE NoImplicitPrelude #-} +-- | This module provides the core functions+-- and type declarations necessary to conveniently interact+-- with the standard modules provided with modular-prelude.+-- +-- It is recommended that you always import this module+-- when using other modules from modular-prelude. module ModularPrelude-    ( module X+    ( module CorePrelude+    , module Data.Default+    , Prelude.Read -- should be in CorePrelude     ) where -import CorePrelude as X-import Data.Default as X+import CorePrelude+import Data.Default++import qualified Prelude+
− ModularPrelude/ByteString.hs
@@ -1,61 +0,0 @@-{-# 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
@@ -1,141 +0,0 @@-{-# 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
@@ -1,31 +0,0 @@-{-# 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
@@ -1,19 +1,43 @@ {-# LANGUAGE NoImplicitPrelude #-} -module ModularPrelude.From ( module X ) where+-- | Here you will find the polymorphic values+-- which represent all of the interfaces+-- that a given module can fulfill.+-- You can tell which module a given polymorphic value represents+-- by removing the first and last underscores,+-- and replacing all other underscores with dots.+-- For example, @_Data_ByteString_@ represents the @Data.ByteString@ module.+-- +-- If you'd like to add a new instance for a given interface,+-- then you must import that module's corresponding typeclass+-- (those are not exported here).+module ModularPrelude.From+  ( X._Data_ByteString_+  , X._Data_ByteString_Lazy_+  , X._Data_Text_+  , X._Data_Text_Lazy_+  , X._Data_Vector_+  , X._Data_Vector_Unboxed_+  , X._Data_Map_+  , X._Data_HashMap_Strict_+  , X._Data_HashMap_Lazy_+  , X._Data_List_+  , X._Data_Set_+  , X._Data_HashSet_+  , X._Filesystem_Path_CurrentOS_+  ) 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_)+import ModularPrelude.Module.ByteString  as X (_Data_ByteString_)+import ModularPrelude.Module.LByteString as X (_Data_ByteString_Lazy_)+import ModularPrelude.Module.Text        as X (_Data_Text_)+import ModularPrelude.Module.LText       as X (_Data_Text_Lazy_)+import ModularPrelude.Module.Vector      as X (_Data_Vector_)+import ModularPrelude.Module.UVector     as X (_Data_Vector_Unboxed_)+import ModularPrelude.Module.Map         as X (_Data_Map_)+import ModularPrelude.Module.HashMap     as X (_Data_HashMap_Strict_)+import ModularPrelude.Module.LHashMap    as X (_Data_HashMap_Lazy_)+import ModularPrelude.Module.List        as X (_Data_List_)+import ModularPrelude.Module.Set         as X (_Data_Set_)+import ModularPrelude.Module.HashSet     as X (_Data_HashSet_)+import ModularPrelude.Module.FilePath    as X (_Filesystem_Path_CurrentOS_) 
− ModularPrelude/HashMap.hs
@@ -1,52 +0,0 @@-{-# 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
@@ -1,50 +0,0 @@-{-# 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
@@ -1,40 +0,0 @@-{-# 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
@@ -1,61 +0,0 @@-{-# 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
@@ -1,52 +0,0 @@-{-# 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
@@ -1,62 +0,0 @@-{-# 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
@@ -1,72 +0,0 @@-{-# 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
@@ -1,52 +0,0 @@-{-# 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/Module/ByteString.hs view
@@ -0,0 +1,68 @@+{-# LANGUAGE NoImplicitPrelude #-}++-- | This module provides a first-class version+-- of the "Data.ByteString" module.+module ModularPrelude.Module.ByteString+  ( -- * Module interface+    ByteStringModule (..)+    -- * Module contents+  , ByteStringImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import qualified Data.ByteString as ByteString+import qualified Filesystem.Path.CurrentOS as FilePath+++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)+  }+++class ByteStringImplements interface where+  _Data_ByteString_ :: interface++instance ByteStringImplements ByteStringModule where+  _Data_ByteString_ = ByteString+    { map       = ByteString.map+    , concatMap = ByteString.concatMap+    , filter    = ByteString.filter+    , length    = ByteString.length+    , singleton = ByteString.singleton+    , null      = ByteString.null+    , pack      = ByteString.pack+    , unpack    = ByteString.unpack+    , empty     = ByteString.empty+    , readFile  = ByteString.readFile . FilePath.encodeString+    , writeFile = ByteString.writeFile . FilePath.encodeString+    , break     = ByteString.break+    , span      = ByteString.span+    , dropWhile = ByteString.dropWhile+    , takeWhile = ByteString.takeWhile+    , any       = ByteString.any+    , all       = ByteString.all+    , splitAt   = ByteString.splitAt+    }+++instance Default ByteStringModule where+  def = _Data_ByteString_+
+ ModularPrelude/Module/FilePath.hs view
@@ -0,0 +1,38 @@+{-# LANGUAGE NoImplicitPrelude #-}++-- | This module provides a first-class version+-- of the "Filesystem.Path.CurrentOS" module.+module ModularPrelude.Module.FilePath+  ( -- Module interface+    FilePathModule (..)+    -- Module contents+  , FilePathImplements (..)+  ) where+++import Prelude (String)+import ModularPrelude+import qualified Filesystem.Path.CurrentOS as FilePath+++data FilePathModule = FilePath+  { pack        :: String -> FilePath+  , unpack      :: FilePath -> String+  , stripPrefix :: FilePath -> FilePath -> Maybe FilePath+  }+++class FilePathImplements interface where+  _Filesystem_Path_CurrentOS_ :: interface++instance FilePathImplements FilePathModule where+  _Filesystem_Path_CurrentOS_ = FilePath+    { pack        = FilePath.decodeString+    , unpack      = FilePath.encodeString+    , stripPrefix = FilePath.stripPrefix+    }+++instance Default FilePathModule where+  def = _Filesystem_Path_CurrentOS_+
+ ModularPrelude/Module/HashMap.hs view
@@ -0,0 +1,59 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.HashMap.Strict" module.+module ModularPrelude.Module.HashMap+  ( -- * Module interface+    HashMapModule (..)+    -- * Module contents+  , HashMapImplements (..)+  ) 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+  }+++class HashMapImplements interface where+  _Data_HashMap_Strict_ :: interface++instance HashMapImplements HashMapModule where+  _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/Module/HashSet.hs view
@@ -0,0 +1,57 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.HashSet" module.+module ModularPrelude.Module.HashSet+  ( -- * Module interface+    HashSetModule (..)+    -- * Module contents+  , HashSetImplements (..)+  ) 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+  }+++class HashSetImplements interface where+  _Data_HashSet_ :: interface++instance HashSetImplements HashSetModule where+  _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/Module/LByteString.hs view
@@ -0,0 +1,68 @@+{-# LANGUAGE NoImplicitPrelude #-}++-- | This module provides a first-class version+-- of the "Data.ByteString.Lazy" module.+module ModularPrelude.Module.LByteString+  ( -- * Module interface+    LByteStringModule (..)+    -- * Module contents+  , LByteStringImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import qualified Data.ByteString.Lazy as LByteString+import qualified Filesystem.Path.CurrentOS as FilePath+++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)+  }+++class LByteStringImplements interface where+  _Data_ByteString_Lazy_ :: interface++instance LByteStringImplements LByteStringModule where+  _Data_ByteString_Lazy_ = LByteString+    { map       = LByteString.map+    , concatMap = LByteString.concatMap+    , filter    = LByteString.filter+    , length    = LByteString.length+    , singleton = LByteString.singleton+    , null      = LByteString.null+    , pack      = LByteString.pack+    , unpack    = LByteString.unpack+    , empty     = LByteString.empty+    , readFile  = LByteString.readFile . FilePath.encodeString+    , writeFile = LByteString.writeFile . FilePath.encodeString+    , break     = LByteString.break+    , span      = LByteString.span+    , dropWhile = LByteString.dropWhile+    , takeWhile = LByteString.takeWhile+    , any       = LByteString.any+    , all       = LByteString.all+    , splitAt   = LByteString.splitAt+    }+++instance Default LByteStringModule where+  def = _Data_ByteString_Lazy_+
+ ModularPrelude/Module/LHashMap.hs view
@@ -0,0 +1,62 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.HashMap.Lazy" module.+-- +-- Note that the data type for this module is still HashMap,+-- and not LHashMap.+module ModularPrelude.Module.LHashMap+  ( -- * Module interface+    LHashMapModule (..)+    -- * Module contents+  , LHashMapImplements (..)+  ) 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+  }+++class LHashMapImplements interface where+  _Data_HashMap_Lazy_ :: interface++instance LHashMapImplements LHashMapModule where+  _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/Module/LText.hs view
@@ -0,0 +1,69 @@+{-# LANGUAGE NoImplicitPrelude #-}++-- | This module provides a first-class version+-- of the "Data.Text.Lazy" module.+module ModularPrelude.Module.LText+  ( -- * Module interface+    LTextModule (..)+    -- * Module contents+  , LTextImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import qualified Data.Text.Lazy as LText+import qualified Data.Text.Lazy.IO as LText+import qualified Filesystem.Path.CurrentOS as FilePath+++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)+  }+++class LTextImplements interface where+  _Data_Text_Lazy_ :: interface++instance LTextImplements LTextModule where+  _Data_Text_Lazy_ = LText+    { map       = LText.map+    , concatMap = LText.concatMap+    , filter    = LText.filter+    , length    = LText.length+    , singleton = LText.singleton+    , null      = LText.null+    , pack      = LText.pack+    , unpack    = LText.unpack+    , empty     = LText.empty+    , readFile  = LText.readFile . FilePath.encodeString+    , writeFile = LText.writeFile . FilePath.encodeString+    , break     = LText.break+    , span      = LText.span+    , dropWhile = LText.dropWhile+    , takeWhile = LText.takeWhile+    , any       = LText.any+    , all       = LText.all+    , splitAt   = LText.splitAt+    }+++instance Default LTextModule where+  def = _Data_Text_Lazy_+
+ ModularPrelude/Module/List.hs view
@@ -0,0 +1,79 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.List" module.+module ModularPrelude.Module.List+  ( -- * Module interface+    ListModule (..)+    -- * Module contents+  , ListImplements (..)+  ) 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+  }+++class ListImplements interface where+  _Data_List_ :: interface++instance ListImplements ListModule where+  _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      = (:) -- List.insert instead?+    , 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/Module/Map.hs view
@@ -0,0 +1,59 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.Map" module.+module ModularPrelude.Module.Map+  ( -- * Module interface+    MapModule (..)+    -- * Module contents+  , MapImplements (..)+  ) 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+  }+++class MapImplements interface where+  _Data_Map_ :: interface++instance MapImplements MapModule where+  _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/Module/Set.hs view
@@ -0,0 +1,57 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.Set" module.+module ModularPrelude.Module.Set+  ( -- * Module interface+    SetModule (..)+    -- * Module contents+  , SetImplements (..)+  ) 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+  }+++class SetImplements interface where+  _Data_Set_ :: interface++instance SetImplements SetModule where+  _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/Module/Text.hs view
@@ -0,0 +1,69 @@+{-# LANGUAGE NoImplicitPrelude #-}++-- | This module provides a first-class version+-- of the "Data.Text" module.+module ModularPrelude.Module.Text+  ( -- * Module interface+    TextModule (..)+    -- * Module contents+  , TextImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import qualified Data.Text as Text+import qualified Data.Text.IO as Text+import qualified Filesystem.Path.CurrentOS as FilePath+++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)+  }+++class TextImplements interface where+  _Data_Text_ :: interface++instance TextImplements TextModule where+  _Data_Text_ = Text+    { map       = Text.map+    , concatMap = Text.concatMap+    , filter    = Text.filter+    , length    = Text.length+    , singleton = Text.singleton+    , null      = Text.null+    , pack      = Text.pack+    , unpack    = Text.unpack+    , empty     = Text.empty+    , readFile  = Text.readFile . FilePath.encodeString+    , writeFile = Text.writeFile . FilePath.encodeString+    , break     = Text.break+    , span      = Text.span+    , dropWhile = Text.dropWhile+    , takeWhile = Text.takeWhile+    , any       = Text.any+    , all       = Text.all+    , splitAt   = Text.splitAt+    }+++instance Default TextModule where+  def = _Data_Text_+
+ ModularPrelude/Module/UVector.hs view
@@ -0,0 +1,80 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.Vector.Unboxed" module.+module ModularPrelude.Module.UVector+  ( -- * Module interface+    UVectorModule (..)+    -- * Module contents+  , UVectorImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import qualified Data.Vector.Unboxed as UVector+++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+  }+++class UVectorImplements interface where+  _Data_Vector_Unboxed_ :: interface++instance UVectorImplements UVectorModule where+  _Data_Vector_Unboxed_ = UVector+    { map       = UVector.map+    , concatMap = UVector.concatMap+    , filter    = UVector.filter+    , length    = UVector.length+    , singleton = UVector.singleton+    , null      = UVector.null+    , pack      = UVector.fromList+    , unpack    = UVector.toList+    , fromList  = UVector.fromList+    , toList    = UVector.toList+    , mapM      = UVector.mapM+    , mapM_     = UVector.mapM_+    , empty     = UVector.empty+    , member    = UVector.any . (==)+    , break     = UVector.break+    , span      = UVector.span+    , dropWhile = UVector.dropWhile+    , takeWhile = UVector.takeWhile+    , any       = UVector.any+    , all       = UVector.all+    , splitAt   = UVector.splitAt+    , fold      = UVector.foldl'+    }+++instance Default UVectorModule where+  def = _Data_Vector_Unboxed_+
+ ModularPrelude/Module/Vector.hs view
@@ -0,0 +1,75 @@+{-# LANGUAGE NoImplicitPrelude, PolymorphicComponents #-}++-- | This module provides a first-class version+-- of the "Data.Vector" module.+module ModularPrelude.Module.Vector+  ( -- * Module interface+    VectorModule (..)+    -- * Module contents+  , VectorImplements (..)+  ) where+++import ModularPrelude hiding (empty)+import qualified Data.Vector as Vector+++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+  }+++class VectorImplements interface where+  _Data_Vector_ :: interface++instance VectorImplements VectorModule where+  _Data_Vector_ = Vector+    { map       = Vector.map+    , concatMap = Vector.concatMap+    , filter    = Vector.filter+    , length    = Vector.length+    , singleton = Vector.singleton+    , null      = Vector.null+    , pack      = Vector.fromList+    , unpack    = Vector.toList+    , fromList  = Vector.fromList+    , toList    = Vector.toList+    , mapM      = Vector.mapM+    , mapM_     = Vector.mapM_+    , empty     = Vector.empty+    , member    = Vector.any . (==)+    , break     = Vector.break+    , span      = Vector.span+    , dropWhile = Vector.dropWhile+    , takeWhile = Vector.takeWhile+    , any       = Vector.any+    , all       = Vector.all+    , splitAt   = Vector.splitAt+    , fold      = Vector.foldl'+    }+++instance Default VectorModule where+  def = _Data_Vector_+
− ModularPrelude/Set.hs
@@ -1,50 +0,0 @@-{-# 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
@@ -1,62 +0,0 @@-{-# 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
@@ -1,74 +0,0 @@-{-# 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
@@ -1,68 +0,0 @@-{-# 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_-
modular-prelude.cabal view
@@ -1,5 +1,5 @@ name:                modular-prelude-version:             0.2.0.0+version:             0.3.0.0 synopsis:            A new Prelude featuring first class modules  homepage:            https://github.com/DanBurton/modular-prelude#readme@@ -14,26 +14,25 @@  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 +                     ,   ModularPrelude.From++                     ,     ModularPrelude.Module.FilePath+                     ,     ModularPrelude.Module.Set+                     ,     ModularPrelude.Module.List+                     ,     ModularPrelude.Module.LByteString+                     ,     ModularPrelude.Module.Vector+                     ,     ModularPrelude.Module.HashSet+                     ,     ModularPrelude.Module.UVector+                     ,     ModularPrelude.Module.Text+                     ,     ModularPrelude.Module.Map+                     ,     ModularPrelude.Module.LHashMap+                     ,     ModularPrelude.Module.ByteString+                     ,     ModularPrelude.Module.LText+                     ,     ModularPrelude.Module.HashMap+   build-depends:       base==4.*                      , basic-prelude==0.2.0.*-                     , classy-prelude==0.2.*                      , data-default==0.5.0.*                      , system-filepath==0.4.*                      , hashable@@ -43,3 +42,4 @@                      , containers                      , unordered-containers                      , vector+