Move functions to own file
This commit is contained in:
		
							
								
								
									
										22
									
								
								byg/src/Functions.hs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								byg/src/Functions.hs
									
									
									
									
									
										Normal 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)
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user