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


-- | A terminal UI as drop-in replacement for hledger add
--   
--   This is a terminal UI as drop-in replacement for hledger add.
--   
--   It improves in the following ways on hledger's add command:
--   
--   <ul>
--   <li>Interactive as-you-type completion for account names and
--   descriptions with optional fuzzy matching.</li>
--   <li>Integrated calculator: Amounts can be written as simple sums with
--   real-time feedback on the result.</li>
--   <li>All actions while entering a transaction can be undone</li>
--   <li>Configurable format for date input. Instead of <tt>y/m/d</tt> it
--   is also possible to use other formats like the german
--   <tt>d.m.y</tt>.</li>
--   </ul>
@package hledger-iadd
@version 1.2.1

module DateParser
data DateFormat
parseDateFormat :: Text -> Either Text DateFormat

-- | Corresponds to %d[.[%m[.[%y]]]]
german :: DateFormat
parseDate :: Day -> DateFormat -> Text -> Either Text Day

-- | Parse text with given format and fill in missing fields with todays
--   date.
parseDateWithToday :: DateFormat -> Text -> IO (Either Text Day)
parseHLDate :: Day -> Text -> Either Text Day
parseHLDateWithToday :: Text -> IO (Either Text Day)
printDate :: DateFormat -> Day -> Text

-- | Computes a relative date by the given weekday
--   
--   Returns the first weekday with index wday, that's before the current
--   date.
weekDay :: Int -> Day -> Day
instance GHC.Show.Show DateParser.Direction
instance GHC.Classes.Eq DateParser.Direction
instance GHC.Show.Show a => GHC.Show.Show (DateParser.IncompleteDate a)
instance GHC.Base.Functor DateParser.IncompleteDate
instance GHC.Base.Monoid a => GHC.Base.Monoid (DateParser.IncompleteDate a)
instance GHC.Show.Show DateParser.DateFormat
instance GHC.Classes.Eq DateParser.DateFormat
instance GHC.Classes.Eq DateParser.DateSpec
instance GHC.Show.Show DateParser.DateSpec


-- | Applicative config parser.
--   
--   This parses config files in the style of optparse-applicative. It
--   supports automatic generation of a default config both as datatype and
--   in printed form.
--   
--   Example:
--   
--   <pre>
--   data Config = Config
--     { test :: Text
--     , foobar :: Int
--     }
--   
--   confParser :: ConfParser Config
--   confParser = Config
--            &lt;$&gt; option "test" "default value" "Help for test"
--            &lt;*&gt; option "foobar" 42 "Help for foobar"
--   </pre>
--   
--   This parses a config file like the following:
--   
--   <pre>
--   # This is a comment
--   test = "something"
--   foobar = 23
--   </pre>
module ConfigParser

-- | The main parser type. Use <a>option</a> and the <a>Applicative</a>
--   instance to create those.
type OptParser a = Ap Option a

-- | Parse a config file from a <a>Text</a>.
parseConfig :: FilePath -> Text -> OptParser a -> Either ConfParseError a

-- | Parse a config file from an actual file in the filesystem.
parseConfigFile :: FilePath -> OptParser a -> IO (Either ConfParseError a)

-- | <a>OptParser</a> that parses one option.
--   
--   Can be combined with the <a>Applicative</a> instance for
--   <a>OptParser</a>. See the module documentation for an example.
option :: OptionArgument a => Text -> a -> Text -> OptParser a
customOption :: Text -> a -> Text -> Text -> Text -> Parser a -> OptParser a

-- | Returns the default value of a given parser.
--   
--   This default value is computed from the default arguments of the
--   <a>option</a> constructor. For the parser from the module description,
--   the default value would be:
--   
--   <pre>
--   Config { test = "default value"
--          , foobar :: 42
--          }
--   </pre>
parserDefault :: OptParser a -> a

-- | Generate the default config file.
--   
--   This returns a valid config file, filled with the default values of
--   every option and using the help string of these options as comments.
parserExample :: OptParser a -> Text

-- | Errors that can occur during parsing. Use the <a>Show</a> instance for
--   printing.
data ConfParseError

-- | An option in the config file. Use <a>option</a> as a smart
--   constructor.
data Option a

-- | Class for supported option types.
--   
--   At the moment, orphan instances are not supported
class OptionArgument a
instance GHC.Show.Show ConfigParser.Assignment
instance GHC.Show.Show ConfigParser.AssignmentValue
instance GHC.Classes.Eq ConfigParser.ConfParseError
instance GHC.Base.Functor ConfigParser.Option
instance GHC.Show.Show ConfigParser.ConfParseError
instance ConfigParser.OptionArgument GHC.Types.Int
instance ConfigParser.OptionArgument GHC.Integer.Type.Integer
instance ConfigParser.OptionArgument GHC.Base.String
instance ConfigParser.OptionArgument Data.Text.Internal.Text

