diff --git a/byg/src/Functions.hs b/byg/src/Functions.hs new file mode 100644 index 0000000..c49fbfa --- /dev/null +++ b/byg/src/Functions.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE GADTs #-} +module Functions where + +data Image = Image + deriving (Show) +data ImageConversion = ImageConversion + deriving (Show) + +data Function a b where + IsImageFilename :: Function FilePath Bool + ConvertedImageFilename :: Function FilePath FilePath + +deriving instance Show (Function a b) + +data FunctionIO a b where + ListDirectory :: FunctionIO FilePath [FilePath] + OpenImage :: FunctionIO FilePath Image + ConvertImage :: FunctionIO (Image, ImageConversion) Image + Save :: FunctionIO (a, FilePath) () + RunPandoc :: FunctionIO String String + +deriving instance Show (FunctionIO a b) diff --git a/byg/src/Main.hs b/byg/src/Main.hs index b45db29..71d7466 100644 --- a/byg/src/Main.hs +++ b/byg/src/Main.hs @@ -11,28 +11,6 @@ data Source a where -- Void :: Source () Data :: a -> Source a -data Image = Image - deriving (Show) -data ImageConversion = ImageConversion - deriving (Show) - -data Function a b where - IsImageFilename :: Function FilePath Bool - ConvertedImageFilename :: Function FilePath FilePath - -deriving instance Show (Function a b) - -data FunctionIO a b where - ListDirectory :: FunctionIO FilePath [FilePath] - OpenImage :: FunctionIO FilePath Image - ConvertImage :: FunctionIO (Image, ImageConversion) Image - Save :: FunctionIO (a, FilePath) () - RunPandoc :: FunctionIO String String - -deriving instance Show (FunctionIO a b) - - - -- data FlatComputation = Flat