module Misc
where
-import qualified Data.ByteString.Lazy as B (ByteString, readFile)
-import System.Directory (getTemporaryDirectory, removeFile)
-import System.IO (hClose, hPutStr, hSetEncoding, openTempFile, utf8)
+import Data.List (isInfixOf)
--- | Run a 'String' through the filesystem to convert it to a
--- 'ByteString' in the stupidest way possible.
-string_to_bytestring :: String -> IO B.ByteString
-string_to_bytestring s = do
- dir <- getTemporaryDirectory
- (path, h) <- openTempFile dir "nu1Uideehe"
- hSetEncoding h utf8
- hPutStr h s
- hClose h
- result <- B.readFile path
- removeFile path
- return result
+-- | Specializes Data.List.isInfixOf.
+contains :: String -> String -> Bool
+contains = isInfixOf