explicit-iomodes-text (empty) → 0.1
raw patch · 5 files changed
+200/−0 lines, 5 filesdep +basedep +explicit-iomodesdep +textsetup-changed
Dependencies added: base, explicit-iomodes, text
Files
- Data/Text/IO/ExplicitIOModes.hs +70/−0
- Data/Text/Lazy/IO/ExplicitIOModes.hs +70/−0
- LICENSE +31/−0
- Setup.hs +4/−0
- explicit-iomodes-text.cabal +25/−0
+ Data/Text/IO/ExplicitIOModes.hs view
@@ -0,0 +1,70 @@+{-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}++-------------------------------------------------------------------------------+-- |+-- Module : Data.Text.IO.ExplicitIOModes+-- Copyright : (c) 2010 Bas van Dijk+-- License : BSD3 (see the file LICENSE)+-- Maintainer : Bas van Dijk <v.dijk.bas@gmail.com>+--+-- This module lifts the 'Text' IO operations to handles with explicit+-- IOModes.+--+-------------------------------------------------------------------------------++module Data.Text.IO.ExplicitIOModes+ ( hGetLine+ , hGetContents++ , hPutStr+ , hPutStrLn+ ) where+++-------------------------------------------------------------------------------+-- Imports+-------------------------------------------------------------------------------++-- from base:+import System.IO ( IO )++-- from text:+import Data.Text ( Text )++import qualified Data.Text.IO as T ( hGetLine+ , hGetContents++ , hPutStr+ , hPutStrLn+ )++-- from explicit-iomodes:+import System.IO.ExplicitIOModes ( Handle+ , ReadModes, WriteModes+ )+import System.IO.ExplicitIOModes.Unsafe ( wrap, wrap2 )+++-------------------------------------------------------------------------------+-- Text I/O with file handles with explicit IOModes+-------------------------------------------------------------------------------++-- | Wraps @Data.Text.IO.'T.hGetLine'@.+hGetLine ∷ ReadModes ioMode ⇒ Handle ioMode → IO Text+hGetLine = wrap T.hGetLine++-- | Wraps @Data.Text.IO.'T.hGetContents'@.+hGetContents ∷ ReadModes ioMode ⇒ Handle ioMode → IO Text+hGetContents = wrap T.hGetContents+++-- | Wraps @Data.Text.IO.'T.hPutStr'@.+hPutStr ∷ WriteModes ioMode ⇒ Handle ioMode → Text → IO ()+hPutStr = wrap2 T.hPutStr++-- | Wraps @Data.Text.IO.'T.hPutStrLn'@.+hPutStrLn ∷ WriteModes ioMode ⇒ Handle ioMode → Text → IO ()+hPutStrLn = wrap2 T.hPutStrLn+++-- The End ---------------------------------------------------------------------
+ Data/Text/Lazy/IO/ExplicitIOModes.hs view
@@ -0,0 +1,70 @@+{-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}++-------------------------------------------------------------------------------+-- |+-- Module : Data.Text.Lazy.IO.ExplicitIOModes+-- Copyright : (c) 2010 Bas van Dijk+-- License : BSD3 (see the file LICENSE)+-- Maintainer : Bas van Dijk <v.dijk.bas@gmail.com>+--+-- This module lifts the lazy 'Text' IO operations to handles with explicit+-- IOModes.+--+-------------------------------------------------------------------------------++module Data.Text.Lazy.IO.ExplicitIOModes+ ( hGetLine+ , hGetContents++ , hPutStr+ , hPutStrLn+ ) where+++-------------------------------------------------------------------------------+-- Imports+-------------------------------------------------------------------------------++-- from base:+import System.IO ( IO )++-- from text:+import Data.Text.Lazy ( Text )++import qualified Data.Text.Lazy.IO as T ( hGetLine+ , hGetContents++ , hPutStr+ , hPutStrLn+ )++-- from explicit-iomodes:+import System.IO.ExplicitIOModes ( Handle+ , ReadModes, WriteModes+ )+import System.IO.ExplicitIOModes.Unsafe ( wrap, wrap2 )+++-------------------------------------------------------------------------------+-- Lazy Text I/O with file handles with explicit IOModes+-------------------------------------------------------------------------------++-- | Wraps @Data.Text.Lazy.IO.'T.hGetLine'@.+hGetLine ∷ ReadModes ioMode ⇒ Handle ioMode → IO Text+hGetLine = wrap T.hGetLine++-- | Wraps @Data.Text.Lazy.IO.'T.hGetContents'@.+hGetContents ∷ ReadModes ioMode ⇒ Handle ioMode → IO Text+hGetContents = wrap T.hGetContents+++-- | Wraps @Data.Text.Lazy.IO.'T.hPutStr'@.+hPutStr ∷ WriteModes ioMode ⇒ Handle ioMode → Text → IO ()+hPutStr = wrap2 T.hPutStr++-- | Wraps @Data.Text.Lazy.IO.'T.hPutStrLn'@.+hPutStrLn ∷ WriteModes ioMode ⇒ Handle ioMode → Text → IO ()+hPutStrLn = wrap2 T.hPutStrLn+++-- The End ---------------------------------------------------------------------
+ LICENSE view
@@ -0,0 +1,31 @@+Copyright (c) 2010 Bas van Dijk++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * The name of Bas van Dijk and the names of contributors may NOT+ be used to endorse or promote products derived from this+ software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,4 @@+#! /usr/bin/env runhaskell++import Distribution.Simple+main = defaultMain
+ explicit-iomodes-text.cabal view
@@ -0,0 +1,25 @@+name: explicit-iomodes-text+version: 0.1+cabal-version: >=1.6+build-type: Simple+license: BSD3+license-file: LICENSE+copyright: 2010 Bas van Dijk+author: Bas van Dijk+maintainer: Bas van Dijk <v.dijk.bas@gmail.com>+stability: experimental+category: System+synopsis: Extends explicit-iomodes with Text operations+description: Extends @explicit-iomodes@ with @Text@ operations++source-repository head+ Type: darcs+ Location: http://code.haskell.org/~basvandijk/code/explicit-iomodes-text++Library+ GHC-Options: -Wall+ build-depends: base >= 4 && < 4.3+ , text >= 0.7 && < 0.8+ , explicit-iomodes >= 0.4 && < 0.5+ exposed-modules: Data.Text.IO.ExplicitIOModes+ Data.Text.Lazy.IO.ExplicitIOModes