    {-# LANGUAGE TemplateHaskell #-}
    {-# LANGUAGE NoMonomorphismRestriction #-}
    {-# LANGUAGE QuasiQuotes #-}
    {-# OPTIONS_GHC
      -fno-warn-missing-signatures -fno-warn-unused-imports #-}

    -- | All binaries in PATH.
    module Data.Conduit.Shell.PATH where

    import Control.Monad
    import Control.Monad.IO.Class
    import Data.Conduit.Shell.Process
    import Data.Conduit.Shell.TH
    import Data.Conduit.Shell.Variadic
    import Data.List
    import qualified Data.Text as T (unpack)
    import Prelude
    import System.Directory

    -- | Helpful CD command.
    cd
      :: (MonadIO m, CmdArg arg)
      => arg -> m ()
    cd :: forall (m :: * -> *) arg. (MonadIO m, CmdArg arg) => arg -> m ()
    cd arg
    fp =
      case (arg -> [Text]
    forall a. CmdArg a => a -> [Text]
    toTextArg arg
    fp) of
        [] -> () -> m ()
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()
        (Text
    path:[Text]
    _) -> IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ FilePath -> IO ()
    setCurrentDirectory (Text -> FilePath
    T.unpack Text
    path)

    $(generateBinaries)