siphon-0.7: Encode and decode CSV files

Safe HaskellNone
LanguageHaskell2010

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 # 

Methods

fmap :: (a -> b) -> Siphon f c a -> Siphon f c b #

(<$) :: a -> Siphon f c b -> Siphon f c a #

Applicative (Siphon f c) Source # 

Methods

pure :: 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 #

newtype Indexed a Source #

Constructors

Indexed 

Fields

Instances

Functor Indexed Source # 

Methods

fmap :: (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 # 

Methods

compare :: 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 # 
Show (Indexed a) Source # 

Methods

showsPrec :: Int -> Indexed a -> ShowS #

show :: Indexed a -> String #

showList :: [Indexed a] -> ShowS #

decodeHeadedUtf8Csv Source #

Arguments

:: Monad m 
=> Siphon Headed ByteString a 
-> Stream (Of ByteString) m ()

encoded csv

-> Stream (Of a) m (Maybe SiphonError) 

humanizeSiphonError :: SiphonError -> String Source #

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 #