Move functions to own file

This commit is contained in:
Niels G. W. Serup 2024-09-21 16:50:57 +02:00
parent 6962c5cb17
commit e0caddd119
No known key found for this signature in database
GPG Key ID: 38EEEBCE67324F19
2 changed files with 22 additions and 22 deletions

22
byg/src/Functions.hs Normal file
View File

@ -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)

View File

@ -11,28 +11,6 @@ data Source a where
-- Void :: Source () -- Void :: Source ()
Data :: a -> Source a 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 -- data FlatComputation = Flat