diff --git a/byg/src/Main.hs b/byg/src/Main.hs index 6895dbf..046d887 100644 --- a/byg/src/Main.hs +++ b/byg/src/Main.hs @@ -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 diff --git a/byg/src/Sources.hs b/byg/src/Sources.hs new file mode 100644 index 0000000..3bd7de7 --- /dev/null +++ b/byg/src/Sources.hs @@ -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