@@ -17,6 +17,7 @@ import Data.Set (Set)
1717import qualified Data.Set as Set
1818import Data.Text (Text)
1919import qualified Data.Text as T
20+import qualified Data.Text.IO as T
2021import System.Directory
2122import System.FilePath
2223
@@ -46,10 +47,10 @@ data MigrationError
4647 deriving (Eq, Ord, Show)
4748
4849class Action action where
49− parseEdgeMeta :: String -> action
50+ parseEdgeMeta :: Text -> action
5051
5152instance Action Text where
52− parseEdgeMeta = T.pack
53+ parseEdgeMeta = id
5354
5455-- | Get the directed-acylic graph of migration
5556-- TODO: Consider calling getDag only when reading the graph for efficiency.
@@ -75,7 +76,7 @@ readGraph root name = doesDirectoryExist root >>= \case
7576 let f = root </> (T.unpack $ v1 <> "-" <> v2) </> T.unpack graph
7677 doesFileExist f >>= \case
7778 True -> do
78− c <- readFile f >>= pure . parseEdgeMeta
79+ c <- parseEdgeMeta <$> T.readFile f
7980 return $ Just c
8081 False -> do
8182 return Nothing