-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A parser for .srt and .sub files -- -- A basic .srt and .sub parser based on attoparsec and text @package subtitleParser @version 0.1 -- | Common ADT for the project. Also serves as a place to provide instance -- declarations for the ADTs. module Text.Subtitles.Datatypes type Subtitles = [Line] -- | The core of the parser. each one of the constructor representing one -- part of the Line data Line Line :: Int -> Range -> Text -> Line index :: Line -> Int range :: Line -> Range subs :: Line -> Text data Range Range :: Time -> Time -> Range from :: Range -> Time to :: Range -> Time data Time Time :: Int -> Int -> Int -> Int -> Time hour :: Time -> Int minutes :: Time -> Int seconds :: Time -> Int frame :: Time -> Int instance Eq Time instance Ord Time instance Eq Range instance Ord Range instance Eq Line instance Ord Line instance Show Line instance Show Range instance Show Time -- | A basic parser for .srt files (subtitles) based on Attoparsec -- and Text module Text.Subtitles.SRT -- | Main Parser, gives you a list of all the Lines of the subtitle. It -- fails if the subtitle doesn't have any Lines. parseSubtitles :: Parser Subtitles -- | The individual Line parser. given the upper example return the -- corresponding Line representation parseSingleLine :: Parser Line