-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Encode and decode CSV files -- -- Please see README.md @package siphon @version 0.7 module Siphon.Types -- | This just actually a specialization of the free applicative. Check out -- Control.Applicative.Free in the free library to -- learn more about this. The meanings of the fields are documented -- slightly more in the source code. Unfortunately, haddock does not play -- nicely with GADTs. data Siphon f c a [SiphonPure] :: !a -> Siphon f c a [SiphonAp] :: !(f c) -> !(c -> Maybe a) -> !(Siphon f c (a -> b)) -> Siphon f c b newtype Indexed a Indexed :: Int -> Indexed a [indexedIndex] :: Indexed a -> Int data SiphonError SiphonError :: !Int -> !RowError -> SiphonError [siphonErrorRow] :: SiphonError -> !Int [siphonErrorCause] :: SiphonError -> !RowError data RowError -- | Error occurred parsing the document into cells RowErrorParse :: RowError -- | Error decoding the content RowErrorDecode :: !(Vector CellError) -> RowError -- | Wrong number of cells in the row RowErrorSize :: !Int -> !Int -> RowError -- | Three parts: (a) Multiple header cells matched the same expected cell, -- (b) Headers that were missing, (c) Missing headers that were lambdas. -- They cannot be shown so instead their positions in the Siphon -- are given. RowErrorHeaders :: !(Vector (Vector CellError)) -> !(Vector Text) -> !(Vector Int) -> RowError -- | Not enough cells in header, expected, actual RowErrorHeaderSize :: !Int -> !Int -> RowError -- | Error decoding unicode content, column number RowErrorMalformed :: !Int -> RowError data CellError CellError :: !Int -> !Text -> CellError [cellErrorColumn] :: CellError -> !Int [cellErrorContent] :: CellError -> !Text instance GHC.Classes.Eq Siphon.Types.SiphonError instance GHC.Read.Read Siphon.Types.SiphonError instance GHC.Show.Show Siphon.Types.SiphonError instance GHC.Classes.Eq Siphon.Types.RowError instance GHC.Read.Read Siphon.Types.RowError instance GHC.Show.Show Siphon.Types.RowError instance GHC.Read.Read (Siphon.Types.Indexed a) instance GHC.Show.Show (Siphon.Types.Indexed a) instance GHC.Base.Functor Siphon.Types.Indexed instance GHC.Classes.Ord (Siphon.Types.Indexed a) instance GHC.Classes.Eq (Siphon.Types.Indexed a) instance GHC.Classes.Eq Siphon.Types.CellError instance GHC.Read.Read Siphon.Types.CellError instance GHC.Show.Show Siphon.Types.CellError instance GHC.Exception.Exception Siphon.Types.SiphonError instance GHC.Base.Functor (Siphon.Types.Siphon f c) instance GHC.Base.Applicative (Siphon.Types.Siphon f c) module Siphon -- | This just actually a specialization of the free applicative. Check out -- Control.Applicative.Free in the free library to -- learn more about this. The meanings of the fields are documented -- slightly more in the source code. Unfortunately, haddock does not play -- nicely with GADTs. data Siphon f c a data SiphonError newtype Indexed a Indexed :: Int -> Indexed a [indexedIndex] :: Indexed a -> Int decodeHeadedUtf8Csv :: Monad m => Siphon Headed ByteString a -> Stream (Of ByteString) m () -> Stream (Of a) m (Maybe SiphonError) encodeHeadedUtf8Csv :: Monad m => Colonnade Headed a ByteString -> Stream (Of a) m r -> Stream (Of ByteString) m r -- | This adds one to the index because text editors consider line number -- to be one-based, not zero-based. humanizeSiphonError :: SiphonError -> String headed :: c -> (c -> Maybe a) -> Siphon Headed c a headless :: (c -> Maybe a) -> Siphon Headless c a indexed :: Int -> (c -> Maybe a) -> Siphon Indexed c a instance GHC.Base.Functor (Siphon.EitherWrap a) instance GHC.Show.Show c => GHC.Show.Show (Siphon.CellResult c) instance GHC.Show.Show Siphon.Ended instance GHC.Base.Monoid Siphon.HeaderErrors instance GHC.Base.Monoid a => GHC.Base.Applicative (Siphon.EitherWrap a)