basic framework

This commit is contained in:
Jonathan Lamothe 2020-11-09 12:34:49 -05:00
parent aaf5801b34
commit 0a041c4f1f
4 changed files with 90 additions and 10 deletions

View File

@ -1,6 +1,31 @@
{-
subfix
Copyright (C) Jonathan Lamothe <jonathan@jlamothe.net>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
module Main where
import Lib
import SubFix (convert, decode, encode)
main :: IO ()
main = someFunc
main = interact $ do
input <- decode >>= either error return
let output = map convert input
return $ encode output
-- jl

View File

@ -1,6 +0,0 @@
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"

61
src/SubFix.hs Normal file
View File

@ -0,0 +1,61 @@
{-|
Module : SubFix
Description : core functions for subfix
Copyright : (C) Jonathan Lamothe
License : GPL-3
Maintainer : jonathan@jlamothe.net
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-}
module SubFix (
-- * Data Types
Caption (..),
-- * Functions
convert,
decode,
encode,
) where
-- | Defines a caption group
data Caption = Caption
{ capID :: Int
-- ^ The caption identifier
, capStart :: Integer
-- ^ The caption start time (in milliseconds)
, capEnd :: Integer
-- ^ The caption end time (in milliseconds)
, capText :: String
-- ^ The caption text
} deriving (Eq, Show)
-- | Applies the transformations to a caption group
convert :: Caption -> Caption
convert = undefined
-- | Decodes the text of a subtitle file
decode
:: String
-- ^ The encoded text
-> Either String [Caption]
-- ^ The resulting caption list, or a message describing the error
-- that occured.
decode = undefined
-- | Encodes a list of caption groups
encode :: [Caption] -> String
encode = undefined
--jl

View File

@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: ccd6d3f177151afd531307d68e3bf983deed87504a0dddaf8581f451ceec4fd0
-- hash: d007e87bb36671373e831d22ee6d19cedeec2d81a3e1543f413d672dc39ce9e5
name: subfix
version: 0.0.0
@ -29,7 +29,7 @@ source-repository head
library
exposed-modules:
Lib
SubFix
other-modules:
Paths_subfix
hs-source-dirs: