siphon-0.7: Encode and decode CSV files

Siphon

Synopsis

# Documentation

data Siphon f c a Source #

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.

Instances

 Functor (Siphon f c) Source # Methodsfmap :: (a -> b) -> Siphon f c a -> Siphon f c b #(<$) :: a -> Siphon f c b -> Siphon f c a # Applicative (Siphon f c) Source # Methodspure :: a -> Siphon f c a #(<*>) :: Siphon f c (a -> b) -> Siphon f c a -> Siphon f c b #(*>) :: Siphon f c a -> Siphon f c b -> Siphon f c b #(<*) :: Siphon f c a -> Siphon f c b -> Siphon f c a # Instances  Source # Methods Source # Methods Source # MethodsshowList :: [SiphonError] -> ShowS # Source # Methods newtype Indexed a Source # Constructors  Indexed FieldsindexedIndex :: Int Instances  Source # Methodsfmap :: (a -> b) -> Indexed a -> Indexed b #(<$) :: a -> Indexed b -> Indexed a # Eq (Indexed a) Source # Methods(==) :: Indexed a -> Indexed a -> Bool #(/=) :: Indexed a -> Indexed a -> Bool # Ord (Indexed a) Source # Methodscompare :: Indexed a -> Indexed a -> Ordering #(<) :: Indexed a -> Indexed a -> Bool #(<=) :: Indexed a -> Indexed a -> Bool #(>) :: Indexed a -> Indexed a -> Bool #(>=) :: Indexed a -> Indexed a -> Bool #max :: Indexed a -> Indexed a -> Indexed a #min :: Indexed a -> Indexed a -> Indexed a # Read (Indexed a) Source # MethodsreadsPrec :: Int -> ReadS (Indexed a) # Show (Indexed a) Source # MethodsshowsPrec :: Int -> Indexed a -> ShowS #show :: Indexed a -> String #showList :: [Indexed a] -> ShowS #

Arguments

 :: Monad m => Siphon Headed ByteString a -> Stream (Of ByteString) m () encoded csv -> Stream (Of a) m (Maybe SiphonError)

This adds one to the index because text editors consider line number to be one-based, not zero-based.

headed :: c -> (c -> Maybe a) -> Siphon Headed c a Source #

headless :: (c -> Maybe a) -> Siphon Headless c a Source #

indexed :: Int -> (c -> Maybe a) -> Siphon Indexed c a Source #