module Hedgehog.Extras.Stock.IO.File
  ( fileContains
  ) where

import           Data.Bool
import           Data.Functor
import           Data.String (String)
import           System.IO (FilePath, IO)

import qualified Data.List as L
import qualified System.IO as IO

-- | Determine if the given string is found in the given file.
fileContains :: String -> FilePath -> IO Bool
fileContains :: String -> String -> IO Bool
fileContains String
text String
path = (String
text String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`L.isInfixOf`) (String -> Bool) -> IO String -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> IO String
IO.readFile String
path