classy-prelude-conduit (empty) → 0.1.0.0
raw patch · 4 files changed
+86/−0 lines, 4 filesdep +basedep +classy-preludedep +conduitsetup-changed
Dependencies added: base, classy-prelude, conduit, xml-conduit
Files
- ClassyPrelude/Conduit.hs +43/−0
- LICENSE +20/−0
- Setup.hs +2/−0
- classy-prelude-conduit.cabal +21/−0
+ ClassyPrelude/Conduit.hs view
@@ -0,0 +1,43 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE FunctionalDependencies #-}+module ClassyPrelude.Conduit+ ( -- * Re-export+ module ClassyPrelude+ , module Data.Conduit+ -- * XML+ , X.Document (..)+ , X.Name (..)+ , X.Prologue (..)+ , X.Node (..)+ , X.Element (..)+ ) where++import ClassyPrelude+import ClassyPrelude.Classes++import Data.Conduit+import qualified Data.Conduit.List as CL+import qualified Data.Conduit.Binary as CB++import qualified Text.XML as X++instance Monad m => CanMap (Pipe l i o r m r) i o where+ map = CL.map+instance (Monad m, r ~ r') => CanFilter (Pipe l i i r m r') i where+ filter = CL.filter+instance (i ~ i', Monad m, m ~ m', u ~ r, o' ~ ()) => CanMapM_ (Pipe l i o u m r) i' o' m' where+ mapM_ = CL.mapM_+instance MonadResource m => CanReadFile (Pipe l i ByteString u m ()) where+ readFile = CB.sourceFile . unpack+instance (u ~ r, MonadResource m) => CanWriteFile (Pipe l ByteString o u m r) where+ writeFile = CB.sinkFile . unpack+instance (Monad m, accum ~ accum') => CanFold accum a (Pipe l a o u m accum') where+ fold = CL.fold++instance MonadIO m => CanReadFile (m X.Document) where+ readFile = liftIO . X.readFile X.def++instance CanWriteFileFunc X.Document where+ writeFileFunc fp = liftIO . X.writeFile X.def fp
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/++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.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ classy-prelude-conduit.cabal view
@@ -0,0 +1,21 @@+name: classy-prelude-conduit+version: 0.1.0.0+synopsis: conduit instances for classy-prelude+description: conduit instances for classy-prelude+homepage: https://github.com/snoyberg/classy-prelude+license: MIT+license-file: LICENSE+author: Michael Snoyman+maintainer: michael@snoyman.com+category: Control+build-type: Simple+cabal-version: >=1.8++library+ exposed-modules: ClassyPrelude.Conduit+ build-depends: base ==4.5.*+ build-depends: base >= 4 && < 5+ , conduit >= 0.5 && < 0.6+ , xml-conduit >= 1.0 && < 1.1+ , classy-prelude >= 0.1 && < 0.2+ ghc-options: -Wall -fno-warn-orphans