-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | FIX (co)parser -- -- Financial Information eXchange (FIX) protocol (co)parser @package fixhs @version 0.1.3 module Data.FIX.Common delimiter :: Char module Data.Coparser class Coparser a coparse :: (Coparser a, BuilderLike t c) => a -> t class Enum c => BuilderLike a c | a -> c pack :: BuilderLike a c => String -> a unpack :: BuilderLike a c => a -> String singleton :: BuilderLike a c => Char -> a append :: BuilderLike a c => a -> a -> a concat :: BuilderLike a c => [a] -> a cons :: BuilderLike a c => Char -> a -> a snoc :: BuilderLike a c => a -> Char -> a decimal :: (BuilderLike a c, Integral i) => i -> a realFloat :: (BuilderLike a c, RealFloat r) => r -> a length :: BuilderLike a c => a -> Int foldl' :: BuilderLike a c => (b -> Char -> b) -> b -> a -> b foldl :: BuilderLike a c => (b -> Char -> b) -> b -> a -> b instance BuilderLike Builder Char instance BuilderLike (DList Char) Char instance BuilderLike ByteString Word8 instance BuilderLike String Char module Data.LookupTable class Ord k => LookupTable k v t | t -> k, t -> v new :: LookupTable k v t => t lookup :: LookupTable k v t => k -> t -> Maybe v insert :: LookupTable k v t => k -> v -> t -> t toList :: LookupTable k v t => t -> [(k, v)] fromList :: LookupTable k v t => [(k, v)] -> t instance LookupTable Int v (IntMap v) instance Ord k => LookupTable k v [(k, v)] instance Ord k => LookupTable k v (Map k v) -- | FIX messages module Data.FIX.Message data FIXValue FIXInt :: Int -> FIXValue FIXDouble :: Double -> FIXValue FIXChar :: Char -> FIXValue FIXBool :: Bool -> FIXValue FIXString :: ByteString -> FIXValue FIXData :: ByteString -> FIXValue FIXMultipleValueString :: ByteString -> FIXValue FIXTimestamp :: CalendarTime -> FIXValue FIXTimeOnly :: CalendarTime -> FIXValue FIXDateOnly :: CalendarTime -> FIXValue FIXMonthYear :: CalendarTime -> FIXValue FIXGroup :: Int -> [FIXGroupElement] -> FIXValue type FIXValues = ListOfValues FIXValue -- | A valid FIX field description. It is used to specify FIX messages -- using FIXMessageSpec. data FIXTag FIXTag :: String -> Int -> Parser FIXValue -> Gen FIXValue -> FIXTag -- | The name of the tag e.g. BeginString. tName :: FIXTag -> String -- | The numerical value of the tag e.g. 8. tnum :: FIXTag -> Int -- | The corresponding attoparsec parser. tparser :: FIXTag -> Parser FIXValue -- | A random generator for that particular types of fields. arbitraryValue :: FIXTag -> Gen FIXValue type FIXTags = ListOfTags FIXTag type FIXMessages = ListOfMessages FIXMessageSpec data FIXMessage a FIXMessage :: a -> ByteString -> FIXValues -> FIXValues -> FIXValues -> FIXMessage a mContext :: FIXMessage a -> a mType :: FIXMessage a -> ByteString mHeader :: FIXMessage a -> FIXValues mBody :: FIXMessage a -> FIXValues mTrailer :: FIXMessage a -> FIXValues data FIXMessageSpec FMSpec :: String -> ByteString -> FIXTags -> FIXTags -> FIXTags -> FIXMessageSpec msName :: FIXMessageSpec -> String msType :: FIXMessageSpec -> ByteString msHeader :: FIXMessageSpec -> FIXTags msBody :: FIXMessageSpec -> FIXTags msTrailer :: FIXMessageSpec -> FIXTags data FIXGroupSpec FGSpec :: FIXTag -> FIXTag -> FIXTags -> FIXGroupSpec gsLength :: FIXGroupSpec -> FIXTag gsSeperator :: FIXGroupSpec -> FIXTag gsBody :: FIXGroupSpec -> FIXTags data FIXGroupElement FIXGroupElement :: Int -> FIXValue -> FIXValues -> FIXGroupElement data FIXSpec FSpec :: String -> FIXTags -> FIXTags -> FIXMessages -> FIXTags -> FIXSpec -- | FIX version fsVersion :: FIXSpec -> String -- | FIX header tags fsHeader :: FIXSpec -> FIXTags -- | FIX trailer tags fsTrailer :: FIXSpec -> FIXTags -- | Dictionary of all FIX messages fsMessages :: FIXSpec -> FIXMessages -- | Dictionary of all FIX tags fsTags :: FIXSpec -> FIXTags checksum :: (BuilderLike t c, Enum c) => t -> Int delimiter :: Char instance LookupTable Int a (ListOfValues a) instance LookupTable Int a (ListOfTags a) instance LookupTable ByteString a (ListOfMessages a) instance Show a => Show (ListOfValues a) module Data.FIX.Arbitrary arbibtraryFIXValues :: FIXTags -> Gen FIXValues arbibtraryFIXGroup :: FIXGroupSpec -> Gen FIXValue arbitraryFIXMessage :: FIXSpec -> FIXMessageSpec -> Gen (FIXMessage FIXSpec) instance Arbitrary CalendarTime instance Arbitrary ByteString module Data.FIX.Parser -- | Given the FIX specification deserialize the FIX message. messageP :: FIXSpec -> ByteString -> Parser (FIXMessage FIXSpec) groupP :: FIXGroupSpec -> Parser FIXValue -- | Match the next FIX message (only text) in the stream. The checksum is -- validated. nextP :: Parser ByteString -- | Match the next FIX message (only text) in the stream. The checksum is -- NOT validated. nextP' :: Parser ByteString toFIXInt :: Parser ByteString FIXValue toFIXChar :: Parser ByteString FIXValue toFIXString :: Parser ByteString FIXValue toFIXDouble :: Parser ByteString FIXValue toFIXBool :: Parser ByteString FIXValue toFIXMultipleValueString :: Parser ByteString FIXValue toFIXTimestamp :: Parser ByteString FIXValue toFIXTimeOnly :: Parser ByteString FIXValue toFIXData :: Parser ByteString FIXValue toFIXDateOnly :: Parser ByteString FIXValue toFIXMonthYear :: Parser ByteString FIXValue tBeginString :: FIXTag tCheckSum :: FIXTag tBodyLength :: FIXTag tMsgType :: FIXTag module Data.FIX.Spec.FIX41 fix41 :: FIXSpec module Data.FIX.Spec.FIX42 fix42 :: FIXSpec module Data.FIX.Coparser coparse :: (Coparser a, BuilderLike t c) => a -> t instance Coparser FIXValue instance Coparser FIXGroupElement instance Coparser (FIXMessage FIXSpec) instance Coparser FIXValues module Data.FIX.Spec.FIX40 fix40 :: FIXSpec