Put sources functionality in its own file
This commit is contained in:
parent
4e412e4366
commit
2549d5af1b
|
@ -6,11 +6,6 @@ module Main where
|
|||
import Unsafe.Coerce (unsafeCoerce)
|
||||
import Control.Monad.State
|
||||
import Control.Monad.Writer
|
||||
import Data.ByteString (ByteString)
|
||||
|
||||
data Source a where
|
||||
-- Void :: Source ()
|
||||
Data :: a -> Source a
|
||||
|
||||
|
||||
-- data FlatComputation = Flat
|
||||
|
@ -27,16 +22,6 @@ data Source a where
|
|||
data ComputationRun a b = ComputationRun (Function a b)
|
||||
| ComputationRunIO (FunctionIO a b)
|
||||
|
||||
class SourceState a where
|
||||
stateOfSource :: a -> IO ByteString
|
||||
-- makeChecker :: a -> IO (a -> Bool)
|
||||
|
||||
instance SourceState FilePath where
|
||||
stateOfSource = undefined
|
||||
-- makeChecker = undefined
|
||||
|
||||
class SourceState a => IsFIO f a b | f -> a b where
|
||||
runFIO :: f -> a -> IO b
|
||||
|
||||
data ListDirectory' = ListDirectory'
|
||||
instance IsFIO ListDirectory' FilePath [FilePath] where
|
||||
|
@ -80,11 +65,6 @@ data Dependency ta a tb b = Dependency (Token ta a) (TypedRun a b) (Token tb b)
|
|||
data DependencyUntyped where
|
||||
DependencyUntyped :: Dependency ta a tb b -> String -> DependencyUntyped
|
||||
|
||||
--deriving instance Show DependencyUntyped
|
||||
|
||||
-- showDU :: DependencyUntyped -> String
|
||||
-- showDU (DependencyUntyped d) = show d
|
||||
|
||||
instance Show DependencyUntyped where
|
||||
show (DependencyUntyped _ s) = s
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{-# LANGUAGE FunctionalDependencies #-}
|
||||
module Sources where
|
||||
|
||||
import Data.ByteString (ByteString)
|
||||
|
||||
data Source a where
|
||||
Data :: a -> Source a
|
||||
|
||||
class SourceState a where
|
||||
stateOfSource :: a -> IO ByteString
|
||||
|
||||
instance SourceState FilePath where
|
||||
stateOfSource = undefined
|
||||
|
||||
class SourceState a => IsFIO f a b | f -> a b where
|
||||
runFIO :: f -> a -> IO b
|
Loading…
Reference in New Issue