Skip to content

Commit 2c837db

Browse files
committed
Move IO like effects into IOWrapper submodule
1 parent 3729592 commit 2c837db

23 files changed

+102
-77
lines changed

cli/graph.cabal

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/DAL/DirectoryFormat.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module DAL.DirectoryFormat where
22

33
import MyPrelude
44
import Models.NID
5-
import Effect.RawGraph
5+
import DAL.RawGraph
66

77
metadataFile :: FilePath -> NID -> FilePath
88
metadataFile base nid = base </> (show nid ++ ".json")

cli/src/DAL/FileSystemOperations/Data.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module DAL.FileSystemOperations.Data where
44

55
import DAL.DirectoryFormat
6-
import Effect.RawGraph
6+
import DAL.RawGraph
77
import Error.Missing
88
import Error.UserError
99
import Models.NID

cli/src/DAL/FileSystemOperations/Metadata.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module DAL.FileSystemOperations.Metadata where
55
import DAL.DTO
66
import DAL.JSON
77
import DAL.DirectoryFormat
8-
import Effect.RawGraph
8+
import DAL.RawGraph
99
import Error.Missing
1010
import Error.UserError
1111
import Models.NID

cli/src/DAL/FileSystemOperations/MetadataWriteDiff.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module DAL.FileSystemOperations.MetadataWriteDiff where
55
import DAL.DTO
66
import DAL.DirectoryFormat
77
import DAL.JSON
8-
import Effect.RawGraph
8+
import DAL.RawGraph
99
import Error.Missing
1010
import Error.UserError
1111
import Models.Edge

cli/src/DAL/Interpreters.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module DAL.Interpreters where
22

33
import qualified Control.Exception as E
4-
import Effect.RawGraph
4+
import DAL.RawGraph
55
import Error.UserError
66
import MyPrelude
77
import Polysemy.Error

cli/src/Effect/RawGraph.hs renamed to cli/src/DAL/RawGraph.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE TemplateHaskell #-}
22

3-
module Effect.RawGraph where
3+
module DAL.RawGraph where
44

55
import MyPrelude
66
import Polysemy.Input

cli/src/Effect/Console.hs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{-# LANGUAGE LambdaCase #-}
2+
{-# LANGUAGE TemplateHaskell #-}
3+
4+
module Effect.IOWrapper.DisplayImage where
5+
6+
import MyPrelude
7+
import System.IO.Term.Image
8+
9+
data DisplayImage m a where
10+
-- | print a LBS as an image
11+
DisplayImage :: LByteString -> DisplayImage m ()
12+
13+
makeSem ''DisplayImage
14+
15+
interpretDisplayImageIO ::
16+
(Member (Embed IO) effs) =>
17+
Sem (DisplayImage : effs) a ->
18+
Sem effs a
19+
interpretDisplayImageIO = interpret $ \case
20+
DisplayImage i -> liftIO $ printImage i

cli/src/Effect/Editor.hs renamed to cli/src/Effect/IOWrapper/Editor.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE TemplateHaskell #-}
22

3-
module Effect.Editor where
3+
module Effect.IOWrapper.Editor where
44

55
import DAL.Serialization
66
import Models.NID (NID)

0 commit comments

Comments
 (0)