module Brick.Widgets.WrappedText

-- | Widget like <a>txt</a>, but wrap all lines to fit on the screen.
--   
--   Doesn't do word wrap, just breaks the line whenever the maximum width
--   is exceeded.
wrappedText :: Text -> Widget n

module Brick.Widgets.List.Utils

-- | Replace the contents of a list with a new set of elements but preserve
--   the currently selected index.
--   
--   This is a version of listReplace that doesn't try to be smart, but
--   assumes that all the elements in one list are distinct.
--   
--   listReplace itself is broken as of brick-0.2 due to a bogus
--   implementation of the <tt>merge</tt> function.
listSimpleReplace :: Eq e => Vector e -> List n e -> List n e

module Brick.Widgets.HelpMessage
data HelpWidget n
type Title = Text
newtype KeyBindings
KeyBindings :: [(Title, [(Text, Text)])] -> KeyBindings
helpWidget :: n -> KeyBindings -> HelpWidget n
renderHelpWidget :: Name n => HelpWidget n -> Widget n
helpAttr :: AttrName
resetHelpWidget :: HelpWidget n -> EventM n ()
handleHelpEvent :: HelpWidget n -> Event -> EventM n (HelpWidget n)


-- | Widget like <a>Brick.Widgets.Edit</a>, but with more emacs style
--   keybindings.
--   
--   See <a>handleEditorEvent</a> for a list of added keybindings.
module Brick.Widgets.Edit.EmacsBindings

-- | Same as <a>handleEditorEvent</a>, but with more emacs-style
--   keybindings
--   
--   Specifically:
--   
--   <ul>
--   <li>Ctrl-f: Move forward one character</li>
--   <li>Ctrl-b: Move backward one character</li>
--   <li>Alt-f: Move forward one word</li>
--   <li>Alt-b: Move backward one word</li>
--   <li>Alt-Backspace: Delete the previous word</li>
--   <li>Ctrl-w: Delete the previous word</li>
--   <li>Alt-d: Delete the next word</li>
--   </ul>
handleEditorEvent :: (Eq t, GenericTextZipper t) => Event -> Editor t n -> EventM n (Editor t n)

module Brick.Widgets.CommentDialog
data CommentWidget n
commentWidget :: n -> Text -> Text -> CommentWidget n
renderCommentWidget :: (Ord n, Show n) => CommentWidget n -> Widget n
commentDialogComment :: CommentWidget n -> Text
data CommentAction n
CommentContinue :: (CommentWidget n) -> CommentAction n
CommentFinished :: Text -> CommentAction n
handleCommentEvent :: Event -> CommentWidget n -> EventM n (CommentAction n)

module Brick.Widgets.BetterDialog
dialog :: Text -> Text -> Widget n

module AmountParser
parseAmount :: Journal -> Text -> Either String MixedAmount

module Model
data Step
DateQuestion :: Comment -> Step
DescriptionQuestion :: Day -> Comment -> Step
AccountQuestion :: Transaction -> Comment -> Step
AmountQuestion :: AccountName -> Transaction -> Comment -> Step
FinalQuestion :: Transaction -> Step
data MaybeStep
Finished :: Transaction -> MaybeStep
Step :: Step -> MaybeStep
data MatchAlgo
Fuzzy :: MatchAlgo
Substrings :: MatchAlgo
nextStep :: Journal -> DateFormat -> Either Text Text -> Step -> IO (Either Text MaybeStep)

-- | Reverses the last step.
--   
--   Returns (Left errorMessage), if the step can't be reversed
undo :: Step -> Either Text Step
context :: Journal -> MatchAlgo -> DateFormat -> Text -> Step -> IO [Text]

-- | Suggest the initial text of the entry box for each step
--   
--   For example, it suggests today for the date prompt
suggest :: Journal -> DateFormat -> Step -> IO (Maybe Text)
setCurrentComment :: Comment -> Step -> Step
getCurrentComment :: Step -> Comment
setTransactionComment :: Comment -> Step -> Step
getTransactionComment :: Step -> Comment

-- | All accounts occuring in the journal sorted in descending order of
--   appearance.
accountsByFrequency :: Journal -> [AccountName]
instance GHC.Show.Show Model.MatchAlgo
instance GHC.Classes.Eq Model.MatchAlgo
instance GHC.Show.Show Model.MaybeStep
instance GHC.Classes.Eq Model.MaybeStep
instance GHC.Show.Show Model.Step
instance GHC.Classes.Eq Model.Step

module View
viewState :: Step -> Widget n
viewQuestion :: Step -> Widget n
viewContext :: (Ord n, Show n) => List n Text -> Widget n
viewSuggestion :: Maybe Text -> Widget n
viewMessage :: Text -> Widget n
