Split functions into two modules
This commit is contained in:
parent
28d430cf72
commit
1f3c2929fd
|
@ -19,8 +19,9 @@ library
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
Types
|
Types
|
||||||
Sources
|
Sources
|
||||||
Functions
|
FunctionImplementations
|
||||||
ComputationM
|
ComputationM
|
||||||
|
Functions
|
||||||
build-depends:
|
build-depends:
|
||||||
base
|
base
|
||||||
, mtl
|
, mtl
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
module FunctionImplementations
|
||||||
|
( IsImageFilename(..)
|
||||||
|
, ConvertedImageFilename(..)
|
||||||
|
, ListDirectory(..)
|
||||||
|
, OpenImage(..)
|
||||||
|
, ConvertImage(..)
|
||||||
|
, SaveFile(..)
|
||||||
|
, RunPandoc(..)
|
||||||
|
) where
|
||||||
|
|
||||||
|
import Sources()
|
||||||
|
import Types
|
||||||
|
|
||||||
|
data IsImageFilename = IsImageFilename deriving (Show)
|
||||||
|
instance IsFunction IsImageFilename FilePath Bool where
|
||||||
|
runF IsImageFilename _path = undefined
|
||||||
|
|
||||||
|
data ConvertedImageFilename = ConvertedImageFilename deriving (Show)
|
||||||
|
instance IsFunction ConvertedImageFilename FilePath FilePath where
|
||||||
|
runF ConvertedImageFilename _path = undefined
|
||||||
|
|
||||||
|
|
||||||
|
data ListDirectory = ListDirectory deriving (Show)
|
||||||
|
instance IsFunctionIO ListDirectory FilePath [FilePath] where
|
||||||
|
runFIO ListDirectory _path = undefined
|
||||||
|
|
||||||
|
data OpenImage = OpenImage deriving (Show)
|
||||||
|
instance IsFunctionIO OpenImage FilePath Image where
|
||||||
|
runFIO OpenImage _path = undefined
|
||||||
|
|
||||||
|
data ConvertImage = ConvertImage deriving (Show)
|
||||||
|
instance IsFunctionIO ConvertImage Image Image where
|
||||||
|
runFIO ConvertImage _image = undefined
|
||||||
|
|
||||||
|
data SaveFile = SaveFile deriving (Show)
|
||||||
|
instance IsFunctionIO SaveFile (String, FilePath) () where
|
||||||
|
runFIO SaveFile _source = undefined
|
||||||
|
|
||||||
|
data RunPandoc = RunPandoc deriving (Show)
|
||||||
|
instance IsFunctionIO RunPandoc String String where
|
||||||
|
runFIO RunPandoc _source = undefined
|
|
@ -9,39 +9,9 @@ module Functions
|
||||||
, runPandoc
|
, runPandoc
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Types
|
import FunctionImplementations
|
||||||
import ComputationM
|
import ComputationM
|
||||||
|
|
||||||
data IsImageFilename = IsImageFilename deriving (Show)
|
|
||||||
instance IsFunction IsImageFilename FilePath Bool where
|
|
||||||
runF IsImageFilename _path = undefined
|
|
||||||
|
|
||||||
data ConvertedImageFilename = ConvertedImageFilename deriving (Show)
|
|
||||||
instance IsFunction ConvertedImageFilename FilePath FilePath where
|
|
||||||
runF ConvertedImageFilename _path = undefined
|
|
||||||
|
|
||||||
|
|
||||||
data ListDirectory = ListDirectory deriving (Show)
|
|
||||||
instance IsFunctionIO ListDirectory FilePath [FilePath] where
|
|
||||||
runFIO ListDirectory _path = undefined
|
|
||||||
|
|
||||||
data OpenImage = OpenImage deriving (Show)
|
|
||||||
instance IsFunctionIO OpenImage FilePath Image where
|
|
||||||
runFIO OpenImage _path = undefined
|
|
||||||
|
|
||||||
data ConvertImage = ConvertImage deriving (Show)
|
|
||||||
instance IsFunctionIO ConvertImage Image Image where
|
|
||||||
runFIO ConvertImage _image = undefined
|
|
||||||
|
|
||||||
data SaveFile = SaveFile deriving (Show)
|
|
||||||
instance IsFunctionIO SaveFile (String, FilePath) () where
|
|
||||||
runFIO SaveFile _source = undefined
|
|
||||||
|
|
||||||
data RunPandoc = RunPandoc deriving (Show)
|
|
||||||
instance IsFunctionIO RunPandoc String String where
|
|
||||||
runFIO RunPandoc _source = undefined
|
|
||||||
|
|
||||||
|
|
||||||
isImageFilename = runFunction IsImageFilename
|
isImageFilename = runFunction IsImageFilename
|
||||||
convertedImageFilename = runFunction ConvertedImageFilename
|
convertedImageFilename = runFunction ConvertedImageFilename
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue