module CabalGild.Class.MonadRead where

import qualified Data.ByteString as ByteString

class (Monad m) => MonadRead m where
  read :: Maybe FilePath -> m ByteString.ByteString

instance MonadRead IO where
  read :: Maybe FilePath -> IO ByteString
read = IO ByteString
-> (FilePath -> IO ByteString) -> Maybe FilePath -> IO ByteString
forall b a. b -> (a -> b) -> Maybe a -> b
maybe IO ByteString
ByteString.getContents FilePath -> IO ByteString
ByteString.readFile