From e0caddd119ed47c5e43a1c7864ee73561cdf1872 Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Sat, 21 Sep 2024 16:50:57 +0200 Subject: [PATCH] Move functions to own file --- byg/src/Functions.hs | 22 ++++++++++++++++++++++ byg/src/Main.hs | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 byg/src/Functions.hs 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