Move functions to own file
This commit is contained in:
parent
6962c5cb17
commit
e0caddd119
|
@ -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)
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue