-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Haskell plugin backend for neovim
--   
--   Library for nvim-hs.
@package nvim-hs-contrib
@version 1.0.0.0


module Neovim.BuildTool
data BuildTool
Stack :: BuildTool
Cabal :: CabalType -> BuildTool
Shake :: BuildTool
Make :: BuildTool
Cmake :: BuildTool
Ninja :: BuildTool
Scons :: BuildTool
Custom :: BuildTool
data CabalType
Plain :: CabalType
Sandbox :: CabalType
NewBuild :: CabalType
newtype Directory
Directory :: FilePath -> Directory
[getDirectory] :: Directory -> FilePath

-- | If the monadic boolean predicate returns true, wrap the given object
--   in a <a>Just</a> constructor, otherwise return <a>Nothing</a>.
partialM :: Monad m => (a -> m Bool) -> a -> m (Maybe a)

-- | Create <a>Just</a> a <a>Directory</a> value if the given filepath
--   exists and otherwise return <a>Nothing</a>. This method does not
--   create an actual directory on your file system.
mkDirectory :: MonadIO io => FilePath -> io (Maybe Directory)
newtype File
File :: FilePath -> File
[getFile] :: File -> FilePath

-- | Create <a>Just</a> a <a>File</a> value if the given file exists and is
--   not a directory. Otherwise return <a>Nothing</a>. This function does
--   not alter your filesystem.
mkFile :: MonadIO io => Maybe Directory -> FilePath -> io (Maybe File)

-- | Calculate the list of all parent directories for the given directory.
--   This function also returns the initially specified directory.
thisAndParentDirectories :: Directory -> [Directory]

-- | Given a list of build tool identifier functions, apply these to all
--   the given directories and return the value of the first function that
--   returns a <a>BuildTool</a> value or <a>Nothing</a> if no function ever
--   returns a <a>BuildTool</a>. The identifier functions and directories
--   are tried in the order as supplied to this function.
determineProjectSettings :: MonadIO io => [Directory -> io (Maybe BuildTool)] -> [Directory] -> io (Maybe (BuildTool, Directory))

-- | This list contains some build tool identifier functions for usual
--   setups.
defaultProjectIdentifiers :: MonadIO io => [Directory -> io (Maybe BuildTool)]

-- | Same as <a>determineProjectSettings</a>
--   <tt>defaultProjetIdentifiers</tt>.
guessProjectSettings :: MonadIO io => [Directory] -> io (Maybe (BuildTool, Directory))

-- | Check if directory contains a <tt>stack.yaml</tt> file and return
--   <a>Just</a> <a>Stack</a> in this case.
maybeStack :: MonadIO io => Directory -> io (Maybe BuildTool)

-- | Check if the directory contains a <tt>cabal.sandbox.config</tt> file
--   and return <a>Just</a> (<a>Cabal</a> <a>Sandbox</a>) in that case.
maybeCabalSandbox :: MonadIO io => Directory -> io (Maybe BuildTool)

-- | Check if the directory contains a cabal file and return <a>Just</a>
--   (<a>Cabal</a> <a>Plain</a>) if present.
maybeCabal :: MonadIO io => Directory -> io (Maybe BuildTool)
instance GHC.Classes.Ord Neovim.BuildTool.File
instance GHC.Classes.Eq Neovim.BuildTool.File
instance GHC.Show.Show Neovim.BuildTool.File
instance GHC.Classes.Ord Neovim.BuildTool.Directory
instance GHC.Classes.Eq Neovim.BuildTool.Directory
instance GHC.Show.Show Neovim.BuildTool.Directory
instance GHC.Generics.Generic Neovim.BuildTool.BuildTool
instance GHC.Classes.Ord Neovim.BuildTool.BuildTool
instance GHC.Classes.Eq Neovim.BuildTool.BuildTool
instance GHC.Read.Read Neovim.BuildTool.BuildTool
instance GHC.Show.Show Neovim.BuildTool.BuildTool
instance GHC.Generics.Generic Neovim.BuildTool.CabalType
instance GHC.Enum.Enum Neovim.BuildTool.CabalType
instance GHC.Classes.Ord Neovim.BuildTool.CabalType
instance GHC.Classes.Eq Neovim.BuildTool.CabalType
instance GHC.Read.Read Neovim.BuildTool.CabalType
instance GHC.Show.Show Neovim.BuildTool.CabalType
instance Data.Aeson.Types.ToJSON.ToJSON Neovim.BuildTool.BuildTool
instance Data.Aeson.Types.FromJSON.FromJSON Neovim.BuildTool.BuildTool
instance Data.Aeson.Types.ToJSON.ToJSON Neovim.BuildTool.CabalType
instance Data.Aeson.Types.FromJSON.FromJSON Neovim.BuildTool.CabalType


module Neovim.User.Choice

-- | Call <tt>inputlist()</tt> on the neovim side and ask the user for a
--   choice. This function returns <a>Nothing</a> if the user input was
--   invalid or <a>Just</a> the chosen element. The elements are rendered
--   via <a>Pretty</a>.
oneOf :: [String] -> Neovim env (Maybe String)

-- | Ask user for a choice and <a>Maybe</a> return the index of that choice
--   (1-based).
askForIndex :: [Object] -> Neovim env (Maybe Int)

-- | Same as <a>oneOf</a> only that <tt>a</tt> is constrained by
--   <a>Show</a> insted of <a>Pretty</a>.
oneOfS :: Show a => [a] -> Neovim env (Maybe a)

-- | Open <tt>inputdialog</tt>s inside neovim until the user has
--   successfully typed any prefix of <tt>yes</tt> or <tt>no</tt> or
--   alternatively aborted the dialog. Defaults to <tt>yes</tt> for the
--   empty input.
yesOrNo :: String -> Neovim env Bool


module Neovim.User.Input

-- | Helper function that calls the <tt>input()</tt> function of neovim.
input :: String -> Maybe String -> Maybe String -> Neovim env (Either NeovimException Object)

-- | Prompt the user to specify a directory.
--   
--   If the directory does not exist, ask the usere whether it should be
--   created.
askForDirectory :: String -> Maybe FilePath -> Neovim env FilePath
askForString :: String -> Maybe String -> Neovim env String
