From b23136b1aed02febbe0fa539c2b74edbecd9e1e0 Mon Sep 17 00:00:00 2001 From: michaelt Date: Wed, 5 Feb 2014 05:00:39 -0500 Subject: [PATCH 1/1] rearranged internal modules to placate haddock --- .DS_Store | Bin 6148 -> 12292 bytes Pipes/Text/Internal.hs | 16 ++++------------ Pipes/Text/Internal/Codec.hs | 16 +++++++--------- Pipes/Text/Internal/Decoding.hs | 23 +++++++++++++---------- changelog | 15 +++++++++++++++ pipes-text.cabal | 4 ++-- 6 files changed, 41 insertions(+), 33 deletions(-) diff --git a/.DS_Store b/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..a67b8b2d4ae60e498f8b5b821d926bed7adb7ba4 100644 GIT binary patch literal 12292 zcmeHMTWl3Y7@qG?VAu870W7W1l7o$=Vv%DD76j>`Exmw*hPJeY+Op^DN>{hL_3WM& zErpZ58HmOk4;n8oK8Uv$0b_j9M2Y&OXo4m_sIO`wiNP1+KRer|7aM&rrqP*X=9``W z|L5|ZZ+0?!7-MKESa&m4!5Gsh3*-hBf0Be<!4NMEXjvUO-|NiVV~#yO#8>4^H&-Ah zdyngOIgi;vZ_alMBVOd4%lod|=?6~e_+EcsXrBm$kLYNQsqaYO=fmbGu+O3XrPpdP z#=%h$92~au0U$+~vWxS+4!405(-Io|Oj z^b>fY^Ppqr^;M|VyFGKnmQm}Hl{&wm4Oley1HL7EtjLmFmrQBeQPJL}IaXsmDp7?yP=|VK!#&uE7VJeE+HnAf(Tjc@!7(^^2rfoYz$u(Y5s%|(JcH+O z4zJ=ZT*UkM2p{7zKF2rs0YBnbIk&{LhWAZRTOzI#&TK`}aQrDP@$4cRZfoyYyRUWW zYWQlYQ0~oTYs)JlDc{@JJfntr0+=ntNPALTk?5vH70G(8l5bhJzB0MNNG&Ft9@4CR zLKB;Uue=g@lfZ=lxh5ZLlAAQzAUqL08k>__g#7t3X^muU>3q4gHW)j^R^TPly35!t zM9)`9>jtAq*Ey39HOW?8R4CabA9hPwM}b#uDg0#k_;@9v#JpH|GkTU|6h`GSCdi< zCnckLAAW0XY_enp8<2o=$FoG`kM6VCi$Nc9xCikM7{MTyix x>0kd4pw54F{zuAFgw5b%57j@%+A3f$P5w! nif{u7S0Gm1SoocJGQW%>BjaRK8EqaWh$$e088*lB%wYxq^qUTk diff --git a/Pipes/Text/Internal.hs b/Pipes/Text/Internal.hs index 2530b23..582ef14 100644 --- a/Pipes/Text/Internal.hs +++ b/Pipes/Text/Internal.hs @@ -1,15 +1,7 @@ module Pipes.Text.Internal - ( Decoding(..) - , streamDecodeUtf8 - , decodeSomeUtf8 - , Codec(..) - , TextException(..) - , utf8 - , utf16_le - , utf16_be - , utf32_le - , utf32_be + (module Pipes.Text.Internal.Codec + , module Pipes.Text.Internal.Decoding ) where -import Pipes.Text.Internal.Decoding -import Pipes.Text.Internal.Codec \ No newline at end of file +import Pipes.Text.Internal.Codec +import Pipes.Text.Internal.Decoding \ No newline at end of file diff --git a/Pipes/Text/Internal/Codec.hs b/Pipes/Text/Internal/Codec.hs index 63cbd74..075a152 100644 --- a/Pipes/Text/Internal/Codec.hs +++ b/Pipes/Text/Internal/Codec.hs @@ -4,17 +4,15 @@ -- Copyright: 2014 Michael Thompson, 2011 Michael Snoyman, 2010-2011 John Millikin -- License: MIT -- This Parts of this code were taken from enumerator and conduits, and adapted for pipes -{- | This module follows the model of the enumerator and conduits libraries, and defines - 'Codec' s for various encodings. Note that we do not export a 'Codec' for ascii and - iso8859_1. A 'Lens' in the sense of the pipes library cannot be defined for these, so - special functions appear in @Pipes.Text@ --} + +-- This module follows the model of the enumerator and conduits libraries, and defines +-- 'Codec' s for various encodings. Note that we do not export a 'Codec' for ascii and +-- iso8859_1. A 'Lens' in the sense of the pipes library cannot be defined for these, so +-- special functions appear in @Pipes.Text@ + module Pipes.Text.Internal.Codec - ( Decoding(..) - , streamDecodeUtf8 - , decodeSomeUtf8 - , Codec(..) + ( Codec(..) , TextException(..) , utf8 , utf16_le diff --git a/Pipes/Text/Internal/Decoding.hs b/Pipes/Text/Internal/Decoding.hs index 4b4bbe6..b5d928a 100644 --- a/Pipes/Text/Internal/Decoding.hs +++ b/Pipes/Text/Internal/Decoding.hs @@ -2,11 +2,10 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, MagicHash, UnliftedFFITypes #-} {-# LANGUAGE DeriveDataTypeable, RankNTypes #-} -{- | -This module lifts assorted materials from Brian O'Sullivan's text package -especially @Data.Text.Encoding@ in order to define a pipes-appropriate -'streamDecodeUtf8' --} +-- This module lifts assorted materials from Brian O'Sullivan's text package +-- especially @Data.Text.Encoding@ in order to define a pipes-appropriate +-- 'streamDecodeUtf8' + module Pipes.Text.Internal.Decoding ( Decoding(..) , streamDecodeUtf8 @@ -43,9 +42,13 @@ import Data.Maybe (catMaybes) --- | A stream oriented decoding result. Distinct from the similar type in @Data.Text.Encoding@ -data Decoding = Some Text ByteString (ByteString -> Decoding) -- | Text, continuation and any undecoded fragment. - | Other Text ByteString -- | Text followed by an undecodable ByteString +-- A stream oriented decoding result. Distinct from the similar type in Data.Text.Encoding + +data Decoding = Some Text ByteString (ByteString -> Decoding) + -- Text, continuation and any undecoded fragment. + | Other Text ByteString + -- Text followed by an undecodable ByteString + instance Show Decoding where showsPrec d (Some t bs _) = showParen (d > prec) $ showString "Some " . showsPrec prec' t . @@ -61,7 +64,7 @@ instance Show Decoding where newtype CodePoint = CodePoint Word32 deriving (Eq, Show, Num, Storable) newtype DecoderState = DecoderState Word32 deriving (Eq, Show, Num, Storable) --- | Resolve a 'ByteString' into 'Text' and a continuation that can handle further 'ByteStrings'. +-- Resolve a 'ByteString' into 'Text' and a continuation that can handle further 'ByteStrings'. streamDecodeUtf8 :: ByteString -> Decoding streamDecodeUtf8 = decodeChunkUtf8 B.empty 0 0 where @@ -95,7 +98,7 @@ streamDecodeUtf8 = decodeChunkUtf8 B.empty 0 0 {-# INLINE decodeChunkUtf8 #-} {-# INLINE streamDecodeUtf8 #-} --- | Resolve a ByteString into an initial segment of intelligible 'Text' and whatever is unintelligble +-- Resolve a ByteString into an initial segment of intelligible 'Text' and whatever is unintelligble decodeSomeUtf8 :: ByteString -> (Text, ByteString) decodeSomeUtf8 bs@(PS fp off len) = runST $ do dest <- A.new (len+1) diff --git a/changelog b/changelog index 631aed3..6569002 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,18 @@ + # Version 0.0.0.5 + + * Rearranged internal modules + + + # Version 0.0.0.4 + + * Altered bad haddock markup + + + # Version 0.0.0.3 + + * Actually added changelog + + # Version 0.0.0.2 * Omit `stdinLn` as likely to be dangerous through misunderstanding. diff --git a/pipes-text.cabal b/pipes-text.cabal index cb828a7..c5b47d0 100644 --- a/pipes-text.cabal +++ b/pipes-text.cabal @@ -1,5 +1,5 @@ name: pipes-text -version: 0.0.0.2 +version: 0.0.0.4 synopsis: Text pipes. description: Many of the pipes and other operations defined here mirror those in the `pipes-bytestring` library. Folds like `length` and grouping @@ -31,7 +31,7 @@ category: Text, Pipes build-type: Simple cabal-version: >=1.10 -extra-source-files: README.md include/*.h +extra-source-files: README.md include/*.h changelog source-repository head type: git location: https://github.com/michaelt/text-pipes -- 2.41.0