hledger-1.30.1: Command-line interface for the hledger accounting system

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hledger.Cli.Script

Description

A convenient module to import in hledger scripts, aiming to provide the most useful imports and reduce boilerplate. |

Synopsis

- data Char
- data Ordering
  - = LT
  - | EQ
  - | GT
- data Maybe a
  - = Nothing
  - | Just a
- type Change = MixedAmount
- class Eq a => Ord a where
  - compare :: a -> a -> Ordering
  - (<) :: a -> a -> Bool
  - (<=) :: a -> a -> Bool
  - (>) :: a -> a -> Bool
  - (>=) :: a -> a -> Bool
  - max :: a -> a -> a
  - min :: a -> a -> a
- data Text
- data UTCTime = UTCTime {
  - utctDay :: Day
  - utctDayTime :: DiffTime
  }
- data Either a b
  - = Left a
  - | Right b
- type Year = Integer
- data IO a
- class Functor f => Applicative (f :: Type -> Type) where
  - pure :: a -> f a
  - (<*>) :: f (a -> b) -> f a -> f b
  - liftA2 :: (a -> b -> c) -> f a -> f b -> f c
  - (*>) :: f a -> f b -> f b
  - (<*) :: f a -> f b -> f a
- class Functor (f :: Type -> Type) where
  - fmap :: (a -> b) -> f a -> f b
  - (<$) :: a -> f b -> f a
- class Applicative m => Monad (m :: Type -> Type) where
  - (>>=) :: m a -> (a -> m b) -> m b
  - (>>) :: m a -> m b -> m b
  - return :: a -> m a
- class Monad m => MonadFail (m :: Type -> Type) where
  - fail :: String -> m a
- data Handle
- class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
  - mzero :: m a
  - mplus :: m a -> m a -> m a
- data MVar a
- data TextEncoding
- type IOError = IOException
- data Chan a
- type HasCallStack = ?callStack :: CallStack
- class Applicative f => Alternative (f :: Type -> Type) where
  - empty :: f a
  - (<|>) :: f a -> f a -> f a
  - some :: f a -> f [a]
  - many :: f a -> f [a]
- data GeneralCategory
  - = UppercaseLetter
  - | LowercaseLetter
  - | TitlecaseLetter
  - | ModifierLetter
  - | OtherLetter
  - | NonSpacingMark
  - | SpacingCombiningMark
  - | EnclosingMark
  - | DecimalNumber
  - | LetterNumber
  - | OtherNumber
  - | ConnectorPunctuation
  - | DashPunctuation
  - | OpenPunctuation
  - | ClosePunctuation
  - | InitialQuote
  - | FinalQuote
  - | OtherPunctuation
  - | MathSymbol
  - | CurrencySymbol
  - | ModifierSymbol
  - | OtherSymbol
  - | Space
  - | LineSeparator
  - | ParagraphSeparator
  - | Control
  - | Format
  - | Surrogate
  - | PrivateUse
  - | NotAssigned
- data ThreadId
- newtype Down a = Down {
  - getDown :: a
  }
- type FilePath = String
- data SeekMode
  - = AbsoluteSeek
  - | RelativeSeek
  - | SeekFromEnd
- data NewlineMode = NewlineMode {
  - inputNL :: Newline
  - outputNL :: Newline
  }
- data Newline
  - = LF
  - | CRLF
- data BufferMode
  - = NoBuffering
  - | LineBuffering
  - | BlockBuffering (Maybe Int)
- data IOErrorType
- data ExitCode
  - = ExitSuccess
  - | ExitFailure Int
- data IOMode
  - = ReadMode
  - | WriteMode
  - | AppendMode
  - | ReadWriteMode
- data HandlePosn
- newtype Const a (b :: k) = Const {
  - getConst :: a
  }
- newtype ZipList a = ZipList {
  - getZipList :: [a]
  }
- newtype WrappedArrow (a :: Type -> Type -> Type) b c = WrapArrow {
  - unwrapArrow :: a b c
  }
- newtype WrappedMonad (m :: Type -> Type) a = WrapMonad {
  - unwrapMonad :: m a
  }
- type ModifierParser = String -> FormatParse
- type FieldFormatter = FieldFormat -> ShowS
- data FormatParse = FormatParse {
  - fpModifiers :: String
  - fpChar :: Char
  - fpRest :: String
  }
- data FieldFormat = FieldFormat {
  - fmtWidth :: Maybe Int
  - fmtPrecision :: Maybe Int
  - fmtAdjust :: Maybe FormatAdjustment
  - fmtSign :: Maybe FormatSign
  - fmtAlternate :: Bool
  - fmtModifiers :: String
  - fmtChar :: Char
  }
- data FormatSign
  - = SignPlus
  - | SignSpace
- data FormatAdjustment
  - = LeftAdjust
  - | ZeroPad
- class IsChar c where
  - toChar :: c -> Char
  - fromChar :: Char -> c
- class PrintfArg a where
  - formatArg :: a -> FieldFormatter
  - parseFormat :: a -> ModifierParser
- class HPrintfType t
- class PrintfType t
- data QSemN
- data QSem
- data Timeout
  - = Timeout Integer String
  - | NoTimeout
- data Arg a = Arg {
  - argValue :: Update a
  - argType :: FlagHelp
  - argRequire :: Bool
  }
- class Remap (m :: Type -> Type) where
  - remap :: (a -> b) -> (b -> (a, a -> b)) -> m a -> m b
- data Flag a = Flag {
  - flagNames :: [Name]
  - flagInfo :: FlagInfo
  - flagValue :: Update a
  - flagType :: FlagHelp
  - flagHelp :: Help
  }
- type Update a = String -> a -> Either String a
- data FlagInfo
  - = FlagReq
  - | FlagOpt String
  - | FlagOptRare String
  - | FlagNone
- data Mode a = Mode {
  - modeGroupModes :: Group (Mode a)
  - modeNames :: [Name]
  - modeValue :: a
  - modeCheck :: a -> Either String a
  - modeReform :: a -> Maybe [String]
  - modeExpandAt :: Bool
  - modeHelp :: Help
  - modeHelpSuffix :: [String]
  - modeArgs :: ([Arg a], Maybe (Arg a))
  - modeGroupFlags :: Group (Flag a)
  }
- data Group a = Group {
  - groupUnnamed :: [a]
  - groupHidden :: [a]
  - groupNamed :: [(Help, [a])]
  }
- type FlagHelp = String
- type Help = String
- data Complete
  - = CompleteValue String
  - | CompleteFile String FilePath
  - | CompleteDir String FilePath
- data HelpFormat
  - = HelpFormatDefault
  - | HelpFormatOne
  - | HelpFormatAll
  - | HelpFormatBash
  - | HelpFormatZsh
- data Reader (m :: Type -> Type) = Reader {
  - rFormat :: StorageFormat
  - rExtensions :: [String]
  - rReadFn :: InputOpts -> FilePath -> Text -> ExceptT String IO Journal
  - rParser :: MonadIO m => ErroringJournalParser m ParsedJournal
  }
- data XdgDirectoryList
  - = XdgDataDirs
  - | XdgConfigDirs
- data XdgDirectory
  - = XdgData
  - | XdgConfig
  - | XdgCache
  - | XdgState
- data Permissions
- data ProcessHandle
- data StdStream
  - = Inherit
  - | UseHandle Handle
  - | CreatePipe
  - | NoStream
- data CmdSpec
  - = ShellCommand String
  - | RawCommand FilePath [String]
- data CreateProcess = CreateProcess {
  - cmdspec :: CmdSpec
  - cwd :: Maybe FilePath
  - env :: Maybe [(String, String)]
  - std_in :: StdStream
  - std_out :: StdStream
  - std_err :: StdStream
  - close_fds :: Bool
  - create_group :: Bool
  - delegate_ctlc :: Bool
  - detach_console :: Bool
  - create_new_console :: Bool
  - new_session :: Bool
  - child_group :: Maybe GroupID
  - child_user :: Maybe UserID
  - use_process_jobs :: Bool
  }
- type Pid = CPid
- data Layout
  - = LayoutWide (Maybe Int)
  - | LayoutTall
  - | LayoutBare
  - | LayoutTidy
- data SourcePos = SourcePos {
  - sourceName :: FilePath
  - sourceLine :: !Pos
  - sourceColumn :: !Pos
  }
- data TestTree
- data DependencyType
  - = AllSucceed
  - | AllFinish
- type TestName = String
- type RegexError = String
- type Replacement = String
- data Regexp
- data Ledger = Ledger {
  - ljournal :: Journal
  - laccounts :: [Account]
  }
- data NormalSign
  - = NormallyPositive
  - | NormallyNegative
- data Account = Account {
  - aname :: AccountName
  - adeclarationinfo :: Maybe AccountDeclarationInfo
  - asubs :: [Account]
  - aparent :: Maybe Account
  - aboring :: Bool
  - anumpostings :: Int
  - aebalance :: MixedAmount
  - aibalance :: MixedAmount
  }
- data AccountDeclarationInfo = AccountDeclarationInfo {
  - adicomment :: Text
  - aditags :: [Tag]
  - adideclarationorder :: Int
  - adisourcepos :: SourcePos
  }
- newtype TagDeclarationInfo = TagDeclarationInfo {
  - tdicomment :: Text
  }
- data PayeeDeclarationInfo = PayeeDeclarationInfo {
  - pdicomment :: Text
  - pditags :: [Tag]
  }
- type StorageFormat = String
- type ParsedJournal = Journal
- data Journal = Journal {
  - jparsedefaultyear :: Maybe Year
  - jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)
  - jparsedecimalmark :: Maybe DecimalMark
  - jparseparentaccounts :: [AccountName]
  - jparsealiases :: [AccountAlias]
  - jparsetimeclockentries :: [TimeclockEntry]
  - jincludefilestack :: [FilePath]
  - jdeclaredpayees :: [(Payee, PayeeDeclarationInfo)]
  - jdeclaredtags :: [(TagName, TagDeclarationInfo)]
  - jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]
  - jdeclaredaccounttags :: Map AccountName [Tag]
  - jdeclaredaccounttypes :: Map AccountType [AccountName]
  - jaccounttypes :: Map AccountName AccountType
  - jglobalcommoditystyles :: Map CommoditySymbol AmountStyle
  - jcommodities :: Map CommoditySymbol Commodity
  - jinferredcommodities :: Map CommoditySymbol AmountStyle
  - jpricedirectives :: [PriceDirective]
  - jinferredmarketprices :: [MarketPrice]
  - jtxnmodifiers :: [TransactionModifier]
  - jperiodictxns :: [PeriodicTransaction]
  - jtxns :: [Transaction]
  - jfinalcommentlines :: Text
  - jfiles :: [(FilePath, Text)]
  - jlastreadtime :: POSIXTime
  }
- data MarketPrice = MarketPrice {
  - mpdate :: Day
  - mpfrom :: CommoditySymbol
  - mpto :: CommoditySymbol
  - mprate :: Quantity
  }
- data PriceDirective = PriceDirective {
  - pddate :: Day
  - pdcommodity :: CommoditySymbol
  - pdamount :: Amount
  }
- data TimeclockEntry = TimeclockEntry {
  - tlsourcepos :: SourcePos
  - tlcode :: TimeclockCode
  - tldatetime :: LocalTime
  - tlaccount :: AccountName
  - tldescription :: Text
  - tlcomment :: Text
  - tltags :: [Tag]
  }
- data TimeclockCode
  - = SetBalance
  - | SetRequiredHours
  - | In
  - | Out
  - | FinalOut
- data PeriodicTransaction = PeriodicTransaction {
  - ptperiodexpr :: Text
  - ptinterval :: Interval
  - ptspan :: DateSpan
  - ptsourcepos :: (SourcePos, SourcePos)
  - ptstatus :: Status
  - ptcode :: Text
  - ptdescription :: Text
  - ptcomment :: Text
  - pttags :: [Tag]
  - ptpostings :: [Posting]
  }
- data TMPostingRule = TMPostingRule {
  - tmprPosting :: Posting
  - tmprIsMultiplier :: Bool
  }
- data TransactionModifier = TransactionModifier {
  - tmquerytxt :: Text
  - tmpostingrules :: [TMPostingRule]
  }
- data Transaction = Transaction {
  - tindex :: Integer
  - tprecedingcomment :: Text
  - tsourcepos :: (SourcePos, SourcePos)
  - tdate :: Day
  - tdate2 :: Maybe Day
  - tstatus :: Status
  - tcode :: Text
  - tdescription :: Text
  - tcomment :: Text
  - ttags :: [Tag]
  - tpostings :: [Posting]
  }
- data Posting = Posting {
  - pdate :: Maybe Day
  - pdate2 :: Maybe Day
  - pstatus :: Status
  - paccount :: AccountName
  - pamount :: MixedAmount
  - pcomment :: Text
  - ptype :: PostingType
  - ptags :: [Tag]
  - pbalanceassertion :: Maybe BalanceAssertion
  - ptransaction :: Maybe Transaction
  - poriginal :: Maybe Posting
  }
- data BalanceAssertion = BalanceAssertion {
  - baamount :: Amount
  - batotal :: Bool
  - bainclusive :: Bool
  - baposition :: SourcePos
  }
- data Status
  - = Unmarked
  - | Pending
  - | Cleared
- type DateTag = (TagName, Day)
- type Tag = (TagName, TagValue)
- type TagValue = Text
- type TagName = Text
- data PostingType
  - = RegularPosting
  - | VirtualPosting
  - | BalancedVirtualPosting
- data MixedAmount
- data Amount = Amount {
  - acommodity :: !CommoditySymbol
  - aquantity :: !Quantity
  - astyle :: !AmountStyle
  - aprice :: !(Maybe AmountPrice)
  }
- data Commodity = Commodity {
  - csymbol :: CommoditySymbol
  - cformat :: Maybe AmountStyle
  }
- type CommoditySymbol = Text
- data DigitGroupStyle = DigitGroups !Char ![Word8]
- data AmountPrecision
  - = Precision !Word8
  - | NaturalPrecision
- data AmountStyle = AmountStyle {
  - ascommodityside :: !Side
  - ascommodityspaced :: !Bool
  - asprecision :: !AmountPrecision
  - asdecimalpoint :: !(Maybe Char)
  - asdigitgroups :: !(Maybe DigitGroupStyle)
  }
- data AmountPrice
  - = UnitPrice !Amount
  - | TotalPrice !Amount
- type Quantity = Decimal
- type DecimalMark = Char
- data Side
  - = L
  - | R
- data AccountAlias
  - = BasicAlias AccountName AccountName
  - | RegexAlias Regexp Replacement
- data AccountType
  - = Asset
  - | Liability
  - | Equity
  - | Revenue
  - | Expense
  - | Cash
  - | Conversion
- type AccountName = Text
- type Payee = Text
- data Interval
  - = NoInterval
  - | Days Int
  - | Weeks Int
  - | Months Int
  - | Quarters Int
  - | Years Int
  - | DayOfMonth Int
  - | WeekdayOfMonth Int Int
  - | DaysOfWeek [Int]
  - | DayOfYear Int Int
- type DayOfMonth = Int
- data Period
  - = DayPeriod Day
  - | WeekPeriod Day
  - | MonthPeriod Year Month
  - | QuarterPeriod Year Quarter
  - | YearPeriod Year
  - | PeriodBetween Day Day
  - | PeriodFrom Day
  - | PeriodTo Day
  - | PeriodAll
- class Ord p => DayPeriod p where
  - periodFirstDay :: p -> Day
  - periodLastDay :: p -> Day
  - dayPeriod :: Day -> p
- data DateSpan = DateSpan (Maybe EFDay) (Maybe EFDay)
- data EFDay
  - = Exact Day
  - | Flex Day
- data WhichDate
  - = PrimaryDate
  - | SecondaryDate
- data SmartInterval
  - = Day
  - | Week
  - | Month
  - | Quarter
  - | Year
- newtype Day = ModifiedJulianDay {
  - toModifiedJulianDay :: Integer
  }
- type Month = Int
- type Quarter = Int
- data SmartDate
  - = SmartCompleteDate Day
  - | SmartAssumeStart Year (Maybe Month)
  - | SmartFromReference (Maybe Month) MonthDay
  - | SmartMonth Month
  - | SmartRelative Integer SmartInterval
- type WeekDay = Int
- type MonthDay = Int
- type YearDay = Int
- type MonthWeek = Int
- type YearWeek = Int
- type HledgerParseErrors = ParseErrorBundle Text HledgerParseErrorData
- data HledgerParseErrorData
- data WideBuilder = WideBuilder {
  - wbBuilder :: !Builder
  - wbWidth :: !Int
  }
- type TextParser (m :: Type -> Type) a = ParsecT HledgerParseErrorData Text m a
- type SimpleTextParser = Parsec HledgerParseErrorData Text
- type SimpleStringParser a = Parsec HledgerParseErrorData String a
- data RawOpts
- data ReportItemField
  - = AccountField
  - | DefaultDateField
  - | DescriptionField
  - | TotalField
  - | DepthSpacerField
  - | FieldNo Int
- data StringFormatComponent
  - = FormatLiteral Text
  - | FormatField Bool (Maybe Int) (Maybe Int) ReportItemField
- data StringFormat
  - = OneLine [StringFormatComponent]
  - | TopAligned [StringFormatComponent]
  - | BottomAligned [StringFormatComponent]
- data AmountDisplayOpts = AmountDisplayOpts {
  - displayPrice :: Bool
  - displayZeroCommodity :: Bool
  - displayThousandsSep :: Bool
  - displayColour :: Bool
  - displayOneLine :: Bool
  - displayMinWidth :: Maybe Int
  - displayMaxWidth :: Maybe Int
  - displayOrder :: Maybe [CommoditySymbol]
  }
- type PriceOracle = (Day, CommoditySymbol, Maybe CommoditySymbol) -> Maybe (CommoditySymbol, Quantity)
- data ValuationType
  - = AtThen (Maybe CommoditySymbol)
  - | AtEnd (Maybe CommoditySymbol)
  - | AtNow (Maybe CommoditySymbol)
  - | AtDate Day (Maybe CommoditySymbol)
- data ConversionOp
  - = NoConversionOp
  - | ToCost
- data QueryOpt
  - = QueryOptInAcctOnly AccountName
  - | QueryOptInAcct AccountName
- data OrdPlus
  - = Lt
  - | LtEq
  - | Gt
  - | GtEq
  - | Eq
  - | AbsLt
  - | AbsLtEq
  - | AbsGt
  - | AbsGtEq
  - | AbsEq
- data Query
  - = Not Query
  - | And [Query]
  - | Or [Query]
  - | Any
  - | None
  - | Date DateSpan
  - | Date2 DateSpan
  - | StatusQ Status
  - | Code Regexp
  - | Desc Regexp
  - | Tag Regexp (Maybe Regexp)
  - | Acct Regexp
  - | Type [AccountType]
  - | Depth Int
  - | Real Bool
  - | Amt OrdPlus Quantity
  - | Sym Regexp
- type ErroringJournalParser (m :: Type -> Type) a = StateT Journal (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError m)) a
- type JournalParser (m :: Type -> Type) a = StateT Journal (ParsecT HledgerParseErrorData Text m) a
- data BalancingOpts = BalancingOpts {
  - ignore_assertions_ :: Bool
  - infer_balancing_costs_ :: Bool
  - commodity_styles_ :: Maybe (Map CommoditySymbol AmountStyle)
  }
- class HasBalancingOpts c where
  - balancingOpts :: Lens' c BalancingOpts
  - commodity_styles :: Lens' c (Maybe (Map CommoditySymbol AmountStyle))
  - ignore_assertions :: Lens' c Bool
  - infer_balancing_costs :: Lens' c Bool
- data InputOpts = InputOpts {
  - mformat_ :: Maybe StorageFormat
  - mrules_file_ :: Maybe FilePath
  - aliases_ :: [String]
  - anon_ :: Bool
  - new_ :: Bool
  - new_save_ :: Bool
  - pivot_ :: String
  - forecast_ :: Maybe DateSpan
  - verbose_tags_ :: Bool
  - reportspan_ :: DateSpan
  - auto_ :: Bool
  - infer_equity_ :: Bool
  - infer_costs_ :: Bool
  - balancingopts_ :: BalancingOpts
  - strict_ :: Bool
  - _ioDay :: Day
  }
- class HasInputOpts c where
  - inputOpts :: Lens' c InputOpts
  - aliases :: Lens' c [String]
  - anon__ :: Lens' c Bool
  - auto__ :: Lens' c Bool
  - balancingopts :: Lens' c BalancingOpts
  - forecast :: Lens' c (Maybe DateSpan)
  - infer_costs :: Lens' c Bool
  - infer_equity :: Lens' c Bool
  - ioDay :: Lens' c Day
  - mformat :: Lens' c (Maybe StorageFormat)
  - mrules_file :: Lens' c (Maybe FilePath)
  - new__ :: Lens' c Bool
  - new_save :: Lens' c Bool
  - pivot :: Lens' c String
  - reportspan :: Lens' c DateSpan
  - strict :: Lens' c Bool
  - verbose_tags :: Lens' c Bool
- data ReportSpec = ReportSpec {
  - _rsReportOpts :: ReportOpts
  - _rsDay :: Day
  - _rsQuery :: Query
  - _rsQueryOpts :: [QueryOpt]
  }
- data ReportOpts = ReportOpts {
  - period_ :: Period
  - interval_ :: Interval
  - statuses_ :: [Status]
  - conversionop_ :: Maybe ConversionOp
  - value_ :: Maybe ValuationType
  - infer_prices_ :: Bool
  - depth_ :: Maybe Int
  - date2_ :: Bool
  - empty_ :: Bool
  - no_elide_ :: Bool
  - real_ :: Bool
  - format_ :: StringFormat
  - pretty_ :: Bool
  - querystring_ :: [Text]
  - average_ :: Bool
  - related_ :: Bool
  - txn_dates_ :: Bool
  - balancecalc_ :: BalanceCalculation
  - balanceaccum_ :: BalanceAccumulation
  - budgetpat_ :: Maybe Text
  - accountlistmode_ :: AccountListMode
  - drop_ :: Int
  - declared_ :: Bool
  - row_total_ :: Bool
  - no_total_ :: Bool
  - show_costs_ :: Bool
  - sort_amount_ :: Bool
  - percent_ :: Bool
  - invert_ :: Bool
  - normalbalance_ :: Maybe NormalSign
  - color_ :: Bool
  - transpose_ :: Bool
  - layout_ :: Layout
  }
- data AccountListMode
  - = ALFlat
  - | ALTree
- data BalanceAccumulation
  - = PerPeriod
  - | Cumulative
  - | Historical
- data BalanceCalculation
  - = CalcChange
  - | CalcBudget
  - | CalcValueChange
  - | CalcGain
  - | CalcPostingsCount
- class HasReportOptsNoUpdate c where
  - reportOptsNoUpdate :: Lens' c ReportOpts
  - accountlistmode :: Lens' c AccountListMode
  - average :: Lens' c Bool
  - balanceaccum :: Lens' c BalanceAccumulation
  - balancecalc :: Lens' c BalanceCalculation
  - budgetpat :: Lens' c (Maybe Text)
  - color__ :: Lens' c Bool
  - conversionop :: Lens' c (Maybe ConversionOp)
  - date2NoUpdate :: Lens' c Bool
  - declared :: Lens' c Bool
  - depthNoUpdate :: Lens' c (Maybe Int)
  - drop__ :: Lens' c Int
  - empty__ :: Lens' c Bool
  - format :: Lens' c StringFormat
  - infer_prices :: Lens' c Bool
  - interval :: Lens' c Interval
  - invert :: Lens' c Bool
  - layout :: Lens' c Layout
  - no_elide :: Lens' c Bool
  - no_total :: Lens' c Bool
  - normalbalance :: Lens' c (Maybe NormalSign)
  - percent :: Lens' c Bool
  - periodNoUpdate :: Lens' c Period
  - pretty :: Lens' c Bool
  - querystringNoUpdate :: Lens' c [Text]
  - realNoUpdate :: Lens' c Bool
  - related :: Lens' c Bool
  - row_total :: Lens' c Bool
  - show_costs :: Lens' c Bool
  - sort_amount :: Lens' c Bool
  - statusesNoUpdate :: Lens' c [Status]
  - transpose__ :: Lens' c Bool
  - txn_dates :: Lens' c Bool
  - value :: Lens' c (Maybe ValuationType)
- class HasReportOptsNoUpdate a => HasReportOpts a where
  - reportOpts :: ReportableLens' a ReportOpts
  - period :: ReportableLens' a Period
  - statuses :: ReportableLens' a [Status]
  - depth :: ReportableLens' a (Maybe Int)
  - date2 :: ReportableLens' a Bool
  - real :: ReportableLens' a Bool
  - querystring :: ReportableLens' a [Text]
- class HasReportSpec c where
  - reportSpec :: Lens' c ReportSpec
  - rsDay :: Lens' c Day
  - rsQuery :: Lens' c Query
  - rsQueryOpts :: Lens' c [QueryOpt]
  - rsReportOpts :: Lens' c ReportOpts
- data DisplayName = DisplayName {
  - displayFull :: AccountName
  - displayName :: AccountName
  - displayDepth :: Int
  }
- data CBCSubreportSpec a = CBCSubreportSpec {
  - cbcsubreporttitle :: Text
  - cbcsubreportquery :: Query
  - cbcsubreportoptions :: ReportOpts -> ReportOpts
  - cbcsubreporttransform :: PeriodicReport DisplayName MixedAmount -> PeriodicReport a MixedAmount
  - cbcsubreportincreasestotal :: Bool
  }
- data CompoundPeriodicReport a b = CompoundPeriodicReport {
  - cbrTitle :: Text
  - cbrDates :: [DateSpan]
  - cbrSubreports :: [(Text, PeriodicReport a b, Bool)]
  - cbrTotals :: PeriodicReportRow () b
  }
- data PeriodicReportRow a b = PeriodicReportRow {
  - prrName :: a
  - prrAmounts :: [b]
  - prrTotal :: b
  - prrAverage :: b
  }
- data PeriodicReport a b = PeriodicReport {
  - prDates :: [DateSpan]
  - prRows :: [PeriodicReportRow a b]
  - prTotals :: PeriodicReportRow () b
  }
- type Average = MixedAmount
- type Total = MixedAmount
- type Balance = MixedAmount
- type Percentage = Decimal
- type PostingsReportItem = (Maybe Day, Maybe Period, Maybe Text, Posting, MixedAmount)
- type PostingsReport = [PostingsReportItem]
- type MultiBalanceReportRow = PeriodicReportRow DisplayName MixedAmount
- type MultiBalanceReport = PeriodicReport DisplayName MixedAmount
- type EntriesReportItem = Transaction
- type EntriesReport = [EntriesReportItem]
- type BudgetReport = PeriodicReport DisplayName BudgetCell
- type BudgetReportRow = PeriodicReportRow DisplayName BudgetCell
- type BudgetCell = (Maybe Change, Maybe BudgetGoal)
- type BudgetAverage = Average
- type BudgetTotal = Total
- type BudgetGoal = Change
- type BalanceReportItem = (AccountName, AccountName, Int, MixedAmount)
- type BalanceReport = ([BalanceReportItem], MixedAmount)
- type AccountTransactionsReportItem = (Transaction, Transaction, Bool, Text, MixedAmount, MixedAmount)
- type AccountTransactionsReport = [AccountTransactionsReportItem]
- type PrefixedFilePath = FilePath
- type Assertion = IO ()
- type AssertionPredicate = IO Bool
- class Assertable t where
  - assert :: t -> Assertion
- data HUnitFailure = HUnitFailure (Maybe SrcLoc) String
- class AssertionPredicable t where
  - assertionPredicate :: t -> IO Bool
- data CalendarDiffDays = CalendarDiffDays {
  - cdMonths :: Integer
  - cdDays :: Integer
  }
- type MonthOfYear = Int
- data DayOfWeek
  - = Monday
  - | Tuesday
  - | Wednesday
  - | Thursday
  - | Friday
  - | Saturday
  - | Sunday
- data DiffTime
- data NominalDiffTime
- newtype UniversalTime = ModJulianDate {
  - getModJulianDate :: Rational
  }
- data CalendarDiffTime = CalendarDiffTime {
  - ctMonths :: Integer
  - ctTime :: NominalDiffTime
  }
- data TimeZone = TimeZone {
  - timeZoneMinutes :: Int
  - timeZoneSummerOnly :: Bool
  - timeZoneName :: String
  }
- data TimeOfDay = TimeOfDay {
  - todHour :: Int
  - todMin :: Int
  - todSec :: Pico
  }
- data LocalTime = LocalTime {
  - localDay :: Day
  - localTimeOfDay :: TimeOfDay
  }
- data TimeLocale = TimeLocale {
  - wDays :: [(String, String)]
  - months :: [(String, String)]
  - amPm :: (String, String)
  - dateTimeFmt :: String
  - dateFmt :: String
  - timeFmt :: String
  - time12Fmt :: String
  - knownTimeZones :: [TimeZone]
  }
- class ParseTime t
- class FormatTime t
- data ZonedTime = ZonedTime {
  - zonedTimeToLocalTime :: LocalTime
  - zonedTimeZone :: TimeZone
  }
- data CliOpts = CliOpts {
  - rawopts_ :: RawOpts
  - command_ :: String
  - file_ :: [FilePath]
  - inputopts_ :: InputOpts
  - reportspec_ :: ReportSpec
  - output_file_ :: Maybe FilePath
  - output_format_ :: Maybe String
  - debug_ :: Int
  - no_new_accounts_ :: Bool
  - width_ :: Maybe String
  - available_width_ :: Int
  - progstarttime_ :: POSIXTime
  }
- class HasCliOpts c where
  - cliOpts :: Lens' c CliOpts
  - available_width :: Lens' c Int
  - command :: Lens' c String
  - debug__ :: Lens' c Int
  - file__ :: Lens' c [FilePath]
  - inputopts :: Lens' c InputOpts
  - no_new_accounts :: Lens' c Bool
  - output_file :: Lens' c (Maybe FilePath)
  - output_format :: Lens' c (Maybe String)
  - progstarttime :: Lens' c POSIXTime
  - rawopts__ :: Lens' c RawOpts
  - reportspec :: Lens' c ReportSpec
  - width__ :: Lens' c (Maybe String)
- type CommandDoc = String
- type Topic = String
- type ProgramName = String
- type PackageVersion = String
- type VersionString = String
- pattern MixedAmountKeyUnitPrice :: !CommoditySymbol -> !CommoditySymbol -> !Quantity -> MixedAmountKey
- pattern MixedAmountKeyNoPrice :: !CommoditySymbol -> MixedAmountKey
- pattern MixedAmountKeyTotalPrice :: !CommoditySymbol -> !CommoditySymbol -> MixedAmountKey
- pattern December :: MonthOfYear
- pattern November :: MonthOfYear
- pattern October :: MonthOfYear
- pattern September :: MonthOfYear
- pattern August :: MonthOfYear
- pattern July :: MonthOfYear
- pattern June :: MonthOfYear
- pattern May :: MonthOfYear
- pattern April :: MonthOfYear
- pattern March :: MonthOfYear
- pattern February :: MonthOfYear
- pattern January :: MonthOfYear
- pattern BeforeCommonEra :: Integer -> Year
- pattern CommonEra :: Integer -> Year
- pattern YearMonthDay :: Year -> MonthOfYear -> DayOfMonth -> Day
- elem :: (Foldable t, Eq a) => a -> t a -> Bool
- minimum :: (Foldable t, Ord a) => t a -> a
- maximum :: (Foldable t, Ord a) => t a -> a
- foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
- product :: (Foldable t, Num a) => t a -> a
- sum :: (Foldable t, Num a) => t a -> a
- foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
- length :: Foldable t => t a -> Int
- foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
- foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
- foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- null :: Foldable t => t a -> Bool
- pager :: String -> IO ()
- process :: Mode a -> [String] -> Either String a
- toUpper :: Char -> Char
- singleton :: a -> [a]
- delete :: Eq a => a -> [a] -> [a]
- lookup :: Eq a => a -> [(a, b)] -> Maybe b
- insert :: Ord a => a -> [a] -> [a]
- map :: (a -> b) -> [a] -> [b]
- union :: Eq a => [a] -> [a] -> [a]
- filter :: (a -> Bool) -> [a] -> [a]
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- toLower :: Char -> Char
- (++) :: [a] -> [a] -> [a]
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- join :: Monad m => m (m a) -> m a
- stdout :: Handle
- stdin :: Handle
- hIsTerminalDevice :: Handle -> IO Bool
- hIsWritable :: Handle -> IO Bool
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- hGetContents :: Handle -> IO String
- sortBy :: (a -> a -> Ordering) -> [a] -> [a]
- genericLength :: Num i => [a] -> i
- maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- genericReplicate :: Integral i => i -> a -> [a]
- genericTake :: Integral i => i -> [a] -> [a]
- genericDrop :: Integral i => i -> [a] -> [a]
- genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
- genericIndex :: Integral i => [a] -> i -> a
- isLetter :: Char -> Bool
- openFile :: FilePath -> IOMode -> IO Handle
- isAlpha :: Char -> Bool
- ord :: Char -> Int
- chr :: Int -> Char
- mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- throwTo :: Exception e => ThreadId -> e -> IO ()
- forkIOWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- forkIO :: IO () -> IO ThreadId
- stderr :: Handle
- forever :: Applicative f => f a -> f b
- utf8 :: TextEncoding
- mkTextEncoding :: String -> IO TextEncoding
- hSeek :: Handle -> SeekMode -> Integer -> IO ()
- getDirectoryContents :: FilePath -> IO [FilePath]
- hFlush :: Handle -> IO ()
- hLookAhead :: Handle -> IO Char
- fixIO :: (a -> IO a) -> IO a
- killThread :: ThreadId -> IO ()
- threadDelay :: Int -> IO ()
- forkOS :: IO () -> IO ThreadId
- readFile' :: FilePath -> IO String
- writeFile :: FilePath -> String -> IO ()
- getLine :: IO String
- putStrLn :: String -> IO ()
- isDoesNotExistError :: IOError -> Bool
- getArgs :: IO [String]
- hClose :: Handle -> IO ()
- isAlreadyInUseError :: IOError -> Bool
- isPermissionError :: IOError -> Bool
- hSetBinaryMode :: Handle -> Bool -> IO ()
- isFullError :: IOError -> Bool
- isEOFError :: IOError -> Bool
- localeEncoding :: TextEncoding
- isIllegalOperation :: IOError -> Bool
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId
- getEnv :: String -> IO String
- setEnv :: String -> String -> IO ()
- lookupEnv :: String -> IO (Maybe String)
- unsetEnv :: String -> IO ()
- unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
- transpose :: [[a]] -> [[a]]
- exitWith :: ExitCode -> IO a
- hGetBuf :: Handle -> Ptr a -> Int -> IO Int
- hPutBuf :: Handle -> Ptr a -> Int -> IO ()
- hWaitForInput :: Handle -> Int -> IO Bool
- sortOn :: Ord b => (a -> b) -> [a] -> [a]
- cycle :: HasCallStack => [a] -> [a]
- concat :: Foldable t => t [a] -> [a]
- zip :: [a] -> [b] -> [(a, b)]
- print :: Show a => a -> IO ()
- trace :: String -> a -> a
- guard :: Alternative f => Bool -> f ()
- (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- liftA :: Applicative f => (a -> b) -> f a -> f b
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- when :: Applicative f => Bool -> f () -> f ()
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- ap :: Monad m => m (a -> b) -> m a -> m b
- maybe :: b -> (a -> b) -> Maybe a -> b
- isJust :: Maybe a -> Bool
- isNothing :: Maybe a -> Bool
- fromJust :: HasCallStack => Maybe a -> a
- fromMaybe :: a -> Maybe a -> a
- maybeToList :: Maybe a -> [a]
- listToMaybe :: [a] -> Maybe a
- catMaybes :: [Maybe a] -> [a]
- head :: HasCallStack => [a] -> a
- uncons :: [a] -> Maybe (a, [a])
- tail :: HasCallStack => [a] -> [a]
- last :: HasCallStack => [a] -> a
- init :: HasCallStack => [a] -> [a]
- foldl1' :: HasCallStack => (a -> a -> a) -> [a] -> a
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanl' :: (b -> a -> b) -> b -> [a] -> [b]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- iterate :: (a -> a) -> a -> [a]
- iterate' :: (a -> a) -> a -> [a]
- repeat :: a -> [a]
- replicate :: Int -> a -> [a]
- takeWhile :: (a -> Bool) -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- take :: Int -> [a] -> [a]
- drop :: Int -> [a] -> [a]
- splitAt :: Int -> [a] -> ([a], [a])
- span :: (a -> Bool) -> [a] -> ([a], [a])
- break :: (a -> Bool) -> [a] -> ([a], [a])
- reverse :: [a] -> [a]
- and :: Foldable t => t Bool -> Bool
- or :: Foldable t => t Bool -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- (!!) :: HasCallStack => [a] -> Int -> a
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- unzip :: [(a, b)] -> ([a], [b])
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- showLitChar :: Char -> ShowS
- intToDigit :: Int -> Char
- generalCategory :: Char -> GeneralCategory
- isAscii :: Char -> Bool
- isLatin1 :: Char -> Bool
- isAsciiLower :: Char -> Bool
- isAsciiUpper :: Char -> Bool
- isSpace :: Char -> Bool
- isDigit :: Char -> Bool
- isOctDigit :: Char -> Bool
- isHexDigit :: Char -> Bool
- isPunctuation :: Char -> Bool
- isSymbol :: Char -> Bool
- isAlphaNum :: Char -> Bool
- isControl :: Char -> Bool
- isPrint :: Char -> Bool
- isUpper :: Char -> Bool
- isLower :: Char -> Bool
- toTitle :: Char -> Char
- optional :: Alternative f => f a -> f (Maybe a)
- formatRealFloat :: RealFloat a => a -> FieldFormatter
- clamp :: Ord a => (a, a) -> a -> a
- lexLitChar :: ReadS String
- readLitChar :: ReadS Char
- myThreadId :: IO ThreadId
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- lefts :: [Either a b] -> [a]
- rights :: [Either a b] -> [b]
- partitionEithers :: [Either a b] -> ([a], [b])
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
- fromLeft :: a -> Either a b -> a
- fromRight :: b -> Either a b -> b
- comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- digitToInt :: Char -> Int
- isMark :: Char -> Bool
- isNumber :: Char -> Bool
- isSeparator :: Char -> Bool
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- asum :: (Foldable t, Alternative f) => t (f a) -> f a
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- dropWhileEnd :: (a -> Bool) -> [a] -> [a]
- stripPrefix :: Eq a => [a] -> [a] -> Maybe [a]
- elemIndex :: Eq a => a -> [a] -> Maybe Int
- elemIndices :: Eq a => a -> [a] -> [Int]
- findIndex :: (a -> Bool) -> [a] -> Maybe Int
- findIndices :: (a -> Bool) -> [a] -> [Int]
- isPrefixOf :: Eq a => [a] -> [a] -> Bool
- isSuffixOf :: Eq a => [a] -> [a] -> Bool
- isInfixOf :: Eq a => [a] -> [a] -> Bool
- nub :: Eq a => [a] -> [a]
- nubBy :: (a -> a -> Bool) -> [a] -> [a]
- deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
- (\\) :: Eq a => [a] -> [a] -> [a]
- unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- intersect :: Eq a => [a] -> [a] -> [a]
- intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- intersperse :: a -> [a] -> [a]
- intercalate :: [a] -> [[a]] -> [a]
- partition :: (a -> Bool) -> [a] -> ([a], [a])
- mapAccumL :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)
- mapAccumR :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)
- insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
- zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
- zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
- zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
- zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
- zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
- zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
- zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
- zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
- unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
- unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
- unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
- unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
- deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- group :: Eq a => [a] -> [[a]]
- groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
- inits :: [a] -> [[a]]
- tails :: [a] -> [[a]]
- subsequences :: [a] -> [[a]]
- permutations :: [a] -> [[a]]
- sort :: Ord a => [a] -> [a]
- lines :: String -> [String]
- unlines :: [String] -> String
- words :: String -> [String]
- unwords :: [String] -> String
- newEmptyMVar :: IO (MVar a)
- newMVar :: a -> IO (MVar a)
- takeMVar :: MVar a -> IO a
- readMVar :: MVar a -> IO a
- putMVar :: MVar a -> a -> IO ()
- tryTakeMVar :: MVar a -> IO (Maybe a)
- tryPutMVar :: MVar a -> a -> IO Bool
- tryReadMVar :: MVar a -> IO (Maybe a)
- isEmptyMVar :: MVar a -> IO Bool
- addMVarFinalizer :: MVar a -> IO () -> IO ()
- userError :: String -> IOError
- close :: CliOpts -> Journal -> IO ()
- nativeNewline :: Newline
- universalNewlineMode :: NewlineMode
- nativeNewlineMode :: NewlineMode
- noNewlineTranslation :: NewlineMode
- ioError :: IOError -> IO a
- void :: Functor f => f a -> f ()
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- ($>) :: Functor f => f a -> b -> f b
- utf8_bom :: TextEncoding
- forkOn :: Int -> IO () -> IO ThreadId
- forkOnWithUnmask :: Int -> ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- getNumCapabilities :: IO Int
- setNumCapabilities :: Int -> IO ()
- yield :: IO ()
- threadCapability :: ThreadId -> IO (Int, Bool)
- mkWeakThreadId :: ThreadId -> IO (Weak ThreadId)
- withMVar :: MVar a -> (a -> IO b) -> IO b
- modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()
- swapMVar :: MVar a -> a -> IO a
- withMVarMasked :: MVar a -> (a -> IO b) -> IO b
- modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b
- modifyMVarMasked_ :: MVar a -> (a -> IO a) -> IO ()
- modifyMVarMasked :: MVar a -> (a -> IO (a, b)) -> IO b
- mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a))
- tryIOError :: IO a -> IO (Either IOError a)
- mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
- isAlreadyExistsError :: IOError -> Bool
- isUserError :: IOError -> Bool
- isResourceVanishedError :: IOError -> Bool
- alreadyExistsErrorType :: IOErrorType
- doesNotExistErrorType :: IOErrorType
- alreadyInUseErrorType :: IOErrorType
- fullErrorType :: IOErrorType
- eofErrorType :: IOErrorType
- illegalOperationErrorType :: IOErrorType
- permissionErrorType :: IOErrorType
- userErrorType :: IOErrorType
- resourceVanishedErrorType :: IOErrorType
- isAlreadyExistsErrorType :: IOErrorType -> Bool
- isDoesNotExistErrorType :: IOErrorType -> Bool
- isAlreadyInUseErrorType :: IOErrorType -> Bool
- isFullErrorType :: IOErrorType -> Bool
- isEOFErrorType :: IOErrorType -> Bool
- isIllegalOperationErrorType :: IOErrorType -> Bool
- isPermissionErrorType :: IOErrorType -> Bool
- isUserErrorType :: IOErrorType -> Bool
- isResourceVanishedErrorType :: IOErrorType -> Bool
- ioeGetErrorType :: IOError -> IOErrorType
- ioeGetErrorString :: IOError -> String
- ioeGetLocation :: IOError -> String
- ioeGetHandle :: IOError -> Maybe Handle
- ioeGetFileName :: IOError -> Maybe FilePath
- ioeSetErrorType :: IOError -> IOErrorType -> IOError
- ioeSetErrorString :: IOError -> String -> IOError
- ioeSetLocation :: IOError -> String -> IOError
- ioeSetHandle :: IOError -> Handle -> IOError
- ioeSetFileName :: IOError -> FilePath -> IOError
- modifyIOError :: (IOError -> IOError) -> IO a -> IO a
- annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError
- catchIOError :: IO a -> (IOError -> IO a) -> IO a
- threadWaitRead :: Fd -> IO ()
- threadWaitWrite :: Fd -> IO ()
- threadWaitReadSTM :: Fd -> IO (STM (), IO ())
- threadWaitWriteSTM :: Fd -> IO (STM (), IO ())
- utf32 :: TextEncoding
- utf32be :: TextEncoding
- utf32le :: TextEncoding
- utf16 :: TextEncoding
- utf16be :: TextEncoding
- utf16le :: TextEncoding
- latin1 :: TextEncoding
- char8 :: TextEncoding
- traceIO :: String -> IO ()
- withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- openBinaryFile :: FilePath -> IOMode -> IO Handle
- withBinaryFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- hGetChar :: Handle -> IO Char
- hGetLine :: Handle -> IO String
- hGetContents' :: Handle -> IO String
- hPutChar :: Handle -> Char -> IO ()
- hPutStr :: Handle -> String -> IO ()
- hPutStrLn :: Handle -> String -> IO ()
- hPutBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int
- hGetBufSome :: Handle -> Ptr a -> Int -> IO Int
- hGetBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int
- hFileSize :: Handle -> IO Integer
- hSetFileSize :: Handle -> Integer -> IO ()
- hIsEOF :: Handle -> IO Bool
- isEOF :: IO Bool
- hSetBuffering :: Handle -> BufferMode -> IO ()
- hSetEncoding :: Handle -> TextEncoding -> IO ()
- hGetEncoding :: Handle -> IO (Maybe TextEncoding)
- hGetPosn :: Handle -> IO HandlePosn
- hSetPosn :: HandlePosn -> IO ()
- hTell :: Handle -> IO Integer
- hIsOpen :: Handle -> IO Bool
- hIsClosed :: Handle -> IO Bool
- hIsReadable :: Handle -> IO Bool
- hGetBuffering :: Handle -> IO BufferMode
- hIsSeekable :: Handle -> IO Bool
- hSetEcho :: Handle -> Bool -> IO ()
- hGetEcho :: Handle -> IO Bool
- hSetNewlineMode :: Handle -> NewlineMode -> IO ()
- hShow :: Handle -> IO String
- putChar :: Char -> IO ()
- putStr :: String -> IO ()
- getChar :: IO Char
- getContents :: IO String
- getContents' :: IO String
- interact :: (String -> String) -> IO ()
- readFile :: FilePath -> IO String
- appendFile :: FilePath -> String -> IO ()
- readLn :: Read a => IO a
- readIO :: Read a => String -> IO a
- hReady :: Handle -> IO Bool
- hPrint :: Show a => Handle -> a -> IO ()
- openTempFile :: FilePath -> String -> IO (FilePath, Handle)
- openBinaryTempFile :: FilePath -> String -> IO (FilePath, Handle)
- openTempFileWithDefaultPermissions :: FilePath -> String -> IO (FilePath, Handle)
- openBinaryTempFileWithDefaultPermissions :: FilePath -> String -> IO (FilePath, Handle)
- isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
- traceShowId :: Show a => a -> a
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- replicateM_ :: Applicative m => Int -> m a -> m ()
- unless :: Applicative f => Bool -> f () -> f ()
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- printf :: PrintfType r => String -> r
- hPrintf :: HPrintfType r => Handle -> String -> r
- vFmt :: Char -> FieldFormat -> FieldFormat
- formatChar :: Char -> FieldFormatter
- formatString :: Bool -> Maybe Int -> Maybe Int -> String -> String
- formatInt :: (Integral a, Bounded a) => a -> FieldFormatter
- formatInteger :: Integer -> FieldFormatter
- perror :: String -> a
- errorBadFormat :: Char -> a
- errorShortFormat :: a
- errorMissingArgument :: a
- errorBadArgument :: a
- exitFailure :: IO a
- exitSuccess :: IO a
- die :: String -> IO a
- getExecutablePath :: IO FilePath
- executablePath :: Maybe (IO (Maybe FilePath))
- getProgName :: IO String
- withArgs :: [String] -> IO a -> IO a
- withProgName :: String -> IO a -> IO a
- getEnvironment :: IO [(String, String)]
- newQSemN :: Int -> IO QSemN
- waitQSemN :: QSemN -> Int -> IO ()
- signalQSemN :: QSemN -> Int -> IO ()
- newQSem :: Int -> IO QSem
- waitQSem :: QSem -> IO ()
- signalQSem :: QSem -> IO ()
- newChan :: IO (Chan a)
- writeChan :: Chan a -> a -> IO ()
- readChan :: Chan a -> IO a
- dupChan :: Chan a -> IO (Chan a)
- getChanContents :: Chan a -> IO [a]
- writeList2Chan :: Chan a -> [a] -> IO ()
- rtsSupportsBoundThreads :: Bool
- forkOSWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
- isCurrentThreadBound :: IO Bool
- runInBoundThread :: IO a -> IO a
- runInUnboundThread :: IO a -> IO a
- diff :: CliOpts -> Journal -> IO ()
- pack :: String -> Text
- unpack :: Text -> String
- takeEnd :: Int -> [a] -> [a]
- spanEnd :: DateSpan -> Maybe Day
- strip :: String -> String
- expandArgsAt :: [String] -> IO [String]
- joinArgs :: [String] -> String
- splitArgs :: String -> [String]
- parseBool :: String -> Maybe Bool
- fromGroup :: Group a -> [a]
- toGroup :: [a] -> Group a
- modeModes :: Mode a -> [Mode a]
- modeFlags :: Mode a -> [Flag a]
- fromFlagOpt :: FlagInfo -> String
- checkMode :: Mode a -> Maybe String
- remap2 :: Remap m => (a -> b) -> (b -> a) -> m a -> m b
- remapUpdate :: (a -> b) -> (b -> (a, a -> b)) -> Update a -> Update b
- modeEmpty :: a -> Mode a
- mode :: Name -> a -> Help -> Arg a -> [Flag a] -> Mode a
- modes :: String -> a -> Help -> [Mode a] -> Mode a
- flagNone :: [Name] -> (a -> a) -> Help -> Flag a
- flagOpt :: String -> [Name] -> Update a -> FlagHelp -> Help -> Flag a
- flagReq :: [Name] -> Update a -> FlagHelp -> Help -> Flag a
- flagArg :: Update a -> FlagHelp -> Arg a
- flagBool :: [Name] -> (Bool -> a -> a) -> Help -> Flag a
- complete :: Mode a -> [String] -> (Int, Int) -> [Complete]
- helpText :: [String] -> HelpFormat -> Mode a -> [Text]
- processArgs :: Mode a -> IO a
- processValue :: Mode a -> [String] -> a
- processValueIO :: Mode a -> [String] -> IO a
- flagHelpSimple :: (a -> a) -> Flag a
- flagHelpFormat :: (HelpFormat -> TextFormat -> a -> a) -> Flag a
- flagVersion :: (a -> a) -> Flag a
- flagNumericVersion :: (a -> a) -> Flag a
- flagsVerbosity :: (Verbosity -> a -> a) -> [Flag a]
- wrap :: Text -> Text -> Text -> Text
- balance :: CliOpts -> Journal -> IO ()
- searchPathSeparator :: Char
- removeDirectory :: FilePath -> IO ()
- removeFile :: FilePath -> IO ()
- normalise :: FilePath -> FilePath
- emptyPermissions :: Permissions
- setOwnerReadable :: Bool -> Permissions -> Permissions
- setOwnerWritable :: Bool -> Permissions -> Permissions
- setOwnerExecutable :: Bool -> Permissions -> Permissions
- setOwnerSearchable :: Bool -> Permissions -> Permissions
- getPermissions :: FilePath -> IO Permissions
- setPermissions :: FilePath -> Permissions -> IO ()
- copyPermissions :: FilePath -> FilePath -> IO ()
- createDirectory :: FilePath -> IO ()
- createDirectoryIfMissing :: Bool -> FilePath -> IO ()
- removeDirectoryRecursive :: FilePath -> IO ()
- removePathForcibly :: FilePath -> IO ()
- renameDirectory :: FilePath -> FilePath -> IO ()
- renameFile :: FilePath -> FilePath -> IO ()
- renamePath :: FilePath -> FilePath -> IO ()
- copyFile :: FilePath -> FilePath -> IO ()
- copyFileWithMetadata :: FilePath -> FilePath -> IO ()
- canonicalizePath :: FilePath -> IO FilePath
- makeAbsolute :: FilePath -> IO FilePath
- makeRelativeToCurrentDirectory :: FilePath -> IO FilePath
- findExecutable :: String -> IO (Maybe FilePath)
- findExecutables :: String -> IO [FilePath]
- findExecutablesInDirectories :: [FilePath] -> String -> IO [FilePath]
- findFile :: [FilePath] -> String -> IO (Maybe FilePath)
- findFiles :: [FilePath] -> String -> IO [FilePath]
- findFileWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO (Maybe FilePath)
- findFilesWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO [FilePath]
- exeExtension :: String
- listDirectory :: FilePath -> IO [FilePath]
- getCurrentDirectory :: IO FilePath
- setCurrentDirectory :: FilePath -> IO ()
- withCurrentDirectory :: FilePath -> IO a -> IO a
- getFileSize :: FilePath -> IO Integer
- doesPathExist :: FilePath -> IO Bool
- doesDirectoryExist :: FilePath -> IO Bool
- doesFileExist :: FilePath -> IO Bool
- createFileLink :: FilePath -> FilePath -> IO ()
- createDirectoryLink :: FilePath -> FilePath -> IO ()
- removeDirectoryLink :: FilePath -> IO ()
- pathIsSymbolicLink :: FilePath -> IO Bool
- isSymbolicLink :: FilePath -> IO Bool
- getSymbolicLinkTarget :: FilePath -> IO FilePath
- getAccessTime :: FilePath -> IO UTCTime
- getModificationTime :: FilePath -> IO UTCTime
- setAccessTime :: FilePath -> UTCTime -> IO ()
- setModificationTime :: FilePath -> UTCTime -> IO ()
- getHomeDirectory :: IO FilePath
- getXdgDirectory :: XdgDirectory -> FilePath -> IO FilePath
- getXdgDirectoryList :: XdgDirectoryList -> IO [FilePath]
- getAppUserDataDirectory :: FilePath -> IO FilePath
- getUserDocumentsDirectory :: IO FilePath
- getTemporaryDirectory :: IO FilePath
- dropTrailingPathSeparator :: FilePath -> FilePath
- makeRelative :: FilePath -> FilePath -> FilePath
- (</>) :: FilePath -> FilePath -> FilePath
- curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d
- uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
- first3 :: (a, b, c) -> a
- second3 :: (a, b, c) -> b
- third3 :: (a, b, c) -> c
- headDef :: a -> [a] -> a
- lastDef :: a -> [a] -> a
- system :: String -> IO ExitCode
- waitForProcess :: ProcessHandle -> IO ExitCode
- createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- createProcess_ :: String -> CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
- createPipe :: IO (Handle, Handle)
- createPipeFd :: IO (FD, FD)
- interruptProcessGroupOf :: ProcessHandle -> IO ()
- proc :: FilePath -> [String] -> CreateProcess
- shell :: String -> CreateProcess
- withCreateProcess :: CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> ProcessHandle -> IO a) -> IO a
- cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO ()
- spawnProcess :: FilePath -> [String] -> IO ProcessHandle
- spawnCommand :: String -> IO ProcessHandle
- callProcess :: FilePath -> [String] -> IO ()
- callCommand :: String -> IO ()
- readProcess :: FilePath -> [String] -> String -> IO String
- readCreateProcess :: CreateProcess -> String -> IO String
- readProcessWithExitCode :: FilePath -> [String] -> String -> IO (ExitCode, String, String)
- readCreateProcessWithExitCode :: CreateProcess -> String -> IO (ExitCode, String, String)
- showCommandForUser :: FilePath -> [String] -> String
- getPid :: ProcessHandle -> IO (Maybe Pid)
- getCurrentPid :: IO Pid
- getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode)
- terminateProcess :: ProcessHandle -> IO ()
- runCommand :: String -> IO ProcessHandle
- runProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO ProcessHandle
- runInteractiveCommand :: String -> IO (Handle, Handle, Handle, ProcessHandle)
- runInteractiveProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO (Handle, Handle, Handle, ProcessHandle)
- rawSystem :: String -> [String] -> IO ExitCode
- pathSeparator :: Char
- pathSeparators :: [Char]
- isPathSeparator :: Char -> Bool
- isSearchPathSeparator :: Char -> Bool
- extSeparator :: Char
- isExtSeparator :: Char -> Bool
- splitSearchPath :: String -> [FilePath]
- getSearchPath :: IO [FilePath]
- splitExtension :: FilePath -> (String, String)
- takeExtension :: FilePath -> String
- (-<.>) :: FilePath -> String -> FilePath
- replaceExtension :: FilePath -> String -> FilePath
- (<.>) :: FilePath -> String -> FilePath
- dropExtension :: FilePath -> FilePath
- addExtension :: FilePath -> String -> FilePath
- hasExtension :: FilePath -> Bool
- isExtensionOf :: String -> FilePath -> Bool
- stripExtension :: String -> FilePath -> Maybe FilePath
- splitExtensions :: FilePath -> (FilePath, String)
- dropExtensions :: FilePath -> FilePath
- takeExtensions :: FilePath -> String
- replaceExtensions :: FilePath -> String -> FilePath
- splitDrive :: FilePath -> (FilePath, FilePath)
- joinDrive :: FilePath -> FilePath -> FilePath
- takeDrive :: FilePath -> FilePath
- dropDrive :: FilePath -> FilePath
- hasDrive :: FilePath -> Bool
- isDrive :: FilePath -> Bool
- splitFileName :: FilePath -> (String, String)
- replaceFileName :: FilePath -> String -> FilePath
- dropFileName :: FilePath -> FilePath
- takeFileName :: FilePath -> FilePath
- takeBaseName :: FilePath -> String
- replaceBaseName :: FilePath -> String -> FilePath
- hasTrailingPathSeparator :: FilePath -> Bool
- addTrailingPathSeparator :: FilePath -> FilePath
- takeDirectory :: FilePath -> FilePath
- replaceDirectory :: FilePath -> String -> FilePath
- combine :: FilePath -> FilePath -> FilePath
- splitPath :: FilePath -> [FilePath]
- splitDirectories :: FilePath -> [FilePath]
- joinPath :: [FilePath] -> FilePath
- equalFilePath :: FilePath -> FilePath -> Bool
- isValid :: FilePath -> Bool
- makeValid :: FilePath -> FilePath
- isRelative :: FilePath -> Bool
- isAbsolute :: FilePath -> Bool
- takeWidth :: Int -> String -> String
- charWidth :: Char -> Int
- mkPos :: Int -> Pos
- unPos :: Pos -> Int
- initialPos :: FilePath -> SourcePos
- sourcePosPretty :: SourcePos -> String
- runExceptT :: ExceptT e m a -> m (Either e a)
- mkTimeout :: Integer -> Timeout
- testGroup :: TestName -> [TestTree] -> TestTree
- after_ :: DependencyType -> Expr -> TestTree -> TestTree
- after :: DependencyType -> String -> TestTree -> TestTree
- includingOptions :: [OptionDescription] -> Ingredient
- defaultMainWithIngredients :: [Ingredient] -> TestTree -> IO ()
- defaultIngredients :: [Ingredient]
- adjustOption :: IsOption v => (v -> v) -> TestTree -> TestTree
- localOption :: IsOption v => v -> TestTree -> TestTree
- askOption :: IsOption v => (v -> TestTree) -> TestTree
- withResource :: IO a -> (a -> IO ()) -> (IO a -> TestTree) -> TestTree
- toRegex :: Text -> Either RegexError Regexp
- toRegexCI :: Text -> Either RegexError Regexp
- toRegex' :: Text -> Regexp
- toRegexCI' :: Text -> Regexp
- regexMatch :: Regexp -> String -> Bool
- regexMatchText :: Regexp -> Text -> Bool
- regexReplace :: Regexp -> Replacement -> String -> Either RegexError String
- regexReplaceUnmemo :: Regexp -> Replacement -> String -> Either RegexError String
- regexReplaceAllBy :: Regexp -> (String -> String) -> String -> String
- fromEFDay :: EFDay -> Day
- modifyEFDay :: (Day -> Day) -> EFDay -> EFDay
- isBalanceSheetAccountType :: AccountType -> Bool
- isIncomeStatementAccountType :: AccountType -> Bool
- isAccountSubtypeOf :: AccountType -> AccountType -> Bool
- isDecimalMark :: Char -> Bool
- maCompare :: MixedAmount -> MixedAmount -> Ordering
- nulltransactionmodifier :: TransactionModifier
- nullperiodictransaction :: PeriodicTransaction
- nullpayeedeclarationinfo :: PayeeDeclarationInfo
- nulltagdeclarationinfo :: TagDeclarationInfo
- nullaccountdeclarationinfo :: AccountDeclarationInfo
- periodAsDateSpan :: Period -> DateSpan
- dateSpanAsPeriod :: DateSpan -> Period
- simplifyPeriod :: Period -> Period
- isLastDayOfMonth :: (Eq a1, Eq a2, Num a1, Num a2) => Year -> a1 -> a2 -> Bool
- isStandardPeriod :: Period -> Bool
- periodTextWidth :: Period -> Int
- showPeriod :: Period -> Text
- showPeriodMonthAbbrev :: Period -> Text
- periodStart :: Period -> Maybe Day
- periodEnd :: Period -> Maybe Day
- periodNext :: Period -> Period
- periodPrevious :: Period -> Period
- periodNextIn :: DateSpan -> Period -> Period
- periodPreviousIn :: DateSpan -> Period -> Period
- periodMoveTo :: Day -> Period -> Period
- periodGrow :: Period -> Period
- periodShrink :: Day -> Period -> Period
- mondayBefore :: Day -> Day
- yearMonthContainingWeekStarting :: Day -> (Year, MonthOfYear)
- quarterContainingMonth :: Integral a => a -> a
- firstMonthOfQuarter :: Num a => a -> a
- startOfFirstWeekInMonth :: Integer -> Int -> Day
- customErrorBundlePretty :: HledgerParseErrors -> String
- wbToText :: WideBuilder -> Text
- wbFromText :: Text -> WideBuilder
- wbUnpack :: WideBuilder -> String
- textElideRight :: Int -> Text -> Text
- textChomp :: Text -> Text
- formatText :: Bool -> Maybe Int -> Maybe Int -> Text -> Text
- quoteIfSpaced :: Text -> Text
- textQuoteIfNeeded :: Text -> Text
- escapeDoubleQuotes :: Text -> Text
- stripquotes :: Text -> Text
- textUnbracket :: Text -> Text
- textConcatTopPadded :: [Text] -> Text
- textConcatBottomPadded :: [Text] -> Text
- fitText :: Maybe Int -> Maybe Int -> Bool -> Bool -> Text -> Text
- textTakeWidth :: Int -> Text -> Text
- linesPrepend :: Text -> Text -> Text
- linesPrepend2 :: Text -> Text -> Text -> Text
- unlinesB :: [Builder] -> Builder
- readDecimal :: Text -> Integer
- tests_Text :: TestTree
- pshow :: Show a => a -> String
- pshow' :: Show a => a -> String
- pprint :: Show a => a -> IO ()
- pprint' :: Show a => a -> IO ()
- getTerminalHeightWidth :: IO (Maybe (Int, Int))
- getTerminalHeight :: IO (Maybe Int)
- getTerminalWidth :: IO (Maybe Int)
- setupPager :: IO ()
- progArgs :: [String]
- outputFileOption :: Maybe String
- hasOutputFile :: Bool
- bold' :: String -> String
- faint' :: String -> String
- black' :: String -> String
- red' :: String -> String
- green' :: String -> String
- yellow' :: String -> String
- blue' :: String -> String
- magenta' :: String -> String
- cyan' :: String -> String
- white' :: String -> String
- brightBlack' :: String -> String
- brightRed' :: String -> String
- brightGreen' :: String -> String
- brightYellow' :: String -> String
- brightBlue' :: String -> String
- brightMagenta' :: String -> String
- brightCyan' :: String -> String
- brightWhite' :: String -> String
- rgb' :: Word8 -> Word8 -> Word8 -> String -> String
- colorOption :: String
- useColorOnStdout :: Bool
- useColorOnStderr :: Bool
- color :: ColorIntensity -> Color -> String -> String
- bgColor :: ColorIntensity -> Color -> String -> String
- colorB :: ColorIntensity -> Color -> WideBuilder -> WideBuilder
- bgColorB :: ColorIntensity -> Color -> WideBuilder -> WideBuilder
- terminalIsLight :: Maybe Bool
- terminalLightness :: Maybe Float
- terminalBgColor :: Maybe (RGB Float)
- terminalFgColor :: Maybe (RGB Float)
- error' :: String -> a
- usageError :: String -> a
- expandHomePath :: FilePath -> IO FilePath
- expandPath :: FilePath -> FilePath -> IO FilePath
- expandGlob :: FilePath -> FilePath -> IO [FilePath]
- sortByModTime :: [FilePath] -> IO [FilePath]
- readFilePortably :: FilePath -> IO Text
- readFileOrStdinPortably :: String -> IO Text
- readHandlePortably :: Handle -> IO Text
- embedFileRelative :: FilePath -> Q Exp
- getCurrentLocalTime :: IO LocalTime
- getCurrentZonedTime :: IO ZonedTime
- assertLeft :: (HasCallStack, Eq b, Show b) => Either a b -> Assertion
- assertRight :: (HasCallStack, Eq a, Show a) => Either a b -> Assertion
- assertParse :: (HasCallStack, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> Assertion
- assertParseEq :: (HasCallStack, Eq a, Show a, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> a -> Assertion
- assertParseEqOn :: (HasCallStack, Eq b, Show b, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> (a -> b) -> b -> Assertion
- assertParseError :: (HasCallStack, Eq a, Show a, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> String -> Assertion
- assertParseStateOn :: (HasCallStack, Eq b, Show b, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> (st -> b) -> b -> Assertion
- assertParseE :: (HasCallStack, Eq a, Show a, Default st) => StateT st (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError IO)) a -> Text -> Assertion
- assertParseEqE :: (Default st, Eq a, Show a, HasCallStack) => StateT st (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError IO)) a -> Text -> a -> Assertion
- assertParseErrorE :: (Default st, Eq a, Show a, HasCallStack) => StateT st (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError IO)) a -> Text -> String -> Assertion
- debugLevel :: Int
- traceWith :: (a -> String) -> a -> a
- ptrace :: Show a => a -> a
- traceAt :: Int -> String -> a -> a
- traceAtWith :: Int -> (a -> String) -> a -> a
- ptraceAt :: Show a => Int -> String -> a -> a
- ptraceAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m ()
- traceLog :: String -> a -> a
- traceLogAt :: Int -> String -> a -> a
- traceLogIO :: MonadIO m => String -> m ()
- traceLogAtIO :: MonadIO m => Int -> String -> m ()
- traceLogWith :: (a -> String) -> a -> a
- traceLogAtWith :: Int -> (a -> String) -> a -> a
- ptraceLogAt :: Show a => Int -> String -> a -> a
- ptraceLogAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m ()
- traceOrLog :: String -> a -> a
- traceOrLogAt :: Int -> String -> a -> a
- ptraceOrLogAt :: Show a => Int -> String -> a -> a
- ptraceOrLogAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m ()
- traceOrLogAtWith :: Int -> (a -> String) -> a -> a
- dbg0 :: Show a => String -> a -> a
- dbg1 :: Show a => String -> a -> a
- dbg2 :: Show a => String -> a -> a
- dbg3 :: Show a => String -> a -> a
- dbg4 :: Show a => String -> a -> a
- dbg5 :: Show a => String -> a -> a
- dbg6 :: Show a => String -> a -> a
- dbg7 :: Show a => String -> a -> a
- dbg8 :: Show a => String -> a -> a
- dbg9 :: Show a => String -> a -> a
- dbgExit :: Show a => String -> a -> a
- dbg0IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg1IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg2IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg3IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg4IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg5IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg6IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg7IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg8IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg9IO :: (MonadIO m, Show a) => String -> a -> m ()
- dbg0With :: (a -> String) -> a -> a
- dbg1With :: Show a => (a -> String) -> a -> a
- dbg2With :: Show a => (a -> String) -> a -> a
- dbg3With :: Show a => (a -> String) -> a -> a
- dbg4With :: Show a => (a -> String) -> a -> a
- dbg5With :: Show a => (a -> String) -> a -> a
- dbg6With :: Show a => (a -> String) -> a -> a
- dbg7With :: Show a => (a -> String) -> a -> a
- dbg8With :: Show a => (a -> String) -> a -> a
- dbg9With :: Show a => (a -> String) -> a -> a
- traceOrLogParse :: forall (m :: Type -> Type). String -> TextParser m ()
- dbgparse :: forall (m :: Type -> Type). Int -> String -> TextParser m ()
- sourcePosPairPretty :: (SourcePos, SourcePos) -> String
- choice' :: forall (m :: Type -> Type) a. [TextParser m a] -> TextParser m a
- choiceInState :: forall s (m :: Type -> Type) a. [StateT s (ParsecT HledgerParseErrorData Text m) a] -> StateT s (ParsecT HledgerParseErrorData Text m) a
- surroundedBy :: Applicative m => m openclose -> m a -> m a
- parsewith :: Parsec e Text a -> Text -> Either (ParseErrorBundle Text e) a
- runTextParser :: TextParser Identity a -> Text -> Either HledgerParseErrors a
- rtp :: TextParser Identity a -> Text -> Either HledgerParseErrors a
- parsewithString :: Parsec e String a -> String -> Either (ParseErrorBundle String e) a
- parseWithState :: Monad m => st -> StateT st (ParsecT HledgerParseErrorData Text m) a -> Text -> m (Either HledgerParseErrors a)
- parseWithState' :: Stream s => st -> StateT st (ParsecT e s Identity) a -> s -> Either (ParseErrorBundle s e) a
- fromparse :: (Show t, Show (Token t), Show e) => Either (ParseErrorBundle t e) a -> a
- parseerror :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> a
- showDateParseError :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> String
- isNewline :: Char -> Bool
- nonspace :: forall (m :: Type -> Type). TextParser m Char
- isNonNewlineSpace :: Char -> Bool
- spacenonewline :: forall s (m :: Type -> Type). (Stream s, Char ~ Token s) => ParsecT HledgerParseErrorData s m Char
- restofline :: forall (m :: Type -> Type). TextParser m String
- skipNonNewlineSpaces :: forall s (m :: Type -> Type). (Stream s, Token s ~ Char) => ParsecT HledgerParseErrorData s m ()
- skipNonNewlineSpaces1 :: forall s (m :: Type -> Type). (Stream s, Token s ~ Char) => ParsecT HledgerParseErrorData s m ()
- skipNonNewlineSpaces' :: forall s (m :: Type -> Type). (Stream s, Token s ~ Char) => ParsecT HledgerParseErrorData s m Bool
- eolof :: forall (m :: Type -> Type). TextParser m ()
- lowercase :: String -> String
- uppercase :: String -> String
- lstrip :: String -> String
- rstrip :: String -> String
- strip1Char :: Char -> Char -> String -> String
- stripBy :: (Char -> Bool) -> String -> String
- strip1By :: (Char -> Bool) -> String -> String
- chomp :: String -> String
- chomp1 :: String -> String
- singleline :: String -> String
- stripbrackets :: String -> String
- elideLeft :: Int -> String -> String
- elideRight :: Int -> String -> String
- underline :: String -> String
- quoteIfNeeded :: String -> String
- singleQuoteIfNeeded :: String -> String
- quoteForCommandLine :: String -> String
- words' :: String -> [String]
- unwords' :: [String] -> String
- strWidthAnsi :: String -> Int
- strWidth :: String -> Int
- stripAnsi :: String -> String
- applyN :: Int -> (a -> a) -> a -> a
- mapM' :: Monad f => (a -> f b) -> [a] -> f [b]
- sequence' :: Monad f => [f a] -> f [a]
- curry2 :: ((a, b) -> c) -> a -> b -> c
- uncurry2 :: (a -> b -> c) -> (a, b) -> c
- curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e
- uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e
- maximum' :: Integral a => [a] -> a
- maximumStrict :: Ord a => [a] -> a
- minimumStrict :: Ord a => [a] -> a
- splitAtElement :: Eq a => a -> [a] -> [[a]]
- sumStrict :: Num a => [a] -> a
- treeLeaves :: Tree a -> [a]
- first4 :: (a, b, c, d) -> a
- second4 :: (a, b, c, d) -> b
- third4 :: (a, b, c, d) -> c
- fourth4 :: (a, b, c, d) -> d
- first5 :: (a, b, c, d, e) -> a
- second5 :: (a, b, c, d, e) -> b
- third5 :: (a, b, c, d, e) -> c
- fourth5 :: (a, b, c, d, e) -> d
- fifth5 :: (a, b, c, d, e) -> e
- first6 :: (a, b, c, d, e, f) -> a
- second6 :: (a, b, c, d, e, f) -> b
- third6 :: (a, b, c, d, e, f) -> c
- fourth6 :: (a, b, c, d, e, f) -> d
- fifth6 :: (a, b, c, d, e, f) -> e
- sixth6 :: (a, b, c, d, e, f) -> f
- multicol :: Int -> [String] -> String
- numDigitsInt :: Integral a => Int -> a
- makeHledgerClassyLenses :: Name -> DecsQ
- tests_Utils :: TestTree
- overRawOpts :: ([(String, String)] -> [(String, String)]) -> RawOpts -> RawOpts
- setopt :: String -> String -> RawOpts -> RawOpts
- setboolopt :: String -> RawOpts -> RawOpts
- unsetboolopt :: String -> RawOpts -> RawOpts
- appendopts :: [(String, String)] -> RawOpts -> RawOpts
- boolopt :: String -> RawOpts -> Bool
- toggleopt :: String -> RawOpts -> Bool
- choiceopt :: (String -> Maybe a) -> RawOpts -> Maybe a
- collectopts :: ((String, String) -> Maybe a) -> RawOpts -> [a]
- maybestringopt :: String -> RawOpts -> Maybe String
- stringopt :: String -> RawOpts -> String
- maybecharopt :: String -> RawOpts -> Maybe Char
- listofstringopt :: String -> RawOpts -> [String]
- maybeintopt :: String -> RawOpts -> Maybe Int
- maybeposintopt :: String -> RawOpts -> Maybe Int
- intopt :: String -> RawOpts -> Int
- posintopt :: String -> RawOpts -> Int
- showDate :: Day -> Text
- showEFDate :: EFDay -> Text
- showDateSpan :: DateSpan -> Text
- showDateSpanDebug :: DateSpan -> String
- showDateSpanMonthAbbrev :: DateSpan -> Text
- getCurrentDay :: IO Day
- getCurrentMonth :: IO Int
- getCurrentYear :: IO Integer
- elapsedSeconds :: Fractional a => UTCTime -> UTCTime -> a
- spanStart :: DateSpan -> Maybe Day
- spanStartYear :: DateSpan -> Maybe Year
- spanEndYear :: DateSpan -> Maybe Year
- spanYears :: DateSpan -> [Year]
- spansSpan :: [DateSpan] -> DateSpan
- splitSpan :: Bool -> Interval -> DateSpan -> [DateSpan]
- spansFromBoundaries :: Day -> [Day] -> [DateSpan]
- daysInSpan :: DateSpan -> Maybe Integer
- spanContainsDate :: DateSpan -> Day -> Bool
- periodContainsDate :: Period -> Day -> Bool
- groupByDateSpan :: Bool -> (a -> Day) -> [DateSpan] -> [a] -> [(DateSpan, [a])]
- spansIntersect :: [DateSpan] -> DateSpan
- spanIntersect :: DateSpan -> DateSpan -> DateSpan
- spanDefaultsFrom :: DateSpan -> DateSpan -> DateSpan
- spansUnion :: [DateSpan] -> DateSpan
- spanUnion :: DateSpan -> DateSpan -> DateSpan
- daysSpan :: [Day] -> DateSpan
- latestSpanContaining :: [DateSpan] -> Day -> Maybe DateSpan
- parsePeriodExpr :: Day -> Text -> Either HledgerParseErrors (Interval, DateSpan)
- parsePeriodExpr' :: Day -> Text -> (Interval, DateSpan)
- fixSmartDateStr :: Day -> Text -> Text
- fixSmartDateStrEither :: Day -> Text -> Either HledgerParseErrors Text
- fixSmartDateStrEither' :: Day -> Text -> Either HledgerParseErrors EFDay
- fixSmartDate :: Day -> SmartDate -> EFDay
- prevday :: Day -> Day
- intervalBoundaryBefore :: Interval -> Day -> Day
- parsedateM :: String -> Maybe Day
- smartdate :: forall (m :: Type -> Type). TextParser m SmartDate
- datesepchars :: String
- datesepchar :: forall (m :: Type -> Type). TextParser m Char
- isDateSepChar :: Char -> Bool
- yearp :: forall (m :: Type -> Type). TextParser m Integer
- periodexprp :: forall (m :: Type -> Type). Day -> TextParser m (Interval, DateSpan)
- nulldatespan :: DateSpan
- emptydatespan :: DateSpan
- nulldate :: Day
- tests_Dates :: TestTree
- acctsepchar :: Char
- acctsep :: Text
- accountNameComponents :: AccountName -> [Text]
- accountNameFromComponents :: [Text] -> AccountName
- accountLeafName :: AccountName -> Text
- accountSummarisedName :: AccountName -> Text
- assetAccountRegex :: Regexp
- cashAccountRegex :: Regexp
- liabilityAccountRegex :: Regexp
- equityAccountRegex :: Regexp
- conversionAccountRegex :: Regexp
- revenueAccountRegex :: Regexp
- expenseAccountRegex :: Regexp
- accountNameInferType :: AccountName -> Maybe AccountType
- accountNameType :: Map AccountName AccountType -> AccountName -> Maybe AccountType
- accountNameLevel :: AccountName -> Int
- unbudgetedAccountName :: Text
- accountNamePostingType :: AccountName -> PostingType
- accountNameWithoutPostingType :: AccountName -> AccountName
- accountNameWithPostingType :: PostingType -> AccountName -> AccountName
- joinAccountNames :: AccountName -> AccountName -> AccountName
- concatAccountNames :: [AccountName] -> AccountName
- accountNameApplyAliases :: [AccountAlias] -> AccountName -> Either RegexError AccountName
- accountNameApplyAliasesMemo :: [AccountAlias] -> AccountName -> Either RegexError AccountName
- accountNameDrop :: Int -> AccountName -> AccountName
- expandAccountNames :: [AccountName] -> [AccountName]
- expandAccountName :: AccountName -> [AccountName]
- topAccountNames :: [AccountName] -> [AccountName]
- parentAccountName :: AccountName -> AccountName
- parentAccountNames :: AccountName -> [AccountName]
- isAccountNamePrefixOf :: AccountName -> AccountName -> Bool
- isSubAccountNameOf :: AccountName -> AccountName -> Bool
- subAccountNamesFrom :: [AccountName] -> AccountName -> [AccountName]
- accountNameTreeFrom :: [AccountName] -> Tree AccountName
- elideAccountName :: Int -> AccountName -> AccountName
- clipAccountName :: Maybe Int -> AccountName -> AccountName
- clipOrEllipsifyAccountName :: Maybe Int -> AccountName -> AccountName
- escapeName :: AccountName -> Text
- accountNameToAccountRegex :: AccountName -> Regexp
- accountNameToAccountRegexCI :: AccountName -> Regexp
- accountNameToAccountOnlyRegex :: AccountName -> Regexp
- accountNameToAccountOnlyRegexCI :: AccountName -> Regexp
- tests_AccountName :: TestTree
- defaultBalanceLineFormat :: StringFormat
- parseStringFormat :: Text -> Either String StringFormat
- defaultStringFormatStyle :: [StringFormatComponent] -> StringFormat
- tests_StringFormat :: TestTree
- showCommoditySymbol :: Text -> Text
- isNonsimpleCommodityChar :: Char -> Bool
- quoteCommoditySymbolIfNeeded :: Text -> Text
- noColour :: AmountDisplayOpts
- noPrice :: AmountDisplayOpts
- oneLine :: AmountDisplayOpts
- csvDisplay :: AmountDisplayOpts
- amountstyle :: AmountStyle
- nullamt :: Amount
- missingamt :: Amount
- num :: Quantity -> Amount
- hrs :: Quantity -> Amount
- usd :: DecimalRaw Integer -> Amount
- eur :: DecimalRaw Integer -> Amount
- gbp :: DecimalRaw Integer -> Amount
- per :: Quantity -> Amount
- at :: Amount -> Amount -> Amount
- (@@) :: Amount -> Amount -> Amount
- amountWithCommodity :: CommoditySymbol -> Amount -> Amount
- amountCost :: Amount -> Amount
- divideAmount :: Quantity -> Amount -> Amount
- multiplyAmount :: Quantity -> Amount -> Amount
- isNegativeAmount :: Amount -> Bool
- amountLooksZero :: Amount -> Bool
- amountIsZero :: Amount -> Bool
- withPrecision :: Amount -> AmountPrecision -> Amount
- amountSetPrecision :: AmountPrecision -> Amount -> Amount
- amountSetFullPrecision :: Amount -> Amount
- setAmountInternalPrecision :: Word8 -> Amount -> Amount
- withInternalPrecision :: Amount -> Word8 -> Amount
- setAmountDecimalPoint :: Maybe Char -> Amount -> Amount
- withDecimalPoint :: Amount -> Maybe Char -> Amount
- amountStripPrices :: Amount -> Amount
- showAmountPrice :: Amount -> WideBuilder
- styleAmount :: Map CommoditySymbol AmountStyle -> Amount -> Amount
- styleAmountExceptPrecision :: Map CommoditySymbol AmountStyle -> Amount -> Amount
- amountUnstyled :: Amount -> Amount
- showAmount :: Amount -> String
- showAmountB :: AmountDisplayOpts -> Amount -> WideBuilder
- cshowAmount :: Amount -> String
- showAmountWithoutPrice :: Amount -> String
- showAmountWithZeroCommodity :: Amount -> String
- showAmountDebug :: Amount -> String
- canonicaliseAmount :: Map CommoditySymbol AmountStyle -> Amount -> Amount
- nullmixedamt :: MixedAmount
- missingmixedamt :: MixedAmount
- isMissingMixedAmount :: MixedAmount -> Bool
- mixed :: Foldable t => t Amount -> MixedAmount
- mixedAmount :: Amount -> MixedAmount
- maAddAmount :: MixedAmount -> Amount -> MixedAmount
- maAddAmounts :: Foldable t => MixedAmount -> t Amount -> MixedAmount
- maNegate :: MixedAmount -> MixedAmount
- maPlus :: MixedAmount -> MixedAmount -> MixedAmount
- maMinus :: MixedAmount -> MixedAmount -> MixedAmount
- maSum :: Foldable t => t MixedAmount -> MixedAmount
- divideMixedAmount :: Quantity -> MixedAmount -> MixedAmount
- multiplyMixedAmount :: Quantity -> MixedAmount -> MixedAmount
- averageMixedAmounts :: [MixedAmount] -> MixedAmount
- isNegativeMixedAmount :: MixedAmount -> Maybe Bool
- mixedAmountLooksZero :: MixedAmount -> Bool
- mixedAmountIsZero :: MixedAmount -> Bool
- maIsZero :: MixedAmount -> Bool
- maIsNonZero :: MixedAmount -> Bool
- amounts :: MixedAmount -> [Amount]
- amountsRaw :: MixedAmount -> [Amount]
- maCommodities :: MixedAmount -> Set CommoditySymbol
- unifyMixedAmount :: MixedAmount -> Maybe Amount
- filterMixedAmount :: (Amount -> Bool) -> MixedAmount -> MixedAmount
- filterMixedAmountByCommodity :: CommoditySymbol -> MixedAmount -> MixedAmount
- mapMixedAmount :: (Amount -> Amount) -> MixedAmount -> MixedAmount
- mixedAmountCost :: MixedAmount -> MixedAmount
- styleMixedAmount :: Map CommoditySymbol AmountStyle -> MixedAmount -> MixedAmount
- mixedAmountUnstyled :: MixedAmount -> MixedAmount
- showMixedAmount :: MixedAmount -> String
- showMixedAmountOneLine :: MixedAmount -> String
- showMixedAmountWithZeroCommodity :: MixedAmount -> String
- showMixedAmountWithoutPrice :: Bool -> MixedAmount -> String
- showMixedAmountOneLineWithoutPrice :: Bool -> MixedAmount -> String
- showMixedAmountElided :: Int -> Bool -> MixedAmount -> String
- showMixedAmountDebug :: MixedAmount -> String
- showMixedAmountB :: AmountDisplayOpts -> MixedAmount -> WideBuilder
- showMixedAmountLinesB :: AmountDisplayOpts -> MixedAmount -> [WideBuilder]
- mixedAmountSetPrecision :: AmountPrecision -> MixedAmount -> MixedAmount
- mixedAmountSetFullPrecision :: MixedAmount -> MixedAmount
- mixedAmountStripPrices :: MixedAmount -> MixedAmount
- canonicaliseMixedAmount :: Map CommoditySymbol AmountStyle -> MixedAmount -> MixedAmount
- tests_Amount :: TestTree
- journalPriceOracle :: Bool -> Journal -> PriceOracle
- priceDirectiveToMarketPrice :: PriceDirective -> MarketPrice
- amountPriceDirectiveFromCost :: Day -> Amount -> Maybe PriceDirective
- mixedAmountToCost :: Map CommoditySymbol AmountStyle -> ConversionOp -> MixedAmount -> MixedAmount
- mixedAmountApplyValuation :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> Day -> ValuationType -> MixedAmount -> MixedAmount
- mixedAmountValueAtDate :: PriceOracle -> Map CommoditySymbol AmountStyle -> Maybe CommoditySymbol -> Day -> MixedAmount -> MixedAmount
- mixedAmountApplyGain :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> Day -> ValuationType -> MixedAmount -> MixedAmount
- mixedAmountGainAtDate :: PriceOracle -> Map CommoditySymbol AmountStyle -> Maybe CommoditySymbol -> Day -> MixedAmount -> MixedAmount
- marketPriceReverse :: MarketPrice -> MarketPrice
- tests_Valuation :: TestTree
- nullposting :: Posting
- posting :: Posting
- post :: AccountName -> Amount -> Posting
- vpost :: AccountName -> Amount -> Posting
- post' :: AccountName -> Amount -> Maybe BalanceAssertion -> Posting
- vpost' :: AccountName -> Amount -> Maybe BalanceAssertion -> Posting
- nullsourcepos :: (SourcePos, SourcePos)
- nullassertion :: BalanceAssertion
- balassert :: Amount -> Maybe BalanceAssertion
- balassertTot :: Amount -> Maybe BalanceAssertion
- balassertParInc :: Amount -> Maybe BalanceAssertion
- balassertTotInc :: Amount -> Maybe BalanceAssertion
- showBalanceAssertion :: BalanceAssertion -> WideBuilder
- originalPosting :: Posting -> Posting
- showPosting :: Posting -> String
- showPostingLines :: Posting -> [Text]
- postingsAsLines :: Bool -> [Posting] -> [Text]
- postingAsLines :: Bool -> Bool -> Int -> Int -> Posting -> ([Text], Int, Int)
- showAccountName :: Maybe Int -> PostingType -> AccountName -> Text
- renderCommentLines :: Text -> [Text]
- isReal :: Posting -> Bool
- isVirtual :: Posting -> Bool
- isBalancedVirtual :: Posting -> Bool
- hasAmount :: Posting -> Bool
- hasBalanceAssignment :: Posting -> Bool
- accountNamesFromPostings :: [Posting] -> [AccountName]
- sumPostings :: [Posting] -> MixedAmount
- postingStripPrices :: Posting -> Posting
- postingDate :: Posting -> Day
- postingDate2 :: Posting -> Day
- postingDateOrDate2 :: WhichDate -> Posting -> Day
- postingStatus :: Posting -> Status
- postingAllTags :: Posting -> [Tag]
- transactionAllTags :: Transaction -> [Tag]
- relatedPostings :: Posting -> [Posting]
- isPostingInDateSpan :: DateSpan -> Posting -> Bool
- isPostingInDateSpan' :: WhichDate -> DateSpan -> Posting -> Bool
- isEmptyPosting :: Posting -> Bool
- postingApplyAliases :: [AccountAlias] -> Posting -> Either RegexError Posting
- postingApplyCommodityStyles :: Map CommoditySymbol AmountStyle -> Posting -> Posting
- postingAddTags :: Posting -> [Tag] -> Posting
- postingApplyValuation :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> ValuationType -> Posting -> Posting
- postingToCost :: Map CommoditySymbol AmountStyle -> ConversionOp -> Posting -> Maybe Posting
- postingAddInferredEquityPostings :: Bool -> Text -> Posting -> [Posting]
- postingPriceDirectivesFromCost :: Posting -> [PriceDirective]
- postingTransformAmount :: (MixedAmount -> MixedAmount) -> Posting -> Posting
- commentJoin :: Text -> Text -> Text
- commentAddTag :: Text -> Tag -> Text
- commentAddTagNextLine :: Text -> Tag -> Text
- tests_Posting :: TestTree
- nulltransaction :: Transaction
- transaction :: Day -> [Posting] -> Transaction
- transactionPayee :: Transaction -> Text
- transactionNote :: Transaction -> Text
- showTransaction :: Transaction -> Text
- showTransactionOneLineAmounts :: Transaction -> Text
- showTransactionLineFirstPart :: Transaction -> Text
- hasRealPostings :: Transaction -> Bool
- realPostings :: Transaction -> [Posting]
- assignmentPostings :: Transaction -> [Posting]
- virtualPostings :: Transaction -> [Posting]
- balancedVirtualPostings :: Transaction -> [Posting]
- transactionsPostings :: [Transaction] -> [Posting]
- transactionDate2 :: Transaction -> Day
- transactionDateOrDate2 :: WhichDate -> Transaction -> Day
- txnTieKnot :: Transaction -> Transaction
- txnUntieKnot :: Transaction -> Transaction
- transactionTransformPostings :: (Posting -> Posting) -> Transaction -> Transaction
- transactionApplyValuation :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> ValuationType -> Transaction -> Transaction
- transactionToCost :: Map CommoditySymbol AmountStyle -> ConversionOp -> Transaction -> Transaction
- transactionAddInferredEquityPostings :: Bool -> AccountName -> Transaction -> Transaction
- transactionInferCostsFromEquity :: Bool -> Map AccountName AccountType -> Transaction -> Either String Transaction
- partitionAndCheckConversionPostings :: Bool -> Map AccountName AccountType -> [IdxPosting] -> Either Text ([(IdxPosting, IdxPosting)], ([IdxPosting], [IdxPosting]))
- transactionApplyAliases :: [AccountAlias] -> Transaction -> Either RegexError Transaction
- transactionMapPostings :: (Posting -> Posting) -> Transaction -> Transaction
- transactionMapPostingAmounts :: (MixedAmount -> MixedAmount) -> Transaction -> Transaction
- transactionFile :: Transaction -> FilePath
- annotateErrorWithTransaction :: Transaction -> String -> String
- tests_Transaction :: TestTree
- payeeTag :: Maybe Text -> Either RegexError Query
- noteTag :: Maybe Text -> Either RegexError Query
- generatedTransactionTag :: Query
- parseQuery :: Day -> Text -> Either String (Query, [QueryOpt])
- parseQueryList :: Day -> [Text] -> Either String (Query, [QueryOpt])
- words'' :: [Text] -> Text -> [Text]
- queryprefixes :: [Text]
- parseQueryTerm :: Day -> Text -> Either String (Query, [QueryOpt])
- parseAccountType :: Bool -> Text -> Either String AccountType
- simplifyQuery :: Query -> Query
- filterQuery :: (Query -> Bool) -> Query -> Query
- filterQueryOrNotQuery :: (Query -> Bool) -> Query -> Query
- matchesQuery :: (Query -> Bool) -> Query -> Bool
- queryIsNull :: Query -> Bool
- queryIsDate :: Query -> Bool
- queryIsDate2 :: Query -> Bool
- queryIsDateOrDate2 :: Query -> Bool
- queryIsStatus :: Query -> Bool
- queryIsCode :: Query -> Bool
- queryIsDesc :: Query -> Bool
- queryIsTag :: Query -> Bool
- queryIsAcct :: Query -> Bool
- queryIsType :: Query -> Bool
- queryIsDepth :: Query -> Bool
- queryIsReal :: Query -> Bool
- queryIsAmt :: Query -> Bool
- queryIsSym :: Query -> Bool
- queryIsStartDateOnly :: Bool -> Query -> Bool
- queryIsTransactionRelated :: Query -> Bool
- queryStartDate :: Bool -> Query -> Maybe Day
- queryEndDate :: Bool -> Query -> Maybe Day
- queryDateSpan :: Bool -> Query -> DateSpan
- queryDateSpan' :: Query -> DateSpan
- queryDepth :: Query -> Maybe Int
- inAccount :: [QueryOpt] -> Maybe (AccountName, Bool)
- inAccountQuery :: [QueryOpt] -> Maybe Query
- matchesCommodity :: Query -> CommoditySymbol -> Bool
- matchesAmount :: Query -> Amount -> Bool
- matchesMixedAmount :: Query -> MixedAmount -> Bool
- matchesAccount :: Query -> AccountName -> Bool
- matchesAccountExtra :: (AccountName -> Maybe AccountType) -> (AccountName -> [Tag]) -> Query -> AccountName -> Bool
- matchesPosting :: Query -> Posting -> Bool
- matchesPostingExtra :: (AccountName -> Maybe AccountType) -> Query -> Posting -> Bool
- matchesTransaction :: Query -> Transaction -> Bool
- matchesTransactionExtra :: (AccountName -> Maybe AccountType) -> Query -> Transaction -> Bool
- matchesDescription :: Query -> Text -> Bool
- matchesPayeeWIP :: Query -> Payee -> Bool
- matchesTags :: Regexp -> Maybe Regexp -> [Tag] -> Bool
- matchesPriceDirective :: Query -> PriceDirective -> Bool
- tests_Query :: TestTree
- modifyTransactions :: (AccountName -> Maybe AccountType) -> (AccountName -> [Tag]) -> Map CommoditySymbol AmountStyle -> Day -> Bool -> [TransactionModifier] -> [Transaction] -> Either String [Transaction]
- timeclockEntriesToTransactions :: LocalTime -> [TimeclockEntry] -> [Transaction]
- tests_Timeclock :: TestTree
- makeAccountTagErrorExcerpt :: (AccountName, AccountDeclarationInfo) -> TagName -> (FilePath, Int, Maybe (Int, Maybe Int), Text)
- makeTransactionErrorExcerpt :: Transaction -> (Transaction -> Maybe (Int, Maybe Int)) -> (FilePath, Int, Maybe (Int, Maybe Int), Text)
- makePostingErrorExcerpt :: Posting -> (Posting -> Transaction -> Text -> Maybe (Int, Maybe Int)) -> (FilePath, Int, Maybe (Int, Maybe Int), Text)
- transactionFindPostingIndex :: (Posting -> Bool) -> Transaction -> Maybe Int
- makePostingAccountErrorExcerpt :: Posting -> (FilePath, Int, Maybe (Int, Maybe Int), Text)
- makeBalanceAssertionErrorExcerpt :: Posting -> (FilePath, Int, Maybe (Int, Maybe Int), Text)
- journalCheckOrdereddates :: WhichDate -> Journal -> Either String ()
- runPeriodicTransaction :: Bool -> PeriodicTransaction -> DateSpan -> [Transaction]
- checkPeriodicTransactionStartDate :: Interval -> DateSpan -> Text -> Maybe String
- toJsonText :: ToJSON a => a -> Text
- writeJsonFile :: ToJSON a => FilePath -> a -> IO ()
- readJsonFile :: FromJSON a => FilePath -> IO a
- journalConcat :: Journal -> Journal -> Journal
- journalRenumberAccountDeclarations :: Journal -> Journal
- dbgJournalAcctDeclOrder :: String -> Journal -> Journal
- nulljournal :: Journal
- journalFilePath :: Journal -> FilePath
- journalFilePaths :: Journal -> [FilePath]
- addTransaction :: Transaction -> Journal -> Journal
- addTransactionModifier :: TransactionModifier -> Journal -> Journal
- addPeriodicTransaction :: PeriodicTransaction -> Journal -> Journal
- addPriceDirective :: PriceDirective -> Journal -> Journal
- journalTransactionAt :: Journal -> Integer -> Maybe Transaction
- journalNextTransaction :: Journal -> Transaction -> Maybe Transaction
- journalPrevTransaction :: Journal -> Transaction -> Maybe Transaction
- journalPostings :: Journal -> [Posting]
- journalCommoditiesDeclared :: Journal -> [CommoditySymbol]
- journalCommodities :: Journal -> Set CommoditySymbol
- journalDescriptions :: Journal -> [Text]
- journalPayeesDeclared :: Journal -> [Payee]
- journalPayeesUsed :: Journal -> [Payee]
- journalPayeesDeclaredOrUsed :: Journal -> [Payee]
- journalTagsDeclared :: Journal -> [TagName]
- journalTagsUsed :: Journal -> [TagName]
- journalTagsDeclaredOrUsed :: Journal -> [TagName]
- journalAccountNamesUsed :: Journal -> [AccountName]
- journalAccountNamesImplied :: Journal -> [AccountName]
- journalAccountNamesDeclared :: Journal -> [AccountName]
- journalLeafAccountNamesDeclared :: Journal -> [AccountName]
- journalAccountNamesDeclaredOrUsed :: Journal -> [AccountName]
- journalAccountNamesDeclaredOrImplied :: Journal -> [AccountName]
- journalAccountNames :: Journal -> [AccountName]
- journalLeafAccountNames :: Journal -> [AccountName]
- journalAccountNameTree :: Journal -> Tree AccountName
- journalAccountTags :: Journal -> AccountName -> [Tag]
- journalInheritedAccountTags :: Journal -> AccountName -> [Tag]
- journalTransactionsSimilarTo :: Journal -> Text -> Query -> SimilarityScore -> Int -> [(DateWeightedSimilarityScore, Age, SimilarityScore, Transaction)]
- journalConversionAccount :: Journal -> AccountName
- journalAccountType :: Journal -> AccountName -> Maybe AccountType
- journalAddAccountTypes :: Journal -> Journal
- journalAccountTypes :: Journal -> Map AccountName AccountType
- journalPostingsAddAccountTags :: Journal -> Journal
- filterJournalTransactions :: Query -> Journal -> Journal
- filterJournalPostings :: Query -> Journal -> Journal
- filterJournalRelatedPostings :: Query -> Journal -> Journal
- filterJournalAmounts :: Query -> Journal -> Journal
- filterTransactionAmounts :: Query -> Transaction -> Transaction
- filterPostingAmount :: Query -> Posting -> Maybe Posting
- filterTransactionPostings :: Query -> Transaction -> Transaction
- filterTransactionPostingsExtra :: (AccountName -> Maybe AccountType) -> Query -> Transaction -> Transaction
- filterTransactionRelatedPostings :: Query -> Transaction -> Transaction
- journalMapTransactions :: (Transaction -> Transaction) -> Journal -> Journal
- journalMapPostings :: (Posting -> Posting) -> Journal -> Journal
- journalMapPostingAmounts :: (MixedAmount -> MixedAmount) -> Journal -> Journal
- journalReverse :: Journal -> Journal
- journalSetLastReadTime :: POSIXTime -> Journal -> Journal
- journalNumberAndTieTransactions :: Journal -> Journal
- journalNumberTransactions :: Journal -> Journal
- journalUntieTransactions :: Transaction -> Transaction
- journalModifyTransactions :: Bool -> Day -> Journal -> Either String Journal
- journalApplyCommodityStyles :: Journal -> Either String Journal
- journalCommodityStyles :: Journal -> Map CommoditySymbol AmountStyle
- commodityStylesFromAmounts :: [Amount] -> Either String (Map CommoditySymbol AmountStyle)
- canonicalStyleFrom :: [AmountStyle] -> AmountStyle
- journalInferMarketPricesFromTransactions :: Journal -> Journal
- journalToCost :: ConversionOp -> Journal -> Journal
- journalAddInferredEquityPostings :: Bool -> Journal -> Journal
- journalInferCostsFromEquity :: Journal -> Either String Journal
- journalMarkRedundantCosts :: Journal -> Either String Journal
- journalDateSpan :: Bool -> Journal -> DateSpan
- journalDateSpanBothDates :: Journal -> DateSpan
- journalStartDate :: Bool -> Journal -> Maybe Day
- journalEndDate :: Bool -> Journal -> Maybe Day
- journalLastDay :: Bool -> Journal -> Maybe Day
- journalPivot :: Text -> Journal -> Journal
- journalApplyAliases :: [AccountAlias] -> Journal -> Either RegexError Journal
- samplejournal :: Journal
- samplejournalMaybeExplicit :: Bool -> Journal
- tests_Journal :: TestTree
- journalCheckUniqueleafnames :: Journal -> Either String ()
- journalCheckAccounts :: Journal -> Either String ()
- journalCheckCommodities :: Journal -> Either String ()
- journalCheckPayees :: Journal -> Either String ()
- journalCheckTags :: Journal -> Either String ()
- journalCheckPairedConversionPostings :: Journal -> Either String ()
- journalCheckRecentAssertions :: Day -> Journal -> Either String ()
- defbalancingopts :: BalancingOpts
- isTransactionBalanced :: BalancingOpts -> Transaction -> Bool
- balanceTransaction :: BalancingOpts -> Transaction -> Either String Transaction
- balanceTransactionHelper :: BalancingOpts -> Transaction -> Either String (Transaction, [(AccountName, MixedAmount)])
- journalCheckBalanceAssertions :: Journal -> Maybe String
- journalBalanceTransactions :: BalancingOpts -> Journal -> Either String Journal
- tests_Balancing :: TestTree
- definputopts :: InputOpts
- forecastPeriod :: InputOpts -> Journal -> Maybe DateSpan
- nullacct :: Account
- accountsFromPostings :: [Posting] -> [Account]
- accountTree :: AccountName -> [AccountName] -> Account
- parentAccounts :: Account -> [Account]
- accountsLevels :: Account -> [[Account]]
- mapAccounts :: (Account -> Account) -> Account -> Account
- anyAccounts :: (Account -> Bool) -> Account -> Bool
- sumAccounts :: Account -> Account
- clipAccounts :: Int -> Account -> Account
- clipAccountsAndAggregate :: Maybe Int -> [Account] -> [Account]
- pruneAccounts :: (Account -> Bool) -> Account -> Maybe Account
- flattenAccounts :: Account -> [Account]
- filterAccounts :: (Account -> Bool) -> Account -> [Account]
- sortAccountTreeByAmount :: NormalSign -> Account -> Account
- accountSetDeclarationInfo :: Journal -> Account -> Account
- sortAccountNamesByDeclaration :: Journal -> Bool -> [AccountName] -> [AccountName]
- lookupAccount :: AccountName -> [Account] -> Maybe Account
- printAccounts :: Account -> IO ()
- showAccounts :: Account -> String
- showAccountsBoringFlag :: Account -> String
- nullledger :: Ledger
- ledgerFromJournal :: Query -> Journal -> Ledger
- ledgerAccountNames :: Ledger -> [AccountName]
- ledgerAccount :: Ledger -> AccountName -> Maybe Account
- ledgerRootAccount :: Ledger -> Account
- ledgerTopAccounts :: Ledger -> [Account]
- ledgerLeafAccounts :: Ledger -> [Account]
- ledgerPostings :: Ledger -> [Posting]
- ledgerDateSpan :: Ledger -> DateSpan
- ledgerCommodities :: Ledger -> [CommoditySymbol]
- tests_Ledger :: TestTree
- tests_Data :: TestTree
- defreportopts :: ReportOpts
- rawOptsToReportOpts :: Day -> RawOpts -> ReportOpts
- defreportspec :: ReportSpec
- setDefaultConversionOp :: ConversionOp -> ReportSpec -> ReportSpec
- balanceAccumulationOverride :: RawOpts -> Maybe BalanceAccumulation
- intervalFromRawOpts :: RawOpts -> Interval
- simplifyStatuses :: Ord a => [a] -> [a]
- reportOptsToggleStatus :: Status -> ReportOpts -> ReportOpts
- transactionDateFn :: ReportOpts -> Transaction -> Day
- postingDateFn :: ReportOpts -> Posting -> Day
- whichDate :: ReportOpts -> WhichDate
- tree_ :: ReportOpts -> Bool
- flat_ :: ReportOpts -> Bool
- journalValueAndFilterPostings :: ReportSpec -> Journal -> Journal
- journalValueAndFilterPostingsWith :: ReportSpec -> Journal -> PriceOracle -> Journal
- journalApplyValuationFromOpts :: ReportSpec -> Journal -> Journal
- journalApplyValuationFromOptsWith :: ReportSpec -> Journal -> PriceOracle -> Journal
- mixedAmountApplyValuationAfterSumFromOptsWith :: ReportOpts -> Journal -> PriceOracle -> DateSpan -> MixedAmount -> MixedAmount
- valuationAfterSum :: ReportOpts -> Maybe (Maybe CommoditySymbol)
- queryFromFlags :: ReportOpts -> Query
- reportSpan :: Journal -> ReportSpec -> (DateSpan, [DateSpan])
- reportSpanBothDates :: Journal -> ReportSpec -> (DateSpan, [DateSpan])
- reportStartDate :: Journal -> ReportSpec -> Maybe Day
- reportEndDate :: Journal -> ReportSpec -> Maybe Day
- reportPeriodStart :: ReportSpec -> Maybe Day
- reportPeriodOrJournalStart :: ReportSpec -> Journal -> Maybe Day
- reportPeriodLastDay :: ReportSpec -> Maybe Day
- reportPeriodOrJournalLastDay :: ReportSpec -> Journal -> Maybe Day
- reportPeriodName :: BalanceAccumulation -> [DateSpan] -> DateSpan -> Text
- overEither :: ((a -> Either e b) -> s -> Either e t) -> (a -> b) -> s -> Either e t
- setEither :: ((a -> Either e b) -> s -> Either e t) -> b -> s -> Either e t
- reportOptsToSpec :: Day -> ReportOpts -> Either String ReportSpec
- updateReportSpec :: ReportOpts -> ReportSpec -> Either String ReportSpec
- updateReportSpecWith :: (ReportOpts -> ReportOpts) -> ReportSpec -> Either String ReportSpec
- rawOptsToReportSpec :: Day -> RawOpts -> Either String ReportSpec
- prrAdd :: Semigroup b => PeriodicReportRow a b -> PeriodicReportRow a b -> PeriodicReportRow a b
- periodicReportSpan :: PeriodicReport a b -> DateSpan
- prMapName :: (a -> b) -> PeriodicReport a c -> PeriodicReport b c
- prMapMaybeName :: (a -> Maybe b) -> PeriodicReport a c -> PeriodicReport b c
- flatDisplayName :: AccountName -> DisplayName
- treeDisplayName :: AccountName -> DisplayName
- prrFullName :: PeriodicReportRow DisplayName a -> AccountName
- prrDisplayName :: PeriodicReportRow DisplayName a -> AccountName
- prrDepth :: PeriodicReportRow DisplayName a -> Int
- postingsReport :: ReportSpec -> Journal -> PostingsReport
- mkpostingsReportItem :: Bool -> Bool -> WhichDate -> Maybe Period -> Posting -> MixedAmount -> PostingsReportItem
- tests_PostingsReport :: TestTree
- multiBalanceReport :: ReportSpec -> Journal -> MultiBalanceReport
- multiBalanceReportWith :: ReportSpec -> Journal -> PriceOracle -> Set AccountName -> MultiBalanceReport
- compoundBalanceReport :: ReportSpec -> Journal -> [CBCSubreportSpec a] -> CompoundPeriodicReport a MixedAmount
- compoundBalanceReportWith :: ReportSpec -> Journal -> PriceOracle -> [CBCSubreportSpec a] -> CompoundPeriodicReport a MixedAmount
- startingPostings :: ReportSpec -> Journal -> PriceOracle -> DateSpan -> [Posting]
- makeReportQuery :: ReportSpec -> DateSpan -> ReportSpec
- getPostingsByColumn :: ReportSpec -> Journal -> PriceOracle -> [DateSpan] -> [(DateSpan, [Posting])]
- getPostings :: ReportSpec -> Journal -> PriceOracle -> [Posting]
- generateMultiBalanceReport :: ReportSpec -> Journal -> PriceOracle -> Set AccountName -> [(DateSpan, [Posting])] -> HashMap AccountName Account -> MultiBalanceReport
- sortRows :: ReportOpts -> Journal -> [MultiBalanceReportRow] -> [MultiBalanceReportRow]
- sortRowsLike :: [AccountName] -> [PeriodicReportRow DisplayName b] -> [PeriodicReportRow DisplayName b]
- balanceReportTableAsText :: ReportOpts -> Table Text Text WideBuilder -> Builder
- tests_MultiBalanceReport :: TestTree
- entriesReport :: ReportSpec -> Journal -> EntriesReport
- tests_EntriesReport :: TestTree
- budgetReport :: ReportSpec -> BalancingOpts -> DateSpan -> Journal -> BudgetReport
- combineBudgetAndActual :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport -> BudgetReport
- budgetReportAsText :: ReportOpts -> BudgetReport -> Text
- budgetReportAsTable :: ReportOpts -> BudgetReport -> Table Text Text WideBuilder
- budgetReportAsCsv :: ReportOpts -> BudgetReport -> [[Text]]
- tests_BudgetReport :: TestTree
- flatShowsExclusiveBalance :: Bool
- balanceReport :: ReportSpec -> Journal -> BalanceReport
- tests_BalanceReport :: TestTree
- triOrigTransaction :: (a, b, c, d, e, f) -> a
- triDate :: (a, Transaction, c, d, e, f) -> Day
- triAmount :: (a, b, c, d, e, f) -> e
- triBalance :: (a, b, c, d, e, f) -> f
- triCommodityAmount :: CommoditySymbol -> (a, b, c, d, MixedAmount, f) -> MixedAmount
- triCommodityBalance :: CommoditySymbol -> (a, b, c, d, e, MixedAmount) -> MixedAmount
- accountTransactionsReport :: ReportSpec -> Journal -> Query -> AccountTransactionsReport
- accountTransactionsReportItems :: Query -> Query -> MixedAmount -> (MixedAmount -> MixedAmount) -> (AccountName -> Maybe AccountType) -> [(Day, Transaction)] -> [AccountTransactionsReportItem]
- transactionRegisterDate :: WhichDate -> Query -> Query -> Transaction -> Day
- accountTransactionsReportByCommodity :: AccountTransactionsReport -> [(CommoditySymbol, AccountTransactionsReport)]
- tests_AccountTransactionsReport :: TestTree
- tests_Reports :: TestTree
- rawOptsToInputOpts :: Day -> RawOpts -> InputOpts
- parseAndFinaliseJournal :: ErroringJournalParser IO ParsedJournal -> InputOpts -> FilePath -> Text -> ExceptT String IO Journal
- initialiseAndParseJournal :: ErroringJournalParser IO ParsedJournal -> InputOpts -> FilePath -> Text -> ExceptT String IO Journal
- journalFinalise :: InputOpts -> FilePath -> Text -> ParsedJournal -> ExceptT String IO Journal
- journalAddAutoPostings :: Bool -> Day -> BalancingOpts -> Journal -> Either String Journal
- journalAddForecast :: Bool -> Maybe DateSpan -> Journal -> Journal
- setYear :: forall (m :: Type -> Type). Year -> JournalParser m ()
- getYear :: forall (m :: Type -> Type). JournalParser m (Maybe Year)
- setDefaultCommodityAndStyle :: forall (m :: Type -> Type). (CommoditySymbol, AmountStyle) -> JournalParser m ()
- getDefaultCommodityAndStyle :: forall (m :: Type -> Type). JournalParser m (Maybe (CommoditySymbol, AmountStyle))
- getDefaultAmountStyle :: forall (m :: Type -> Type). JournalParser m (Maybe AmountStyle)
- getAmountStyle :: forall (m :: Type -> Type). CommoditySymbol -> JournalParser m (Maybe AmountStyle)
- addDeclaredAccountTags :: forall (m :: Type -> Type). AccountName -> [Tag] -> JournalParser m ()
- addDeclaredAccountType :: forall (m :: Type -> Type). AccountName -> AccountType -> JournalParser m ()
- pushParentAccount :: forall (m :: Type -> Type). AccountName -> JournalParser m ()
- popParentAccount :: forall (m :: Type -> Type). JournalParser m ()
- getParentAccount :: forall (m :: Type -> Type). JournalParser m AccountName
- addAccountAlias :: MonadState Journal m => AccountAlias -> m ()
- getAccountAliases :: MonadState Journal m => m [AccountAlias]
- clearAccountAliases :: MonadState Journal m => m ()
- journalAddFile :: (FilePath, Text) -> Journal -> Journal
- statusp :: forall (m :: Type -> Type). TextParser m Status
- codep :: forall (m :: Type -> Type). TextParser m Text
- descriptionp :: forall (m :: Type -> Type). TextParser m Text
- datep :: forall (m :: Type -> Type). JournalParser m Day
- datetimep :: forall (m :: Type -> Type). JournalParser m LocalTime
- secondarydatep :: forall (m :: Type -> Type). Day -> TextParser m Day
- modifiedaccountnamep :: forall (m :: Type -> Type). JournalParser m AccountName
- accountnamep :: forall (m :: Type -> Type). TextParser m AccountName
- noncommenttextp :: forall (m :: Type -> Type). TextParser m Text
- noncommenttext1p :: forall (m :: Type -> Type). TextParser m Text
- singlespacedtext1p :: forall (m :: Type -> Type). TextParser m Text
- singlespacednoncommenttext1p :: forall (m :: Type -> Type). TextParser m Text
- singlespacedtextsatisfying1p :: forall (m :: Type -> Type). (Char -> Bool) -> TextParser m Text
- singlespacep :: forall (m :: Type -> Type). TextParser m ()
- spaceandamountormissingp :: forall (m :: Type -> Type). JournalParser m MixedAmount
- amountp :: forall (m :: Type -> Type). JournalParser m Amount
- amountp' :: forall (m :: Type -> Type). Bool -> JournalParser m Amount
- parseamount :: String -> Either HledgerParseErrors Amount
- parseamount' :: String -> Amount
- parsemixedamount :: String -> Either HledgerParseErrors MixedAmount
- parsemixedamount' :: String -> MixedAmount
- commoditysymbolp :: forall (m :: Type -> Type). TextParser m CommoditySymbol
- costp :: forall (m :: Type -> Type). Amount -> JournalParser m AmountPrice
- balanceassertionp :: forall (m :: Type -> Type). JournalParser m BalanceAssertion
- lotcostp :: forall (m :: Type -> Type). JournalParser m ()
- numberp :: forall (m :: Type -> Type). Maybe AmountStyle -> TextParser m (Quantity, Word8, Maybe Char, Maybe DigitGroupStyle)
- fromRawNumber :: RawNumber -> Maybe Integer -> Either String (Quantity, Word8, Maybe Char, Maybe DigitGroupStyle)
- rawnumberp :: forall (m :: Type -> Type). TextParser m (Either AmbiguousNumber RawNumber)
- multilinecommentp :: forall (m :: Type -> Type). TextParser m ()
- emptyorcommentlinep :: forall (m :: Type -> Type). TextParser m ()
- isLineCommentStart :: Char -> Bool
- isSameLineCommentStart :: Char -> Bool
- followingcommentp :: forall (m :: Type -> Type). TextParser m Text
- transactioncommentp :: forall (m :: Type -> Type). TextParser m (Text, [Tag])
- postingcommentp :: forall (m :: Type -> Type). Maybe Year -> TextParser m (Text, [Tag], Maybe Day, Maybe Day)
- bracketeddatetagsp :: forall (m :: Type -> Type). Maybe Year -> TextParser m [(TagName, Day)]
- aliasesFromOpts :: InputOpts -> [AccountAlias]
- accountaliasp :: forall (m :: Type -> Type). TextParser m AccountAlias
- tests_Common :: TestTree
- runJournalParser :: Monad m => JournalParser m a -> Text -> m (Either HledgerParseErrors a)
- findReader :: forall (m :: Type -> Type). MonadIO m => Maybe StorageFormat -> Maybe FilePath -> Maybe (Reader m)
- splitReaderPrefix :: PrefixedFilePath -> (Maybe String, FilePath)
- tmpostingrulep :: forall (m :: Type -> Type). Maybe Year -> JournalParser m TMPostingRule
- defaultJournal :: IO Journal
- defaultJournalPath :: IO String
- readJournal :: InputOpts -> Maybe FilePath -> Text -> ExceptT String IO Journal
- readJournalFile :: InputOpts -> PrefixedFilePath -> ExceptT String IO Journal
- readJournalFiles :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO Journal
- readJournal' :: Text -> IO Journal
- readJournalFile' :: PrefixedFilePath -> IO Journal
- readJournalFiles' :: [PrefixedFilePath] -> IO Journal
- orDieTrying :: MonadIO m => ExceptT String m a -> m a
- requireJournalFileExists :: FilePath -> IO ()
- ensureJournalFileExists :: FilePath -> IO ()
- tests_Read :: TestTree
- tests_Hledger :: TestTree
- assertFailure :: HasCallStack => String -> IO a
- assertBool :: HasCallStack => String -> Bool -> Assertion
- assertEqual :: (Eq a, Show a, HasCallStack) => String -> a -> a -> Assertion
- (@=?) :: (Eq a, Show a, HasCallStack) => a -> a -> Assertion
- (@?=) :: (Eq a, Show a, HasCallStack) => a -> a -> Assertion
- (@?) :: (AssertionPredicable t, HasCallStack) => t -> String -> Assertion
- assertString :: HasCallStack => String -> Assertion
- testCaseSteps :: TestName -> ((String -> IO ()) -> Assertion) -> TestTree
- testCase :: TestName -> Assertion -> TestTree
- testCaseInfo :: TestName -> IO String -> TestTree
- add :: CliOpts -> Journal -> IO ()
- foldl1May :: (a -> a -> a) -> [a] -> Maybe a
- foldr1May :: (a -> a -> a) -> [a] -> Maybe a
- foldl1Note :: Partial => String -> (a -> a -> a) -> [a] -> a
- foldr1Note :: Partial => String -> (a -> a -> a) -> [a] -> a
- minimumMay :: Ord a => [a] -> Maybe a
- maximumMay :: Ord a => [a] -> Maybe a
- minimumNote :: (Partial, Ord a) => String -> [a] -> a
- maximumNote :: (Partial, Ord a) => String -> [a] -> a
- minimumByMay :: (a -> a -> Ordering) -> [a] -> Maybe a
- maximumByMay :: (a -> a -> Ordering) -> [a] -> Maybe a
- minimumByNote :: Partial => String -> (a -> a -> Ordering) -> [a] -> a
- maximumByNote :: Partial => String -> (a -> a -> Ordering) -> [a] -> a
- maximumBoundBy :: a -> (a -> a -> Ordering) -> [a] -> a
- minimumBoundBy :: a -> (a -> a -> Ordering) -> [a] -> a
- maximumBound :: Ord a => a -> [a] -> a
- minimumBound :: Ord a => a -> [a] -> a
- maximumBounded :: (Ord a, Bounded a) => [a] -> a
- minimumBounded :: (Ord a, Bounded a) => [a] -> a
- findJust :: (a -> Bool) -> [a] -> a
- findJustDef :: a -> (a -> Bool) -> [a] -> a
- findJustNote :: Partial => String -> (a -> Bool) -> [a] -> a
- minimumDef :: Ord a => a -> [a] -> a
- maximumDef :: Ord a => a -> [a] -> a
- minimumByDef :: a -> (a -> a -> Ordering) -> [a] -> a
- maximumByDef :: a -> (a -> a -> Ordering) -> [a] -> a
- foldl1Def :: a -> (a -> a -> a) -> [a] -> a
- foldr1Def :: a -> (a -> a -> a) -> [a] -> a
- abort :: Partial => String -> a
- tailMay :: [a] -> Maybe [a]
- tailDef :: [a] -> [a] -> [a]
- tailNote :: Partial => String -> [a] -> [a]
- tailSafe :: [a] -> [a]
- initMay :: [a] -> Maybe [a]
- initDef :: [a] -> [a] -> [a]
- initNote :: Partial => String -> [a] -> [a]
- initSafe :: [a] -> [a]
- headMay :: [a] -> Maybe a
- lastMay :: [a] -> Maybe a
- headNote :: Partial => String -> [a] -> a
- lastNote :: Partial => String -> [a] -> a
- foldl1May' :: (a -> a -> a) -> [a] -> Maybe a
- foldl1Note' :: Partial => String -> (a -> a -> a) -> [a] -> a
- scanr1May :: (a -> a -> a) -> [a] -> Maybe [a]
- scanl1May :: (a -> a -> a) -> [a] -> Maybe [a]
- scanr1Def :: [a] -> (a -> a -> a) -> [a] -> [a]
- scanl1Def :: [a] -> (a -> a -> a) -> [a] -> [a]
- scanr1Note :: Partial => String -> (a -> a -> a) -> [a] -> [a]
- scanl1Note :: Partial => String -> (a -> a -> a) -> [a] -> [a]
- cycleMay :: [a] -> Maybe [a]
- cycleDef :: [a] -> [a] -> [a]
- cycleNote :: Partial => String -> [a] -> [a]
- fromJustDef :: a -> Maybe a -> a
- fromJustNote :: Partial => String -> Maybe a -> a
- assertNote :: Partial => String -> Bool -> a -> a
- atMay :: [a] -> Int -> Maybe a
- atDef :: a -> [a] -> Int -> a
- atNote :: Partial => String -> [a] -> Int -> a
- readEitherSafe :: Read a => String -> Either String a
- readMay :: Read a => String -> Maybe a
- readDef :: Read a => a -> String -> a
- readNote :: (Partial, Read a) => String -> String -> a
- lookupJust :: (Eq a, Partial) => a -> [(a, b)] -> b
- lookupJustDef :: Eq a => b -> a -> [(a, b)] -> b
- lookupJustNote :: (Partial, Eq a) => String -> a -> [(a, b)] -> b
- elemIndexJust :: (Partial, Eq a) => a -> [a] -> Int
- elemIndexJustDef :: Eq a => Int -> a -> [a] -> Int
- elemIndexJustNote :: (Partial, Eq a) => String -> a -> [a] -> Int
- findIndexJust :: (a -> Bool) -> [a] -> Int
- findIndexJustDef :: Int -> (a -> Bool) -> [a] -> Int
- findIndexJustNote :: Partial => String -> (a -> Bool) -> [a] -> Int
- toEnumMay :: (Enum a, Bounded a) => Int -> Maybe a
- toEnumDef :: (Enum a, Bounded a) => a -> Int -> a
- toEnumNote :: (Partial, Enum a, Bounded a) => String -> Int -> a
- toEnumSafe :: (Enum a, Bounded a) => Int -> a
- succMay :: (Enum a, Eq a, Bounded a) => a -> Maybe a
- succDef :: (Enum a, Eq a, Bounded a) => a -> a -> a
- succNote :: (Partial, Enum a, Eq a, Bounded a) => String -> a -> a
- succSafe :: (Enum a, Eq a, Bounded a) => a -> a
- predMay :: (Enum a, Eq a, Bounded a) => a -> Maybe a
- predDef :: (Enum a, Eq a, Bounded a) => a -> a -> a
- predNote :: (Partial, Enum a, Eq a, Bounded a) => String -> a -> a
- predSafe :: (Enum a, Eq a, Bounded a) => a -> a
- indexMay :: Ix a => (a, a) -> a -> Maybe Int
- indexDef :: Ix a => Int -> (a, a) -> a -> Int
- indexNote :: (Partial, Ix a) => String -> (a, a) -> a -> Int
- foldl1Def' :: a -> (a -> a -> a) -> [a] -> a
- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- fromGregorian :: Year -> MonthOfYear -> DayOfMonth -> Day
- calendarDay :: CalendarDiffDays
- calendarWeek :: CalendarDiffDays
- calendarMonth :: CalendarDiffDays
- calendarYear :: CalendarDiffDays
- scaleCalendarDiffDays :: Integer -> CalendarDiffDays -> CalendarDiffDays
- addDays :: Integer -> Day -> Day
- diffDays :: Day -> Day -> Integer
- periodAllDays :: DayPeriod p => p -> [Day]
- periodLength :: DayPeriod p => p -> Int
- periodFromDay :: DayPeriod p => Day -> (p, Int)
- periodToDay :: DayPeriod p => p -> Int -> Day
- periodToDayValid :: DayPeriod p => p -> Int -> Maybe Day
- isLeapYear :: Year -> Bool
- toGregorian :: Day -> (Year, MonthOfYear, DayOfMonth)
- fromGregorianValid :: Year -> MonthOfYear -> DayOfMonth -> Maybe Day
- showGregorian :: Day -> String
- gregorianMonthLength :: Year -> MonthOfYear -> DayOfMonth
- addGregorianMonthsClip :: Integer -> Day -> Day
- addGregorianMonthsRollOver :: Integer -> Day -> Day
- addGregorianYearsClip :: Integer -> Day -> Day
- addGregorianYearsRollOver :: Integer -> Day -> Day
- addGregorianDurationClip :: CalendarDiffDays -> Day -> Day
- addGregorianDurationRollOver :: CalendarDiffDays -> Day -> Day
- diffGregorianDurationClip :: Day -> Day -> CalendarDiffDays
- diffGregorianDurationRollOver :: Day -> Day -> CalendarDiffDays
- dayOfWeek :: Day -> DayOfWeek
- dayOfWeekDiff :: DayOfWeek -> DayOfWeek -> Int
- firstDayOfWeekOnAfter :: DayOfWeek -> Day -> Day
- weekAllDays :: DayOfWeek -> Day -> [Day]
- weekFirstDay :: DayOfWeek -> Day -> Day
- weekLastDay :: DayOfWeek -> Day -> Day
- secondsToDiffTime :: Integer -> DiffTime
- picosecondsToDiffTime :: Integer -> DiffTime
- diffTimeToPicoseconds :: DiffTime -> Integer
- secondsToNominalDiffTime :: Pico -> NominalDiffTime
- nominalDiffTimeToSeconds :: NominalDiffTime -> Pico
- nominalDay :: NominalDiffTime
- getTime_resolution :: DiffTime
- getCurrentTime :: IO UTCTime
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime
- calendarTimeTime :: NominalDiffTime -> CalendarDiffTime
- scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime
- minutesToTimeZone :: Int -> TimeZone
- hoursToTimeZone :: Int -> TimeZone
- timeZoneOffsetString' :: Maybe Char -> TimeZone -> String
- timeZoneOffsetString :: TimeZone -> String
- utc :: TimeZone
- getTimeZone :: UTCTime -> IO TimeZone
- getCurrentTimeZone :: IO TimeZone
- midnight :: TimeOfDay
- midday :: TimeOfDay
- makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay
- timeToDaysAndTimeOfDay :: NominalDiffTime -> (Integer, TimeOfDay)
- daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime
- utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- timeToTimeOfDay :: DiffTime -> TimeOfDay
- pastMidnight :: DiffTime -> TimeOfDay
- timeOfDayToTime :: TimeOfDay -> DiffTime
- sinceMidnight :: TimeOfDay -> DiffTime
- dayFractionToTimeOfDay :: Rational -> TimeOfDay
- timeOfDayToDayFraction :: TimeOfDay -> Rational
- addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime
- diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime
- utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
- localTimeToUTC :: TimeZone -> LocalTime -> UTCTime
- ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime
- localTimeToUT1 :: Rational -> LocalTime -> UniversalTime
- defaultTimeLocale :: TimeLocale
- iso8601DateFormat :: Maybe String -> String
- rfc822DateFormat :: String
- utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
- zonedTimeToUTC :: ZonedTime -> UTCTime
- getZonedTime :: IO ZonedTime
- utcToLocalZonedTime :: UTCTime -> IO ZonedTime
- parseTimeM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
- parseTimeMultipleM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> [(String, String)] -> m t
- parseTimeOrError :: ParseTime t => Bool -> TimeLocale -> String -> String -> t
- readSTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadS t
- readPTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadP t
- prognameandversion :: String
- versionString :: ProgramName -> PackageVersion -> String
- helpflags :: [Flag RawOpts]
- detailedversionflag :: Flag RawOpts
- flattreeflags :: Bool -> [Flag RawOpts]
- hiddenflags :: [Flag RawOpts]
- inputflags :: [Flag RawOpts]
- reportflags :: [Flag RawOpts]
- outputFormatFlag :: [String] -> Flag RawOpts
- outputFileFlag :: Flag RawOpts
- generalflagsgroup1 :: (String, [Flag RawOpts])
- generalflagsgroup2 :: (String, [Flag RawOpts])
- generalflagsgroup3 :: (String, [Flag RawOpts])
- defMode :: Mode RawOpts
- defCommandMode :: [Name] -> Mode RawOpts
- addonCommandMode :: Name -> Mode RawOpts
- hledgerCommandMode :: CommandDoc -> [Flag RawOpts] -> [(String, [Flag RawOpts])] -> [Flag RawOpts] -> ([Arg RawOpts], Maybe (Arg RawOpts)) -> Mode RawOpts
- argsFlag :: FlagHelp -> Arg RawOpts
- showModeUsage :: Mode a -> String
- withAliases :: String -> [String] -> String
- likelyExecutablesInPath :: IO [String]
- hledgerExecutablesInPath :: IO [String]
- ensureDebugHasArg :: (Eq (t Char), IsString (t Char), Foldable t) => [t Char] -> [t Char]
- defcliopts :: CliOpts
- getHledgerCliOpts :: Mode RawOpts -> IO CliOpts
- getHledgerCliOpts' :: Mode RawOpts -> [String] -> IO CliOpts
- rawOptsToCliOpts :: RawOpts -> IO CliOpts
- outputFormats :: [String]
- defaultOutputFormat :: String
- journalFilePathFromOpts :: CliOpts -> IO [String]
- rulesFilePathFromOpts :: CliOpts -> IO (Maybe FilePath)
- outputFileFromOpts :: CliOpts -> IO (Maybe FilePath)
- outputFormatFromOpts :: CliOpts -> String
- defaultWidth :: Int
- replaceNumericFlags :: [String] -> [String]
- registerWidthsFromOpts :: CliOpts -> (Int, Maybe Int)
- hledgerAddons :: IO [String]
- topicForMode :: Mode a -> Topic
- printHelpForTopic :: Tool -> Maybe Topic -> IO ()
- runManForTopic :: Tool -> Maybe Topic -> IO ()
- runInfoForTopic :: Tool -> Maybe Topic -> IO ()
- runPagerForTopic :: Tool -> Maybe Topic -> IO ()
- unsupportedOutputFormatError :: String -> String
- withJournalDo :: CliOpts -> (Journal -> IO a) -> IO a
- writeOutput :: CliOpts -> String -> IO ()
- writeOutputLazyText :: CliOpts -> Text -> IO ()
- journalTransform :: CliOpts -> Journal -> Journal
- journalReload :: CliOpts -> ExceptT String IO Journal
- journalReloadIfChanged :: CliOpts -> Day -> Journal -> ExceptT String IO (Journal, Bool)
- journalFileIsNewer :: Journal -> FilePath -> IO Bool
- openBrowserOn :: String -> IO ExitCode
- writeFileWithBackup :: FilePath -> String -> IO ()
- writeFileWithBackupIfChanged :: FilePath -> Text -> IO Bool
- readFileStrictly :: FilePath -> IO Text
- pivotByOpts :: CliOpts -> Journal -> Journal
- anonymiseByOpts :: CliOpts -> Journal -> Journal
- journalSimilarTransaction :: CliOpts -> Journal -> Text -> Maybe Transaction
- postingsOrTransactionsReportAsText :: Bool -> CliOpts -> (Int -> Int -> (a, [WideBuilder], [WideBuilder]) -> Builder) -> (a -> MixedAmount) -> (a -> MixedAmount) -> [a] -> Builder
- tests_Cli_Utils :: TestTree
- argsToCliOpts :: [String] -> [String] -> IO CliOpts
- packageversion :: PackageVersion
- progname :: ProgramName
- versionStringWith :: Either String GitInfo -> ProgramName -> PackageVersion -> VersionString
- testcmd :: CliOpts -> Journal -> IO ()
- builtinCommands :: [(Mode RawOpts, CliOpts -> Journal -> IO ())]
- builtinCommandNames :: [String]
- findBuiltinCommand :: String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())
- knownAddonCommands :: [String]
- knownCommands :: [String]
- printCommandsList :: String -> [String] -> IO ()
- tests_Hledger_Cli :: TestTree
- accountsmode :: Mode RawOpts
- accounts :: CliOpts -> Journal -> IO ()
- activitymode :: Mode RawOpts
- addmode :: Mode RawOpts
- appendToJournalFileOrStdout :: FilePath -> Text -> IO ()
- journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO Journal
- postingsReportAsText :: CliOpts -> PostingsReport -> Text
- aregistermode :: Mode RawOpts
- aregister :: CliOpts -> Journal -> IO ()
- tests_Aregister :: TestTree
- balancemode :: Mode RawOpts
- balanceReportAsText :: ReportOpts -> BalanceReport -> Builder
- balanceReportAsCsv :: ReportOpts -> BalanceReport -> CSV
- balanceReportItemAsText :: ReportOpts -> BalanceReportItem -> (Builder, [Int])
- multiBalanceRowAsCsvText :: ReportOpts -> [DateSpan] -> PeriodicReportRow a MixedAmount -> [[Text]]
- multiBalanceRowAsTableText :: ReportOpts -> PeriodicReportRow a MixedAmount -> [[WideBuilder]]
- multiBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> Text
- multiBalanceReportAsCsv :: ReportOpts -> MultiBalanceReport -> CSV
- multiBalanceReportAsHtml :: ReportOpts -> MultiBalanceReport -> Html ()
- multiBalanceReportHtmlRows :: ReportOpts -> MultiBalanceReport -> (Html (), [Html ()], [Html ()])
- multiBalanceReportHtmlFootRow :: ReportOpts -> [Text] -> Html ()
- balanceReportAsTable :: ReportOpts -> MultiBalanceReport -> Table Text Text WideBuilder
- tests_Balance :: TestTree
- balancesheetmode :: Mode RawOpts
- balancesheet :: CliOpts -> Journal -> IO ()
- balancesheetequitymode :: Mode RawOpts
- balancesheetequity :: CliOpts -> Journal -> IO ()
- cashflowmode :: Mode RawOpts
- cashflow :: CliOpts -> Journal -> IO ()
- closemode :: Mode RawOpts
- codesmode :: Mode RawOpts
- codes :: CliOpts -> Journal -> IO ()
- commoditiesmode :: Mode RawOpts
- commodities :: CliOpts -> Journal -> IO ()
- demomode :: Mode RawOpts
- demo :: CliOpts -> Journal -> IO ()
- descriptionsmode :: Mode RawOpts
- descriptions :: CliOpts -> Journal -> IO ()
- diffmode :: Mode RawOpts
- helpmode :: Mode RawOpts
- help' :: CliOpts -> Journal -> IO ()
- importmode :: Mode RawOpts
- importcmd :: CliOpts -> Journal -> IO ()
- incomestatementmode :: Mode RawOpts
- incomestatement :: CliOpts -> Journal -> IO ()
- notesmode :: Mode RawOpts
- notes :: CliOpts -> Journal -> IO ()
- payeesmode :: Mode RawOpts
- payees :: CliOpts -> Journal -> IO ()
- pricesmode :: Mode RawOpts
- prices :: CliOpts -> Journal -> IO ()
- printmode :: Mode RawOpts
- print' :: CliOpts -> Journal -> IO ()
- originalTransaction :: Transaction -> Transaction
- registermode :: Mode RawOpts
- register :: CliOpts -> Journal -> IO ()
- postingsReportItemAsText :: CliOpts -> Int -> Int -> (PostingsReportItem, [WideBuilder], [WideBuilder]) -> Builder
- tests_Register :: TestTree
- rewritemode :: Mode RawOpts
- rewrite :: CliOpts -> Journal -> IO ()
- statsmode :: Mode RawOpts
- stats :: CliOpts -> Journal -> IO ()
- tagsmode :: Mode RawOpts
- tags :: CliOpts -> Journal -> IO ()
- barchar :: Char
- activity :: CliOpts -> Journal -> IO ()
- showHistogram :: ReportSpec -> Journal -> String
- printDayWith :: (PrintfArg t1, PrintfType t2) => (t3 -> t1) -> (DateSpan, t3) -> t2
- countBar :: Foldable t => t a -> [Char]

# Documentation

data Char Source #

The character type `Char` is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) code points (i.e. characters, see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type `Char`.

To convert a `Char` to or from the corresponding `Int` value defined by Unicode, use `toEnum` and `fromEnum` from the `Enum` class respectively (or equivalently `ord` and `chr`).

#### Instances

Instances details

FromJSON Char |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser Char Source # parseJSONList :: Value -> Parser [Char] Source #
FromJSONKey Char |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction Char Source # fromJSONKeyList :: FromJSONKeyFunction [Char] Source #
ToJSON Char |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Char -> Value Source # toEncoding :: Char -> Encoding Source # toJSONList :: [Char] -> Value Source # toEncodingList :: [Char] -> Encoding Source #
ToJSONKey Char |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction Char Source # toJSONKeyList :: ToJSONKeyFunction [Char] Source #
Data Char | Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char Source #

toConstr :: Char -> Constr Source #

dataTypeOf :: Char -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) Source #

gmapT :: (forall b. Data b => b -> b) -> Char -> Char Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char Source #

Bounded Char | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Char Source # maxBound :: Char Source #
Enum Char | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Char -> Char Source # pred :: Char -> Char Source # toEnum :: Int -> Char Source # fromEnum :: Char -> Int Source # enumFrom :: Char -> [Char] Source # enumFromThen :: Char -> Char -> [Char] Source # enumFromTo :: Char -> Char -> [Char] Source # enumFromThenTo :: Char -> Char -> Char -> [Char] Source #
Ix Char | Since: base-2.1
Instance details Defined in GHC.Ix Methods range :: (Char, Char) -> [Char] Source # index :: (Char, Char) -> Char -> Int Source # unsafeIndex :: (Char, Char) -> Char -> Int Source # inRange :: (Char, Char) -> Char -> Bool Source # rangeSize :: (Char, Char) -> Int Source # unsafeRangeSize :: (Char, Char) -> Int Source #
Read Char | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Char Source # readList :: ReadS [Char] Source # readPrec :: ReadPrec Char Source # readListPrec :: ReadPrec [Char] Source #
Show Char | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Char -> ShowS Source # show :: Char -> String Source # showList :: [Char] -> ShowS Source #
IsChar Char | Since: base-2.1
Instance details Defined in Text.Printf Methods toChar :: Char -> Char Source # fromChar :: Char -> Char Source #
PrintfArg Char | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Char -> FieldFormatter Source # parseFormat :: Char -> ModifierParser Source #
NFData Char |
Instance details Defined in Control.DeepSeq Methods rnf :: Char -> () Source #
HasChars String |
Instance details Defined in Text.DocLayout Methods foldrChar :: (Char -> b -> b) -> b -> String -> b foldlChar :: (b -> Char -> b) -> b -> String -> b replicateChar :: Int -> Char -> String isNull :: String -> Bool splitLines :: String -> [String]
Eq Char |
Instance details Defined in GHC.Classes Methods (==) :: Char -> Char -> Bool Source # (/=) :: Char -> Char -> Bool Source #
Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering Source # (<) :: Char -> Char -> Bool Source # (<=) :: Char -> Char -> Bool Source # (>) :: Char -> Char -> Bool Source # (>=) :: Char -> Char -> Bool Source # max :: Char -> Char -> Char Source # min :: Char -> Char -> Char Source #
Hashable Char |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Char -> Int Source # hash :: Char -> Int Source #
ToHtml String |
Instance details Defined in Lucid.Base Methods toHtml :: forall (m :: Type -> Type). Monad m => String -> HtmlT m () Source # toHtmlRaw :: forall (m :: Type -> Type). Monad m => String -> HtmlT m () Source #
TraversableStream String |
Instance details Defined in Text.Megaparsec.Stream Methods reachOffset :: Int -> PosState String -> (Maybe String, PosState String) Source # reachOffsetNoLine :: Int -> PosState String -> PosState String Source #
VisualStream String |
Instance details Defined in Text.Megaparsec.Stream Methods showTokens :: Proxy String -> NonEmpty (Token String) -> String Source # tokensLength :: Proxy String -> NonEmpty (Token String) -> Int Source #
Pretty Char |
Instance details Defined in Prettyprinter.Internal Methods pretty :: Char -> Doc ann prettyList :: [Char] -> Doc ann
Uniform Char |
Instance details Defined in System.Random.Internal Methods uniformM :: StatefulGen g m => g -> m Char
UniformRange Char |
Instance details Defined in System.Random.Internal Methods uniformRM :: StatefulGen g m => (Char, Char) -> g -> m Char
Extract String |
Instance details Defined in Text.Regex.Base.RegexLike Methods before :: Int -> String -> String after :: Int -> String -> String empty :: String extract :: (Int, Int) -> String -> String
Assertable String |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assert :: String -> Assertion #
ErrorList Char |
Instance details Defined in Control.Monad.Trans.Error Methods listMsg :: String -> [Char] Source #
Unbox Char |
Instance details Defined in Data.Vector.Unboxed.Base
RegexLike Regexp String |
Instance details Defined in Hledger.Utils.Regex Methods matchOnce :: Regexp -> String -> Maybe MatchArray matchAll :: Regexp -> String -> [MatchArray] matchCount :: Regexp -> String -> Int matchTest :: Regexp -> String -> Bool matchAllText :: Regexp -> String -> [MatchText String] matchOnceText :: Regexp -> String -> Maybe (String, MatchText String, String)
Lift Char |
Instance details Defined in Language.Haskell.TH.Syntax Methods lift :: Quote m => Char -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Char -> Code m Char Source #
Vector Vector Char |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: Mutable Vector s Char -> ST s (Vector Char)

basicUnsafeThaw :: Vector Char -> ST s (Mutable Vector s Char)

basicLength :: Vector Char -> Int

basicUnsafeSlice :: Int -> Int -> Vector Char -> Vector Char

basicUnsafeIndexM :: Vector Char -> Int -> Box Char

basicUnsafeCopy :: Mutable Vector s Char -> Vector Char -> ST s ()

elemseq :: Vector Char -> Char -> b -> b

MVector MVector Char |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s Char -> Int

basicUnsafeSlice :: Int -> Int -> MVector s Char -> MVector s Char

basicOverlaps :: MVector s Char -> MVector s Char -> Bool

basicUnsafeNew :: Int -> ST s (MVector s Char)

basicInitialize :: MVector s Char -> ST s ()

basicUnsafeReplicate :: Int -> Char -> ST s (MVector s Char)

basicUnsafeRead :: MVector s Char -> Int -> ST s Char

basicUnsafeWrite :: MVector s Char -> Int -> Char -> ST s ()

basicClear :: MVector s Char -> ST s ()

basicSet :: MVector s Char -> Char -> ST s ()

basicUnsafeCopy :: MVector s Char -> MVector s Char -> ST s ()

basicUnsafeMove :: MVector s Char -> MVector s Char -> ST s ()

basicUnsafeGrow :: MVector s Char -> Int -> ST s (MVector s Char)

RegexContext Regexp String String |
Instance details Defined in Hledger.Utils.Regex Methods match :: Regexp -> String -> String matchM :: MonadFail m => Regexp -> String -> m String
Generic1 (URec Char :: k -> Type) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Char) :: k -> Type Source # Methods from1 :: forall (a :: k0). URec Char a -> Rep1 (URec Char) a Source # to1 :: forall (a :: k0). Rep1 (URec Char) a -> URec Char a Source #
Foldable (UChar :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UChar m -> m Source #

foldMap :: Monoid m => (a -> m) -> UChar a -> m Source #

foldMap' :: Monoid m => (a -> m) -> UChar a -> m Source #

foldr :: (a -> b -> b) -> b -> UChar a -> b Source #

foldr' :: (a -> b -> b) -> b -> UChar a -> b Source #

foldl :: (b -> a -> b) -> b -> UChar a -> b Source #

foldl' :: (b -> a -> b) -> b -> UChar a -> b Source #

foldr1 :: (a -> a -> a) -> UChar a -> a Source #

foldl1 :: (a -> a -> a) -> UChar a -> a Source #

toList :: UChar a -> [a] Source #

null :: UChar a -> Bool Source #

length :: UChar a -> Int Source #

elem :: Eq a => a -> UChar a -> Bool Source #

maximum :: Ord a => UChar a -> a Source #

minimum :: Ord a => UChar a -> a Source #

sum :: Num a => UChar a -> a Source #

product :: Num a => UChar a -> a Source #

Traversable (UChar :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UChar a -> f (UChar b) Source # sequenceA :: Applicative f => UChar (f a) -> f (UChar a) Source # mapM :: Monad m => (a -> m b) -> UChar a -> m (UChar b) Source # sequence :: Monad m => UChar (m a) -> m (UChar a) Source #
OutputCap [Char] |
Instance details Defined in System.Console.Terminfo.Base Methods hasOkPadding :: [Char] -> String -> Bool outputCap :: ([Int] -> String) -> [Int] -> [Char]
TermStr [Char] |
Instance details Defined in System.Console.Terminfo.Base
Functor (URec Char :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b Source # (<$) :: a -> URec Char b -> URec Char a Source #
Generic (URec Char p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Char p) :: Type -> Type Source # Methods from :: URec Char p -> Rep (URec Char p) x Source # to :: Rep (URec Char p) x -> URec Char p Source #
Show (URec Char p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Char p -> ShowS Source # show :: URec Char p -> String Source # showList :: [URec Char p] -> ShowS Source #
Eq (URec Char p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: URec Char p -> URec Char p -> Bool Source # (/=) :: URec Char p -> URec Char p -> Bool Source #
Ord (URec Char p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Char p -> URec Char p -> Ordering Source #

(<) :: URec Char p -> URec Char p -> Bool Source #

(<=) :: URec Char p -> URec Char p -> Bool Source #

(>) :: URec Char p -> URec Char p -> Bool Source #

(>=) :: URec Char p -> URec Char p -> Bool Source #

max :: URec Char p -> URec Char p -> URec Char p Source #

min :: URec Char p -> URec Char p -> URec Char p Source #

newtype Vector Char |
Instance details Defined in Data.Vector.Unboxed.Base newtype Vector Char = V_Char (Vector Char)
data URec Char (p :: k) | Used for marking occurrences of `Char#` Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Char (p :: k) = UChar {

- uChar# :: Char#

}

newtype MVector s Char |
Instance details Defined in Data.Vector.Unboxed.Base newtype MVector s Char = MV_Char (MVector s Char)
type Rep1 (URec Char :: k -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics type Rep1 (URec Char :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: k -> Type)))
type Rep (URec Char p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics type Rep (URec Char p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: Type -> Type)))

data Ordering Source #

Constructors

LT |
EQ |
GT |

#### Instances

Instances details

FromJSON Ordering |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser Ordering Source # parseJSONList :: Value -> Parser [Ordering] Source #
ToJSON Ordering |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Ordering -> Value Source # toEncoding :: Ordering -> Encoding Source # toJSONList :: [Ordering] -> Value Source # toEncodingList :: [Ordering] -> Encoding Source #
Data Ordering | Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering Source #

toConstr :: Ordering -> Constr Source #

dataTypeOf :: Ordering -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) Source #

gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #

Monoid Ordering | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Ordering Source # mappend :: Ordering -> Ordering -> Ordering Source # mconcat :: [Ordering] -> Ordering Source #
Semigroup Ordering | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Ordering -> Ordering -> Ordering Source # sconcat :: NonEmpty Ordering -> Ordering Source # stimes :: Integral b => b -> Ordering -> Ordering Source #
Bounded Ordering | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Ordering Source # maxBound :: Ordering Source #
Enum Ordering | Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: Ordering -> Ordering Source #

pred :: Ordering -> Ordering Source #

toEnum :: Int -> Ordering Source #

fromEnum :: Ordering -> Int Source #

enumFrom :: Ordering -> [Ordering] Source #

enumFromThen :: Ordering -> Ordering -> [Ordering] Source #

enumFromTo :: Ordering -> Ordering -> [Ordering] Source #

enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering] Source #

Generic Ordering |
Instance details Defined in GHC.Generics Associated Types type Rep Ordering :: Type -> Type Source # Methods from :: Ordering -> Rep Ordering x Source # to :: Rep Ordering x -> Ordering Source #
Ix Ordering | Since: base-2.1
Instance details Defined in GHC.Ix Methods range :: (Ordering, Ordering) -> [Ordering] Source # index :: (Ordering, Ordering) -> Ordering -> Int Source # unsafeIndex :: (Ordering, Ordering) -> Ordering -> Int Source # inRange :: (Ordering, Ordering) -> Ordering -> Bool Source # rangeSize :: (Ordering, Ordering) -> Int Source # unsafeRangeSize :: (Ordering, Ordering) -> Int Source #
Read Ordering | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Ordering Source # readList :: ReadS [Ordering] Source # readPrec :: ReadPrec Ordering Source # readListPrec :: ReadPrec [Ordering] Source #
Show Ordering | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Ordering -> ShowS Source # show :: Ordering -> String Source # showList :: [Ordering] -> ShowS Source #
Default Ordering |
Instance details Defined in Data.Default.Class Methods def :: Ordering #
NFData Ordering |
Instance details Defined in Control.DeepSeq Methods rnf :: Ordering -> () Source #
Eq Ordering |
Instance details Defined in GHC.Classes Methods (==) :: Ordering -> Ordering -> Bool Source # (/=) :: Ordering -> Ordering -> Bool Source #
Ord Ordering |
Instance details Defined in GHC.Classes Methods compare :: Ordering -> Ordering -> Ordering Source # (<) :: Ordering -> Ordering -> Bool Source # (<=) :: Ordering -> Ordering -> Bool Source # (>) :: Ordering -> Ordering -> Bool Source # (>=) :: Ordering -> Ordering -> Bool Source # max :: Ordering -> Ordering -> Ordering Source # min :: Ordering -> Ordering -> Ordering Source #
Hashable Ordering |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Ordering -> Int Source # hash :: Ordering -> Int Source #
type Rep Ordering | Since: base-4.6.0.0
Instance details Defined in GHC.Generics type Rep Ordering = D1 ('MetaData "Ordering" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "LT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EQ" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GT" 'PrefixI 'False) (U1 :: Type -> Type)))

data Maybe a Source #

The `Maybe` type encapsulates an optional value. A value of type ``Maybe` a` either contains a value of type `a` (represented as ``Just` a`), or it is empty (represented as `Nothing`). Using `Maybe` is a good way to deal with errors or exceptional cases without resorting to drastic measures such as `error`.

The `Maybe` type is also a monad. It is a simple kind of error monad, where all errors are represented by `Nothing`. A richer error monad can be built using the `Either` type.

Constructors

Nothing |
Just a |

#### Instances

Instances details

FromJSON1 Maybe |
Instance details Defined in Data.Aeson.Types.FromJSON Methods liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (Maybe a) Source # liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [Maybe a] Source #
ToJSON1 Maybe |
Instance details Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a -> Value) -> ([a] -> Value) -> Maybe a -> Value Source # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Maybe a] -> Value Source # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Maybe a -> Encoding Source # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Maybe a] -> Encoding Source #
MonadFail Maybe | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> Maybe a Source #
Foldable Maybe | Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Maybe m -> m Source #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Maybe a -> m Source #

foldr :: (a -> b -> b) -> b -> Maybe a -> b Source #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b Source #

foldl :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldr1 :: (a -> a -> a) -> Maybe a -> a Source #

foldl1 :: (a -> a -> a) -> Maybe a -> a Source #

toList :: Maybe a -> [a] Source #

null :: Maybe a -> Bool Source #

length :: Maybe a -> Int Source #

elem :: Eq a => a -> Maybe a -> Bool Source #

maximum :: Ord a => Maybe a -> a Source #

minimum :: Ord a => Maybe a -> a Source #

sum :: Num a => Maybe a -> a Source #

product :: Num a => Maybe a -> a Source #

Eq1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool Source #
Ord1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering Source #
Read1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] Source #
Show1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS Source #
Traversable Maybe | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) Source # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) Source # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) Source # sequence :: Monad m => Maybe (m a) -> m (Maybe a) Source #
Alternative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: Maybe a Source # (<|>) :: Maybe a -> Maybe a -> Maybe a Source # some :: Maybe a -> Maybe [a] Source # many :: Maybe a -> Maybe [a] Source #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a Source # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source # (*>) :: Maybe a -> Maybe b -> Maybe b Source # (<*) :: Maybe a -> Maybe b -> Maybe a Source #
Functor Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b Source # (<$) :: a -> Maybe b -> Maybe a Source #
Monad Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b Source # (>>) :: Maybe a -> Maybe b -> Maybe b Source # return :: a -> Maybe a Source #
MonadPlus Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: Maybe a Source # mplus :: Maybe a -> Maybe a -> Maybe a Source #
NFData1 Maybe | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> Maybe a -> () Source #
MonadThrow Maybe |
Instance details Defined in Control.Monad.Catch Methods throwM :: Exception e => e -> Maybe a Source #
Hashable1 Maybe |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> Maybe a -> Int Source #
Generic1 Maybe |
Instance details Defined in GHC.Generics Associated Types type Rep1 Maybe :: k -> Type Source # Methods from1 :: forall (a :: k). Maybe a -> Rep1 Maybe a Source # to1 :: forall (a :: k). Rep1 Maybe a -> Maybe a Source #
Reportable Maybe e |
Instance details Defined in Hledger.Reports.ReportOptions Methods report :: a -> Maybe (Either e a) -> Maybe a
(Selector s, GToJSON' enc arity (K1 i (Maybe a) :: Type -> Type), KeyValuePair enc pairs, Monoid pairs) => RecordToPairs enc pairs arity (S1 s (K1 i (Maybe a) :: Type -> Type)) |
Instance details Defined in Data.Aeson.Types.ToJSON Methods recordToPairs :: Options -> ToArgs enc arity a0 -> S1 s (K1 i (Maybe a)) a0 -> pairs
Lift a => Lift (Maybe a :: Type) |
Instance details Defined in Language.Haskell.TH.Syntax Methods lift :: Quote m => Maybe a -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Maybe a -> Code m (Maybe a) Source #
(Selector s, FromJSON a) => RecordFromJSON' arity (S1 s (K1 i (Maybe a) :: Type -> Type)) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods recordParseJSON' :: (ConName :* (TypeName :* (Options :* FromArgs arity a0))) -> Object -> Parser (S1 s (K1 i (Maybe a)) a0)
FromJSON a => FromJSON (Maybe a) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser (Maybe a) Source # parseJSONList :: Value -> Parser [Maybe a] Source #
ToJSON a => ToJSON (Maybe a) |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Maybe a -> Value Source # toEncoding :: Maybe a -> Encoding Source # toJSONList :: [Maybe a] -> Value Source # toEncodingList :: [Maybe a] -> Encoding Source #
Data a => Data (Maybe a) | Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) Source #

toConstr :: Maybe a -> Constr Source #

dataTypeOf :: Maybe a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source #

Semigroup a => Monoid (Maybe a) | Lift a semigroup into `Maybe` forming a `Monoid` according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup `S` may be turned into a monoid simply by adjoining an element `e` not in `S` and defining `e*e = e` and `e*s = s = s*e` for all `s ∈ S`." Since 4.11.0: constraint on inner `a` value generalised from `Monoid` to `Semigroup`. Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Maybe a Source # mappend :: Maybe a -> Maybe a -> Maybe a Source # mconcat :: [Maybe a] -> Maybe a Source #
Semigroup a => Semigroup (Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Maybe a -> Maybe a -> Maybe a Source # sconcat :: NonEmpty (Maybe a) -> Maybe a Source # stimes :: Integral b => b -> Maybe a -> Maybe a Source #
Generic (Maybe a) |
Instance details Defined in GHC.Generics Associated Types type Rep (Maybe a) :: Type -> Type Source # Methods from :: Maybe a -> Rep (Maybe a) x Source # to :: Rep (Maybe a) x -> Maybe a Source #
SingKind a => SingKind (Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type DemoteRep (Maybe a) Methods fromSing :: forall (a0 :: Maybe a). Sing a0 -> DemoteRep (Maybe a)
Read a => Read (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Maybe a) Source # readList :: ReadS [Maybe a] Source # readPrec :: ReadPrec (Maybe a) Source # readListPrec :: ReadPrec [Maybe a] Source #
Show a => Show (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Maybe a -> ShowS Source # show :: Maybe a -> String Source # showList :: [Maybe a] -> ShowS Source #
Default (Maybe a) |
Instance details Defined in System.Console.CmdArgs.Default Methods def :: Maybe a Source #
Default (Maybe a) |
Instance details Defined in Data.Default.Class Methods def :: Maybe a #
NFData a => NFData (Maybe a) |
Instance details Defined in Control.DeepSeq Methods rnf :: Maybe a -> () Source #
Eq a => Eq (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Maybe Methods (==) :: Maybe a -> Maybe a -> Bool Source # (/=) :: Maybe a -> Maybe a -> Bool Source #
Ord a => Ord (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Maybe Methods compare :: Maybe a -> Maybe a -> Ordering Source # (<) :: Maybe a -> Maybe a -> Bool Source # (<=) :: Maybe a -> Maybe a -> Bool Source # (>) :: Maybe a -> Maybe a -> Bool Source # (>=) :: Maybe a -> Maybe a -> Bool Source # max :: Maybe a -> Maybe a -> Maybe a Source # min :: Maybe a -> Maybe a -> Maybe a Source #
Hashable a => Hashable (Maybe a) |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Maybe a -> Int Source # hash :: Maybe a -> Int Source #
MonoFoldable (Maybe a) |

Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element (Maybe a) -> m) -> Maybe a -> m

ofoldr :: (Element (Maybe a) -> b -> b) -> b -> Maybe a -> b

ofoldl' :: (a0 -> Element (Maybe a) -> a0) -> a0 -> Maybe a -> a0

otoList :: Maybe a -> [Element (Maybe a)]

oall :: (Element (Maybe a) -> Bool) -> Maybe a -> Bool

oany :: (Element (Maybe a) -> Bool) -> Maybe a -> Bool

onull :: Maybe a -> Bool

olength :: Maybe a -> Int

olength64 :: Maybe a -> Int64

ocompareLength :: Integral i => Maybe a -> i -> Ordering

otraverse_ :: Applicative f => (Element (Maybe a) -> f b) -> Maybe a -> f ()

ofor_ :: Applicative f => Maybe a -> (Element (Maybe a) -> f b) -> f ()

omapM_ :: Applicative m => (Element (Maybe a) -> m ()) -> Maybe a -> m ()

oforM_ :: Applicative m => Maybe a -> (Element (Maybe a) -> m ()) -> m ()

ofoldlM :: Monad m => (a0 -> Element (Maybe a) -> m a0) -> a0 -> Maybe a -> m a0

ofoldMap1Ex :: Semigroup m => (Element (Maybe a) -> m) -> Maybe a -> m

ofoldr1Ex :: (Element (Maybe a) -> Element (Maybe a) -> Element (Maybe a)) -> Maybe a -> Element (Maybe a)

ofoldl1Ex' :: (Element (Maybe a) -> Element (Maybe a) -> Element (Maybe a)) -> Maybe a -> Element (Maybe a)

headEx :: Maybe a -> Element (Maybe a)

lastEx :: Maybe a -> Element (Maybe a)

unsafeHead :: Maybe a -> Element (Maybe a)

unsafeLast :: Maybe a -> Element (Maybe a)

maximumByEx :: (Element (Maybe a) -> Element (Maybe a) -> Ordering) -> Maybe a -> Element (Maybe a)

minimumByEx :: (Element (Maybe a) -> Element (Maybe a) -> Ordering) -> Maybe a -> Element (Maybe a)

oelem :: Element (Maybe a) -> Maybe a -> Bool

onotElem :: Element (Maybe a) -> Maybe a -> Bool

MonoFunctor (Maybe a) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (Maybe a) -> Element (Maybe a)) -> Maybe a -> Maybe a
MonoPointed (Maybe a) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (Maybe a) -> Maybe a
MonoTraversable (Maybe a) |
Instance details Defined in Data.MonoTraversable Methods otraverse :: Applicative f => (Element (Maybe a) -> f (Element (Maybe a))) -> Maybe a -> f (Maybe a) omapM :: Applicative m => (Element (Maybe a) -> m (Element (Maybe a))) -> Maybe a -> m (Maybe a)
Pretty a => Pretty (Maybe a) |
Instance details Defined in Prettyprinter.Internal Methods pretty :: Maybe a -> Doc ann prettyList :: [Maybe a] -> Doc ann
SingI ('Nothing :: Maybe a) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods sing :: Sing 'Nothing
Each (Maybe a) (Maybe b) a b |
Instance details Defined in Lens.Micro.Internal Methods each :: Traversal (Maybe a) (Maybe b) a b Source #
SingI a2 => SingI ('Just a2 :: Maybe a1) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods sing :: Sing ('Just a2)
type Rep1 Maybe | Since: base-4.6.0.0
Instance details Defined in GHC.Generics type Rep1 Maybe = D1 ('MetaData "Maybe" "GHC.Maybe" "base" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
type DemoteRep (Maybe a) |
Instance details Defined in GHC.Generics type DemoteRep (Maybe a) = Maybe (DemoteRep a)
type Rep (Maybe a) | Since: base-4.6.0.0
Instance details Defined in GHC.Generics type Rep (Maybe a) = D1 ('MetaData "Maybe" "GHC.Maybe" "base" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
data Sing (b :: Maybe a) |

Instance details

Defined in GHC.Generics

data Sing (b :: Maybe a) where

- SNothing :: forall {a}. Sing ('Nothing :: Maybe a)
- SJust :: forall {a} (a1 :: a). Sing a1 -> Sing ('Just a1)

type Element (Maybe a) |
Instance details Defined in Data.MonoTraversable type Element (Maybe a) = a

type Change Source #

Arguments

= MixedAmount | A change in balance during a certain period.

class Eq a => Ord a where Source #

The `Ord` class is used for totally ordered datatypes.

Instances of `Ord` can be derived for any user-defined datatype whose constituent types are in `Ord`. The declared order of the constructors in the data declaration determines the ordering in derived `Ord` instances. The `Ordering` datatype allows a single comparison to determine the precise ordering of two objects.

`Ord`, as defined by the Haskell report, implements a total order and has the following properties:

Comparability
  `x <= y || y <= x` = `True`
Transitivity
  if `x <= y && y <= z` = `True`, then `x <= z` = `True`
Reflexivity
  `x <= x` = `True`
Antisymmetry
  if `x <= y && y <= x` = `True`, then `x == y` = `True`

The following operator interactions are expected to hold:

1. `x >= y` = `y <= x`
2. `x < y` = `x <= y && x /= y`
3. `x > y` = `y < x`
4. `x < y` = `compare x y == LT`
5. `x > y` = `compare x y == GT`
6. `x == y` = `compare x y == EQ`
7. `min x y == if x <= y then x else y` = `True`
8. `max x y == if x >= y then x else y` = `True`

Note that (7.) and (8.) do not require `min` and `max` to return either of their arguments. The result is merely required to equal one of the arguments in terms of `(==)`.

Minimal complete definition: either `compare` or `<=`. Using `compare` can be more efficient for complex types.

Minimal complete definition

compare | (<=)

Methods

compare :: a -> a -> Ordering Source #

(<) :: a -> a -> Bool infix 4 Source #

(<=) :: a -> a -> Bool infix 4 Source #

(>) :: a -> a -> Bool infix 4 Source #

(>=) :: a -> a -> Bool infix 4 Source #

max :: a -> a -> a Source #

min :: a -> a -> a Source #

#### Instances

Instances details

Ord DL |
Instance details Defined in Data.Algorithm.Diff Methods compare :: DL -> DL -> Ordering Source # (<) :: DL -> DL -> Bool Source # (<=) :: DL -> DL -> Bool Source # (>) :: DL -> DL -> Bool Source # (>=) :: DL -> DL -> Bool Source # max :: DL -> DL -> DL Source # min :: DL -> DL -> DL Source #
Ord DotNetTime |

Instance details

Defined in Data.Aeson.Types.Internal

Methods

compare :: DotNetTime -> DotNetTime -> Ordering Source #

(<) :: DotNetTime -> DotNetTime -> Bool Source #

(<=) :: DotNetTime -> DotNetTime -> Bool Source #

(>) :: DotNetTime -> DotNetTime -> Bool Source #

(>=) :: DotNetTime -> DotNetTime -> Bool Source #

max :: DotNetTime -> DotNetTime -> DotNetTime Source #

min :: DotNetTime -> DotNetTime -> DotNetTime Source #

Ord JSONPathElement |

Instance details

Defined in Data.Aeson.Types.Internal

Methods

compare :: JSONPathElement -> JSONPathElement -> Ordering Source #

(<) :: JSONPathElement -> JSONPathElement -> Bool Source #

(<=) :: JSONPathElement -> JSONPathElement -> Bool Source #

(>) :: JSONPathElement -> JSONPathElement -> Bool Source #

(>=) :: JSONPathElement -> JSONPathElement -> Bool Source #

max :: JSONPathElement -> JSONPathElement -> JSONPathElement Source #

min :: JSONPathElement -> JSONPathElement -> JSONPathElement Source #

Ord Value | The ordering is total, consistent with `Eq` instance. However, nothing else about the ordering is specified, and it may change from environment to environment and version to version of either this package or its dependencies (`hashable` and 'unordered-containers'). Since: aeson-1.5.2.0
Instance details Defined in Data.Aeson.Types.Internal Methods compare :: Value -> Value -> Ordering Source # (<) :: Value -> Value -> Bool Source # (<=) :: Value -> Value -> Bool Source # (>) :: Value -> Value -> Bool Source # (>=) :: Value -> Value -> Bool Source # max :: Value -> Value -> Value Source # min :: Value -> Value -> Value Source #
Ord BlinkSpeed |

Instance details

Defined in System.Console.ANSI.Types

Methods

compare :: BlinkSpeed -> BlinkSpeed -> Ordering Source #

(<) :: BlinkSpeed -> BlinkSpeed -> Bool Source #

(<=) :: BlinkSpeed -> BlinkSpeed -> Bool Source #

(>) :: BlinkSpeed -> BlinkSpeed -> Bool Source #

(>=) :: BlinkSpeed -> BlinkSpeed -> Bool Source #

max :: BlinkSpeed -> BlinkSpeed -> BlinkSpeed Source #

min :: BlinkSpeed -> BlinkSpeed -> BlinkSpeed Source #

Ord Color |
Instance details Defined in System.Console.ANSI.Types Methods compare :: Color -> Color -> Ordering Source # (<) :: Color -> Color -> Bool Source # (<=) :: Color -> Color -> Bool Source # (>) :: Color -> Color -> Bool Source # (>=) :: Color -> Color -> Bool Source # max :: Color -> Color -> Color Source # min :: Color -> Color -> Color Source #
Ord ColorIntensity |

Instance details

Defined in System.Console.ANSI.Types

Methods

compare :: ColorIntensity -> ColorIntensity -> Ordering Source #

(<) :: ColorIntensity -> ColorIntensity -> Bool Source #

(<=) :: ColorIntensity -> ColorIntensity -> Bool Source #

(>) :: ColorIntensity -> ColorIntensity -> Bool Source #

(>=) :: ColorIntensity -> ColorIntensity -> Bool Source #

max :: ColorIntensity -> ColorIntensity -> ColorIntensity Source #

min :: ColorIntensity -> ColorIntensity -> ColorIntensity Source #

Ord ConsoleIntensity |

Instance details

Defined in System.Console.ANSI.Types

Methods

compare :: ConsoleIntensity -> ConsoleIntensity -> Ordering Source #

(<) :: ConsoleIntensity -> ConsoleIntensity -> Bool Source #

(<=) :: ConsoleIntensity -> ConsoleIntensity -> Bool Source #

(>) :: ConsoleIntensity -> ConsoleIntensity -> Bool Source #

(>=) :: ConsoleIntensity -> ConsoleIntensity -> Bool Source #

max :: ConsoleIntensity -> ConsoleIntensity -> ConsoleIntensity Source #

min :: ConsoleIntensity -> ConsoleIntensity -> ConsoleIntensity Source #

Ord ConsoleLayer |

Instance details

Defined in System.Console.ANSI.Types

Methods

compare :: ConsoleLayer -> ConsoleLayer -> Ordering Source #

(<) :: ConsoleLayer -> ConsoleLayer -> Bool Source #

(<=) :: ConsoleLayer -> ConsoleLayer -> Bool Source #

(>) :: ConsoleLayer -> ConsoleLayer -> Bool Source #

(>=) :: ConsoleLayer -> ConsoleLayer -> Bool Source #

max :: ConsoleLayer -> ConsoleLayer -> ConsoleLayer Source #

min :: ConsoleLayer -> ConsoleLayer -> ConsoleLayer Source #

Ord Underlining |

Instance details

Defined in System.Console.ANSI.Types

Methods

compare :: Underlining -> Underlining -> Ordering Source #

(<) :: Underlining -> Underlining -> Bool Source #

(<=) :: Underlining -> Underlining -> Bool Source #

(>) :: Underlining -> Underlining -> Bool Source #

(>=) :: Underlining -> Underlining -> Bool Source #

max :: Underlining -> Underlining -> Underlining Source #

min :: Underlining -> Underlining -> Underlining Source #

Ord Pos |
Instance details Defined in Data.Attoparsec.Internal.Types Methods compare :: Pos -> Pos -> Ordering Source # (<) :: Pos -> Pos -> Bool Source # (<=) :: Pos -> Pos -> Bool Source # (>) :: Pos -> Pos -> Bool Source # (>=) :: Pos -> Pos -> Bool Source # max :: Pos -> Pos -> Pos Source # min :: Pos -> Pos -> Pos Source #
Ord ByteArray | Non-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions. @since 4.17.0.0
Instance details Defined in Data.Array.Byte Methods compare :: ByteArray -> ByteArray -> Ordering Source # (<) :: ByteArray -> ByteArray -> Bool Source # (<=) :: ByteArray -> ByteArray -> Bool Source # (>) :: ByteArray -> ByteArray -> Bool Source # (>=) :: ByteArray -> ByteArray -> Bool Source # max :: ByteArray -> ByteArray -> ByteArray Source # min :: ByteArray -> ByteArray -> ByteArray Source #
Ord All | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods compare :: All -> All -> Ordering Source # (<) :: All -> All -> Bool Source # (<=) :: All -> All -> Bool Source # (>) :: All -> All -> Bool Source # (>=) :: All -> All -> Bool Source # max :: All -> All -> All Source # min :: All -> All -> All Source #
Ord Any | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods compare :: Any -> Any -> Ordering Source # (<) :: Any -> Any -> Bool Source # (<=) :: Any -> Any -> Bool Source # (>) :: Any -> Any -> Bool Source # (>=) :: Any -> Any -> Bool Source # max :: Any -> Any -> Any Source # min :: Any -> Any -> Any Source #
Ord SomeTypeRep |

Instance details

Defined in Data.Typeable.Internal

Methods

compare :: SomeTypeRep -> SomeTypeRep -> Ordering Source #

(<) :: SomeTypeRep -> SomeTypeRep -> Bool Source #

(<=) :: SomeTypeRep -> SomeTypeRep -> Bool Source #

(>) :: SomeTypeRep -> SomeTypeRep -> Bool Source #

(>=) :: SomeTypeRep -> SomeTypeRep -> Bool Source #

max :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep Source #

min :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep Source #

Ord Version | Since: base-2.1
Instance details Defined in Data.Version Methods compare :: Version -> Version -> Ordering Source # (<) :: Version -> Version -> Bool Source # (<=) :: Version -> Version -> Bool Source # (>) :: Version -> Version -> Bool Source # (>=) :: Version -> Version -> Bool Source # max :: Version -> Version -> Version Source # min :: Version -> Version -> Version Source #
Ord Void | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods compare :: Void -> Void -> Ordering Source # (<) :: Void -> Void -> Bool Source # (<=) :: Void -> Void -> Bool Source # (>) :: Void -> Void -> Bool Source # (>=) :: Void -> Void -> Bool Source # max :: Void -> Void -> Void Source # min :: Void -> Void -> Void Source #
Ord BlockReason | Since: base-4.3.0.0

Instance details

Defined in GHC.Conc.Sync

Methods

compare :: BlockReason -> BlockReason -> Ordering Source #

(<) :: BlockReason -> BlockReason -> Bool Source #

(<=) :: BlockReason -> BlockReason -> Bool Source #

(>) :: BlockReason -> BlockReason -> Bool Source #

(>=) :: BlockReason -> BlockReason -> Bool Source #

max :: BlockReason -> BlockReason -> BlockReason Source #

min :: BlockReason -> BlockReason -> BlockReason Source #

Ord ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadId -> ThreadId -> Ordering Source # (<) :: ThreadId -> ThreadId -> Bool Source # (<=) :: ThreadId -> ThreadId -> Bool Source # (>) :: ThreadId -> ThreadId -> Bool Source # (>=) :: ThreadId -> ThreadId -> Bool Source # max :: ThreadId -> ThreadId -> ThreadId Source # min :: ThreadId -> ThreadId -> ThreadId Source #
Ord ThreadStatus | Since: base-4.3.0.0

Instance details

Defined in GHC.Conc.Sync

Methods

compare :: ThreadStatus -> ThreadStatus -> Ordering Source #

(<) :: ThreadStatus -> ThreadStatus -> Bool Source #

(<=) :: ThreadStatus -> ThreadStatus -> Bool Source #

(>) :: ThreadStatus -> ThreadStatus -> Bool Source #

(>=) :: ThreadStatus -> ThreadStatus -> Bool Source #

max :: ThreadStatus -> ThreadStatus -> ThreadStatus Source #

min :: ThreadStatus -> ThreadStatus -> ThreadStatus Source #

Ord ErrorCall | Since: base-4.7.0.0
Instance details Defined in GHC.Exception Methods compare :: ErrorCall -> ErrorCall -> Ordering Source # (<) :: ErrorCall -> ErrorCall -> Bool Source # (<=) :: ErrorCall -> ErrorCall -> Bool Source # (>) :: ErrorCall -> ErrorCall -> Bool Source # (>=) :: ErrorCall -> ErrorCall -> Bool Source # max :: ErrorCall -> ErrorCall -> ErrorCall Source # min :: ErrorCall -> ErrorCall -> ErrorCall Source #
Ord ArithException | Since: base-3.0

Instance details

Defined in GHC.Exception.Type

Methods

compare :: ArithException -> ArithException -> Ordering Source #

(<) :: ArithException -> ArithException -> Bool Source #

(<=) :: ArithException -> ArithException -> Bool Source #

(>) :: ArithException -> ArithException -> Bool Source #

(>=) :: ArithException -> ArithException -> Bool Source #

max :: ArithException -> ArithException -> ArithException Source #

min :: ArithException -> ArithException -> ArithException Source #

Ord Associativity | Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: Associativity -> Associativity -> Ordering Source #

(<) :: Associativity -> Associativity -> Bool Source #

(<=) :: Associativity -> Associativity -> Bool Source #

(>) :: Associativity -> Associativity -> Bool Source #

(>=) :: Associativity -> Associativity -> Bool Source #

max :: Associativity -> Associativity -> Associativity Source #

min :: Associativity -> Associativity -> Associativity Source #

Ord DecidedStrictness | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: DecidedStrictness -> DecidedStrictness -> Ordering Source #

(<) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

(<=) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

(>) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

(>=) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source #

min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source #

Ord Fixity | Since: base-4.6.0.0
Instance details Defined in GHC.Generics Methods compare :: Fixity -> Fixity -> Ordering Source # (<) :: Fixity -> Fixity -> Bool Source # (<=) :: Fixity -> Fixity -> Bool Source # (>) :: Fixity -> Fixity -> Bool Source # (>=) :: Fixity -> Fixity -> Bool Source # max :: Fixity -> Fixity -> Fixity Source # min :: Fixity -> Fixity -> Fixity Source #
Ord SourceStrictness | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: SourceStrictness -> SourceStrictness -> Ordering Source #

(<) :: SourceStrictness -> SourceStrictness -> Bool Source #

(<=) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>=) :: SourceStrictness -> SourceStrictness -> Bool Source #

max :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

min :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

Ord SourceUnpackedness | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering Source #

(<) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

Ord SeekMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Device Methods compare :: SeekMode -> SeekMode -> Ordering Source # (<) :: SeekMode -> SeekMode -> Bool Source # (<=) :: SeekMode -> SeekMode -> Bool Source # (>) :: SeekMode -> SeekMode -> Bool Source # (>=) :: SeekMode -> SeekMode -> Bool Source # max :: SeekMode -> SeekMode -> SeekMode Source # min :: SeekMode -> SeekMode -> SeekMode Source #
Ord ArrayException | Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Exception

Methods

compare :: ArrayException -> ArrayException -> Ordering Source #

(<) :: ArrayException -> ArrayException -> Bool Source #

(<=) :: ArrayException -> ArrayException -> Bool Source #

(>) :: ArrayException -> ArrayException -> Bool Source #

(>=) :: ArrayException -> ArrayException -> Bool Source #

max :: ArrayException -> ArrayException -> ArrayException Source #

min :: ArrayException -> ArrayException -> ArrayException Source #

Ord AsyncException | Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Exception

Methods

compare :: AsyncException -> AsyncException -> Ordering Source #

(<) :: AsyncException -> AsyncException -> Bool Source #

(<=) :: AsyncException -> AsyncException -> Bool Source #

(>) :: AsyncException -> AsyncException -> Bool Source #

(>=) :: AsyncException -> AsyncException -> Bool Source #

max :: AsyncException -> AsyncException -> AsyncException Source #

min :: AsyncException -> AsyncException -> AsyncException Source #

Ord ExitCode |
Instance details Defined in GHC.IO.Exception Methods compare :: ExitCode -> ExitCode -> Ordering Source # (<) :: ExitCode -> ExitCode -> Bool Source # (<=) :: ExitCode -> ExitCode -> Bool Source # (>) :: ExitCode -> ExitCode -> Bool Source # (>=) :: ExitCode -> ExitCode -> Bool Source # max :: ExitCode -> ExitCode -> ExitCode Source # min :: ExitCode -> ExitCode -> ExitCode Source #
Ord BufferMode | Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

compare :: BufferMode -> BufferMode -> Ordering Source #

(<) :: BufferMode -> BufferMode -> Bool Source #

(<=) :: BufferMode -> BufferMode -> Bool Source #

(>) :: BufferMode -> BufferMode -> Bool Source #

(>=) :: BufferMode -> BufferMode -> Bool Source #

max :: BufferMode -> BufferMode -> BufferMode Source #

min :: BufferMode -> BufferMode -> BufferMode Source #

Ord Newline | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Handle.Types Methods compare :: Newline -> Newline -> Ordering Source # (<) :: Newline -> Newline -> Bool Source # (<=) :: Newline -> Newline -> Bool Source # (>) :: Newline -> Newline -> Bool Source # (>=) :: Newline -> Newline -> Bool Source # max :: Newline -> Newline -> Newline Source # min :: Newline -> Newline -> Newline Source #
Ord NewlineMode | Since: base-4.3.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

compare :: NewlineMode -> NewlineMode -> Ordering Source #

(<) :: NewlineMode -> NewlineMode -> Bool Source #

(<=) :: NewlineMode -> NewlineMode -> Bool Source #

(>) :: NewlineMode -> NewlineMode -> Bool Source #

(>=) :: NewlineMode -> NewlineMode -> Bool Source #

max :: NewlineMode -> NewlineMode -> NewlineMode Source #

min :: NewlineMode -> NewlineMode -> NewlineMode Source #

Ord IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods compare :: IOMode -> IOMode -> Ordering Source # (<) :: IOMode -> IOMode -> Bool Source # (<=) :: IOMode -> IOMode -> Bool Source # (>) :: IOMode -> IOMode -> Bool Source # (>=) :: IOMode -> IOMode -> Bool Source # max :: IOMode -> IOMode -> IOMode Source # min :: IOMode -> IOMode -> IOMode Source #
Ord GeneralCategory | Since: base-2.1

Instance details

Defined in GHC.Unicode

Methods

compare :: GeneralCategory -> GeneralCategory -> Ordering Source #

(<) :: GeneralCategory -> GeneralCategory -> Bool Source #

(<=) :: GeneralCategory -> GeneralCategory -> Bool Source #

(>) :: GeneralCategory -> GeneralCategory -> Bool Source #

(>=) :: GeneralCategory -> GeneralCategory -> Bool Source #

max :: GeneralCategory -> GeneralCategory -> GeneralCategory Source #

min :: GeneralCategory -> GeneralCategory -> GeneralCategory Source #

Ord Word16 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word16 -> Word16 -> Ordering Source # (<) :: Word16 -> Word16 -> Bool Source # (<=) :: Word16 -> Word16 -> Bool Source # (>) :: Word16 -> Word16 -> Bool Source # (>=) :: Word16 -> Word16 -> Bool Source # max :: Word16 -> Word16 -> Word16 Source # min :: Word16 -> Word16 -> Word16 Source #
Ord Word32 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word32 -> Word32 -> Ordering Source # (<) :: Word32 -> Word32 -> Bool Source # (<=) :: Word32 -> Word32 -> Bool Source # (>) :: Word32 -> Word32 -> Bool Source # (>=) :: Word32 -> Word32 -> Bool Source # max :: Word32 -> Word32 -> Word32 Source # min :: Word32 -> Word32 -> Word32 Source #
Ord Word64 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word64 -> Word64 -> Ordering Source # (<) :: Word64 -> Word64 -> Bool Source # (<=) :: Word64 -> Word64 -> Bool Source # (>) :: Word64 -> Word64 -> Bool Source # (>=) :: Word64 -> Word64 -> Bool Source # max :: Word64 -> Word64 -> Word64 Source # min :: Word64 -> Word64 -> Word64 Source #
Ord Word8 | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word8 -> Word8 -> Ordering Source # (<) :: Word8 -> Word8 -> Bool Source # (<=) :: Word8 -> Word8 -> Bool Source # (>) :: Word8 -> Word8 -> Bool Source # (>=) :: Word8 -> Word8 -> Bool Source # max :: Word8 -> Word8 -> Word8 Source # min :: Word8 -> Word8 -> Word8 Source #
Ord CBlkCnt |
Instance details Defined in System.Posix.Types Methods compare :: CBlkCnt -> CBlkCnt -> Ordering Source # (<) :: CBlkCnt -> CBlkCnt -> Bool Source # (<=) :: CBlkCnt -> CBlkCnt -> Bool Source # (>) :: CBlkCnt -> CBlkCnt -> Bool Source # (>=) :: CBlkCnt -> CBlkCnt -> Bool Source # max :: CBlkCnt -> CBlkCnt -> CBlkCnt Source # min :: CBlkCnt -> CBlkCnt -> CBlkCnt Source #
Ord CBlkSize |
Instance details Defined in System.Posix.Types Methods compare :: CBlkSize -> CBlkSize -> Ordering Source # (<) :: CBlkSize -> CBlkSize -> Bool Source # (<=) :: CBlkSize -> CBlkSize -> Bool Source # (>) :: CBlkSize -> CBlkSize -> Bool Source # (>=) :: CBlkSize -> CBlkSize -> Bool Source # max :: CBlkSize -> CBlkSize -> CBlkSize Source # min :: CBlkSize -> CBlkSize -> CBlkSize Source #
Ord CCc |
Instance details Defined in System.Posix.Types Methods compare :: CCc -> CCc -> Ordering Source # (<) :: CCc -> CCc -> Bool Source # (<=) :: CCc -> CCc -> Bool Source # (>) :: CCc -> CCc -> Bool Source # (>=) :: CCc -> CCc -> Bool Source # max :: CCc -> CCc -> CCc Source # min :: CCc -> CCc -> CCc Source #
Ord CClockId |
Instance details Defined in System.Posix.Types Methods compare :: CClockId -> CClockId -> Ordering Source # (<) :: CClockId -> CClockId -> Bool Source # (<=) :: CClockId -> CClockId -> Bool Source # (>) :: CClockId -> CClockId -> Bool Source # (>=) :: CClockId -> CClockId -> Bool Source # max :: CClockId -> CClockId -> CClockId Source # min :: CClockId -> CClockId -> CClockId Source #
Ord CDev |
Instance details Defined in System.Posix.Types Methods compare :: CDev -> CDev -> Ordering Source # (<) :: CDev -> CDev -> Bool Source # (<=) :: CDev -> CDev -> Bool Source # (>) :: CDev -> CDev -> Bool Source # (>=) :: CDev -> CDev -> Bool Source # max :: CDev -> CDev -> CDev Source # min :: CDev -> CDev -> CDev Source #
Ord CFsBlkCnt |

Instance details

Defined in System.Posix.Types

Methods

compare :: CFsBlkCnt -> CFsBlkCnt -> Ordering Source #

(<) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source #

(<=) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source #

(>) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source #

(>=) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source #

max :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt Source #

min :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt Source #

Ord CFsFilCnt |

Instance details

Defined in System.Posix.Types

Methods

compare :: CFsFilCnt -> CFsFilCnt -> Ordering Source #

(<) :: CFsFilCnt -> CFsFilCnt -> Bool Source #

(<=) :: CFsFilCnt -> CFsFilCnt -> Bool Source #

(>) :: CFsFilCnt -> CFsFilCnt -> Bool Source #

(>=) :: CFsFilCnt -> CFsFilCnt -> Bool Source #

max :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt Source #

min :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt Source #

Ord CGid |
Instance details Defined in System.Posix.Types Methods compare :: CGid -> CGid -> Ordering Source # (<) :: CGid -> CGid -> Bool Source # (<=) :: CGid -> CGid -> Bool Source # (>) :: CGid -> CGid -> Bool Source # (>=) :: CGid -> CGid -> Bool Source # max :: CGid -> CGid -> CGid Source # min :: CGid -> CGid -> CGid Source #
Ord CId |
Instance details Defined in System.Posix.Types Methods compare :: CId -> CId -> Ordering Source # (<) :: CId -> CId -> Bool Source # (<=) :: CId -> CId -> Bool Source # (>) :: CId -> CId -> Bool Source # (>=) :: CId -> CId -> Bool Source # max :: CId -> CId -> CId Source # min :: CId -> CId -> CId Source #
Ord CIno |
Instance details Defined in System.Posix.Types Methods compare :: CIno -> CIno -> Ordering Source # (<) :: CIno -> CIno -> Bool Source # (<=) :: CIno -> CIno -> Bool Source # (>) :: CIno -> CIno -> Bool Source # (>=) :: CIno -> CIno -> Bool Source # max :: CIno -> CIno -> CIno Source # min :: CIno -> CIno -> CIno Source #
Ord CKey |
Instance details Defined in System.Posix.Types Methods compare :: CKey -> CKey -> Ordering Source # (<) :: CKey -> CKey -> Bool Source # (<=) :: CKey -> CKey -> Bool Source # (>) :: CKey -> CKey -> Bool Source # (>=) :: CKey -> CKey -> Bool Source # max :: CKey -> CKey -> CKey Source # min :: CKey -> CKey -> CKey Source #
Ord CMode |
Instance details Defined in System.Posix.Types Methods compare :: CMode -> CMode -> Ordering Source # (<) :: CMode -> CMode -> Bool Source # (<=) :: CMode -> CMode -> Bool Source # (>) :: CMode -> CMode -> Bool Source # (>=) :: CMode -> CMode -> Bool Source # max :: CMode -> CMode -> CMode Source # min :: CMode -> CMode -> CMode Source #
Ord CNfds |
Instance details Defined in System.Posix.Types Methods compare :: CNfds -> CNfds -> Ordering Source # (<) :: CNfds -> CNfds -> Bool Source # (<=) :: CNfds -> CNfds -> Bool Source # (>) :: CNfds -> CNfds -> Bool Source # (>=) :: CNfds -> CNfds -> Bool Source # max :: CNfds -> CNfds -> CNfds Source # min :: CNfds -> CNfds -> CNfds Source #
Ord CNlink |
Instance details Defined in System.Posix.Types Methods compare :: CNlink -> CNlink -> Ordering Source # (<) :: CNlink -> CNlink -> Bool Source # (<=) :: CNlink -> CNlink -> Bool Source # (>) :: CNlink -> CNlink -> Bool Source # (>=) :: CNlink -> CNlink -> Bool Source # max :: CNlink -> CNlink -> CNlink Source # min :: CNlink -> CNlink -> CNlink Source #
Ord COff |
Instance details Defined in System.Posix.Types Methods compare :: COff -> COff -> Ordering Source # (<) :: COff -> COff -> Bool Source # (<=) :: COff -> COff -> Bool Source # (>) :: COff -> COff -> Bool Source # (>=) :: COff -> COff -> Bool Source # max :: COff -> COff -> COff Source # min :: COff -> COff -> COff Source #
Ord CPid |
Instance details Defined in System.Posix.Types Methods compare :: CPid -> CPid -> Ordering Source # (<) :: CPid -> CPid -> Bool Source # (<=) :: CPid -> CPid -> Bool Source # (>) :: CPid -> CPid -> Bool Source # (>=) :: CPid -> CPid -> Bool Source # max :: CPid -> CPid -> CPid Source # min :: CPid -> CPid -> CPid Source #
Ord CRLim |
Instance details Defined in System.Posix.Types Methods compare :: CRLim -> CRLim -> Ordering Source # (<) :: CRLim -> CRLim -> Bool Source # (<=) :: CRLim -> CRLim -> Bool Source # (>) :: CRLim -> CRLim -> Bool Source # (>=) :: CRLim -> CRLim -> Bool Source # max :: CRLim -> CRLim -> CRLim Source # min :: CRLim -> CRLim -> CRLim Source #
Ord CSocklen |
Instance details Defined in System.Posix.Types Methods compare :: CSocklen -> CSocklen -> Ordering Source # (<) :: CSocklen -> CSocklen -> Bool Source # (<=) :: CSocklen -> CSocklen -> Bool Source # (>) :: CSocklen -> CSocklen -> Bool Source # (>=) :: CSocklen -> CSocklen -> Bool Source # max :: CSocklen -> CSocklen -> CSocklen Source # min :: CSocklen -> CSocklen -> CSocklen Source #
Ord CSpeed |
Instance details Defined in System.Posix.Types Methods compare :: CSpeed -> CSpeed -> Ordering Source # (<) :: CSpeed -> CSpeed -> Bool Source # (<=) :: CSpeed -> CSpeed -> Bool Source # (>) :: CSpeed -> CSpeed -> Bool Source # (>=) :: CSpeed -> CSpeed -> Bool Source # max :: CSpeed -> CSpeed -> CSpeed Source # min :: CSpeed -> CSpeed -> CSpeed Source #
Ord CSsize |
Instance details Defined in System.Posix.Types Methods compare :: CSsize -> CSsize -> Ordering Source # (<) :: CSsize -> CSsize -> Bool Source # (<=) :: CSsize -> CSsize -> Bool Source # (>) :: CSsize -> CSsize -> Bool Source # (>=) :: CSsize -> CSsize -> Bool Source # max :: CSsize -> CSsize -> CSsize Source # min :: CSsize -> CSsize -> CSsize Source #
Ord CTcflag |
Instance details Defined in System.Posix.Types Methods compare :: CTcflag -> CTcflag -> Ordering Source # (<) :: CTcflag -> CTcflag -> Bool Source # (<=) :: CTcflag -> CTcflag -> Bool Source # (>) :: CTcflag -> CTcflag -> Bool Source # (>=) :: CTcflag -> CTcflag -> Bool Source # max :: CTcflag -> CTcflag -> CTcflag Source # min :: CTcflag -> CTcflag -> CTcflag Source #
Ord CTimer |
Instance details Defined in System.Posix.Types Methods compare :: CTimer -> CTimer -> Ordering Source # (<) :: CTimer -> CTimer -> Bool Source # (<=) :: CTimer -> CTimer -> Bool Source # (>) :: CTimer -> CTimer -> Bool Source # (>=) :: CTimer -> CTimer -> Bool Source # max :: CTimer -> CTimer -> CTimer Source # min :: CTimer -> CTimer -> CTimer Source #
Ord CUid |
Instance details Defined in System.Posix.Types Methods compare :: CUid -> CUid -> Ordering Source # (<) :: CUid -> CUid -> Bool Source # (<=) :: CUid -> CUid -> Bool Source # (>) :: CUid -> CUid -> Bool Source # (>=) :: CUid -> CUid -> Bool Source # max :: CUid -> CUid -> CUid Source # min :: CUid -> CUid -> CUid Source #
Ord Fd |
Instance details Defined in System.Posix.Types Methods compare :: Fd -> Fd -> Ordering Source # (<) :: Fd -> Fd -> Bool Source # (<=) :: Fd -> Fd -> Bool Source # (>) :: Fd -> Fd -> Bool Source # (>=) :: Fd -> Fd -> Bool Source # max :: Fd -> Fd -> Fd Source # min :: Fd -> Fd -> Fd Source #
Ord ByteString |

Instance details

Defined in Data.ByteString.Internal.Type

Methods

compare :: ByteString -> ByteString -> Ordering Source #

(<) :: ByteString -> ByteString -> Bool Source #

(<=) :: ByteString -> ByteString -> Bool Source #

(>) :: ByteString -> ByteString -> Bool Source #

(>=) :: ByteString -> ByteString -> Bool Source #

max :: ByteString -> ByteString -> ByteString Source #

min :: ByteString -> ByteString -> ByteString Source #

Ord ByteString |

Instance details

Defined in Data.ByteString.Lazy.Internal

Methods

compare :: ByteString -> ByteString -> Ordering Source #

(<) :: ByteString -> ByteString -> Bool Source #

(<=) :: ByteString -> ByteString -> Bool Source #

(>) :: ByteString -> ByteString -> Bool Source #

(>=) :: ByteString -> ByteString -> Bool Source #

max :: ByteString -> ByteString -> ByteString Source #

min :: ByteString -> ByteString -> ByteString Source #

Ord ShortByteString |

Instance details

Defined in Data.ByteString.Short.Internal

Methods

compare :: ShortByteString -> ShortByteString -> Ordering Source #

(<) :: ShortByteString -> ShortByteString -> Bool Source #

(<=) :: ShortByteString -> ShortByteString -> Bool Source #

(>) :: ShortByteString -> ShortByteString -> Bool Source #

(>=) :: ShortByteString -> ShortByteString -> Bool Source #

max :: ShortByteString -> ShortByteString -> ShortByteString Source #

min :: ShortByteString -> ShortByteString -> ShortByteString Source #

Ord Complete |

Instance details

Defined in System.Console.CmdArgs.Explicit.Complete

Methods

compare :: Complete -> Complete -> Ordering Source #

(<) :: Complete -> Complete -> Bool Source #

(<=) :: Complete -> Complete -> Bool Source #

(>) :: Complete -> Complete -> Bool Source #

(>=) :: Complete -> Complete -> Bool Source #

max :: Complete -> Complete -> Complete Source #

min :: Complete -> Complete -> Complete Source #

Ord HelpFormat |

Instance details

Defined in System.Console.CmdArgs.Explicit.Help

Methods

compare :: HelpFormat -> HelpFormat -> Ordering Source #

(<) :: HelpFormat -> HelpFormat -> Bool Source #

(<=) :: HelpFormat -> HelpFormat -> Bool Source #

(>) :: HelpFormat -> HelpFormat -> Bool Source #

(>=) :: HelpFormat -> HelpFormat -> Bool Source #

max :: HelpFormat -> HelpFormat -> HelpFormat Source #

min :: HelpFormat -> HelpFormat -> HelpFormat Source #

Ord FlagInfo |

Instance details

Defined in System.Console.CmdArgs.Explicit.Type

Methods

compare :: FlagInfo -> FlagInfo -> Ordering Source #

(<) :: FlagInfo -> FlagInfo -> Bool Source #

(<=) :: FlagInfo -> FlagInfo -> Bool Source #

(>) :: FlagInfo -> FlagInfo -> Bool Source #

(>=) :: FlagInfo -> FlagInfo -> Bool Source #

max :: FlagInfo -> FlagInfo -> FlagInfo Source #

min :: FlagInfo -> FlagInfo -> FlagInfo Source #

Ord Ann |
Instance details Defined in System.Console.CmdArgs.Implicit.Ann Methods compare :: Ann -> Ann -> Ordering Source # (<) :: Ann -> Ann -> Bool Source # (<=) :: Ann -> Ann -> Bool Source # (>) :: Ann -> Ann -> Bool Source # (>=) :: Ann -> Ann -> Bool Source # max :: Ann -> Ann -> Ann Source # min :: Ann -> Ann -> Ann Source #
Ord CmdArgsPrivate |

Instance details

Defined in System.Console.CmdArgs.Implicit.Type

Methods

compare :: CmdArgsPrivate -> CmdArgsPrivate -> Ordering Source #

(<) :: CmdArgsPrivate -> CmdArgsPrivate -> Bool Source #

(<=) :: CmdArgsPrivate -> CmdArgsPrivate -> Bool Source #

(>) :: CmdArgsPrivate -> CmdArgsPrivate -> Bool Source #

(>=) :: CmdArgsPrivate -> CmdArgsPrivate -> Bool Source #

max :: CmdArgsPrivate -> CmdArgsPrivate -> CmdArgsPrivate Source #

min :: CmdArgsPrivate -> CmdArgsPrivate -> CmdArgsPrivate Source #

Ord TextFormat |

Instance details

Defined in System.Console.CmdArgs.Text

Methods

compare :: TextFormat -> TextFormat -> Ordering Source #

(<) :: TextFormat -> TextFormat -> Bool Source #

(<=) :: TextFormat -> TextFormat -> Bool Source #

(>) :: TextFormat -> TextFormat -> Bool Source #

(>=) :: TextFormat -> TextFormat -> Bool Source #

max :: TextFormat -> TextFormat -> TextFormat Source #

min :: TextFormat -> TextFormat -> TextFormat Source #

Ord Verbosity |

Instance details

Defined in System.Console.CmdArgs.Verbosity

Methods

compare :: Verbosity -> Verbosity -> Ordering Source #

(<) :: Verbosity -> Verbosity -> Bool Source #

(<=) :: Verbosity -> Verbosity -> Bool Source #

(>) :: Verbosity -> Verbosity -> Bool Source #

(>=) :: Verbosity -> Verbosity -> Bool Source #

max :: Verbosity -> Verbosity -> Verbosity Source #

min :: Verbosity -> Verbosity -> Verbosity Source #

Ord IntSet |
Instance details Defined in Data.IntSet.Internal Methods compare :: IntSet -> IntSet -> Ordering Source # (<) :: IntSet -> IntSet -> Bool Source # (<=) :: IntSet -> IntSet -> Bool Source # (>) :: IntSet -> IntSet -> Bool Source # (>=) :: IntSet -> IntSet -> Bool Source # max :: IntSet -> IntSet -> IntSet Source # min :: IntSet -> IntSet -> IntSet Source #
Ord FileType |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: FileType -> FileType -> Ordering Source #

(<) :: FileType -> FileType -> Bool Source #

(<=) :: FileType -> FileType -> Bool Source #

(>) :: FileType -> FileType -> Bool Source #

(>=) :: FileType -> FileType -> Bool Source #

max :: FileType -> FileType -> FileType Source #

min :: FileType -> FileType -> FileType Source #

Ord Permissions |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: Permissions -> Permissions -> Ordering Source #

(<) :: Permissions -> Permissions -> Bool Source #

(<=) :: Permissions -> Permissions -> Bool Source #

(>) :: Permissions -> Permissions -> Bool Source #

(>=) :: Permissions -> Permissions -> Bool Source #

max :: Permissions -> Permissions -> Permissions Source #

min :: Permissions -> Permissions -> Permissions Source #

Ord XdgDirectory |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectory -> XdgDirectory -> Ordering Source #

(<) :: XdgDirectory -> XdgDirectory -> Bool Source #

(<=) :: XdgDirectory -> XdgDirectory -> Bool Source #

(>) :: XdgDirectory -> XdgDirectory -> Bool Source #

(>=) :: XdgDirectory -> XdgDirectory -> Bool Source #

max :: XdgDirectory -> XdgDirectory -> XdgDirectory Source #

min :: XdgDirectory -> XdgDirectory -> XdgDirectory Source #

Ord XdgDirectoryList |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectoryList -> XdgDirectoryList -> Ordering Source #

(<) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

(<=) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

(>) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

(>=) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

max :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList Source #

min :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList Source #

Ord BigNat |
Instance details Defined in GHC.Num.BigNat Methods compare :: BigNat -> BigNat -> Ordering Source # (<) :: BigNat -> BigNat -> Bool Source # (<=) :: BigNat -> BigNat -> Bool Source # (>) :: BigNat -> BigNat -> Bool Source # (>=) :: BigNat -> BigNat -> Bool Source # max :: BigNat -> BigNat -> BigNat Source # min :: BigNat -> BigNat -> BigNat Source #
Ord Extension |

Instance details

Defined in GHC.LanguageExtensions.Type

Methods

compare :: Extension -> Extension -> Ordering Source #

(<) :: Extension -> Extension -> Bool Source #

(<=) :: Extension -> Extension -> Bool Source #

(>) :: Extension -> Extension -> Bool Source #

(>=) :: Extension -> Extension -> Bool Source #

max :: Extension -> Extension -> Extension Source #

min :: Extension -> Extension -> Extension Source #

Ord Ordering |
Instance details Defined in GHC.Classes Methods compare :: Ordering -> Ordering -> Ordering Source # (<) :: Ordering -> Ordering -> Bool Source # (<=) :: Ordering -> Ordering -> Bool Source # (>) :: Ordering -> Ordering -> Bool Source # (>=) :: Ordering -> Ordering -> Bool Source # max :: Ordering -> Ordering -> Ordering Source # min :: Ordering -> Ordering -> Ordering Source #
Ord TyCon |
Instance details Defined in GHC.Classes Methods compare :: TyCon -> TyCon -> Ordering Source # (<) :: TyCon -> TyCon -> Bool Source # (<=) :: TyCon -> TyCon -> Bool Source # (>) :: TyCon -> TyCon -> Bool Source # (>=) :: TyCon -> TyCon -> Bool Source # max :: TyCon -> TyCon -> TyCon Source # min :: TyCon -> TyCon -> TyCon Source #
Ord Completion |

Instance details

Defined in System.Console.Haskeline.Completion

Methods

compare :: Completion -> Completion -> Ordering Source #

(<) :: Completion -> Completion -> Bool Source #

(<=) :: Completion -> Completion -> Bool Source #

(>) :: Completion -> Completion -> Bool Source #

(>=) :: Completion -> Completion -> Bool Source #

max :: Completion -> Completion -> Completion Source #

min :: Completion -> Completion -> Completion Source #

Ord AccountAlias |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountAlias -> AccountAlias -> Ordering Source #

(<) :: AccountAlias -> AccountAlias -> Bool Source #

(<=) :: AccountAlias -> AccountAlias -> Bool Source #

(>) :: AccountAlias -> AccountAlias -> Bool Source #

(>=) :: AccountAlias -> AccountAlias -> Bool Source #

max :: AccountAlias -> AccountAlias -> AccountAlias Source #

min :: AccountAlias -> AccountAlias -> AccountAlias Source #

Ord AccountType |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountType -> AccountType -> Ordering Source #

(<) :: AccountType -> AccountType -> Bool Source #

(<=) :: AccountType -> AccountType -> Bool Source #

(>) :: AccountType -> AccountType -> Bool Source #

(>=) :: AccountType -> AccountType -> Bool Source #

max :: AccountType -> AccountType -> AccountType Source #

min :: AccountType -> AccountType -> AccountType Source #

Ord Amount |
Instance details Defined in Hledger.Data.Types Methods compare :: Amount -> Amount -> Ordering Source # (<) :: Amount -> Amount -> Bool Source # (<=) :: Amount -> Amount -> Bool Source # (>) :: Amount -> Amount -> Bool Source # (>=) :: Amount -> Amount -> Bool Source # max :: Amount -> Amount -> Amount Source # min :: Amount -> Amount -> Amount Source #
Ord AmountPrecision |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrecision -> AmountPrecision -> Ordering Source #

(<) :: AmountPrecision -> AmountPrecision -> Bool Source #

(<=) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>=) :: AmountPrecision -> AmountPrecision -> Bool Source #

max :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

min :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

Ord AmountPrice |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrice -> AmountPrice -> Ordering Source #

(<) :: AmountPrice -> AmountPrice -> Bool Source #

(<=) :: AmountPrice -> AmountPrice -> Bool Source #

(>) :: AmountPrice -> AmountPrice -> Bool Source #

(>=) :: AmountPrice -> AmountPrice -> Bool Source #

max :: AmountPrice -> AmountPrice -> AmountPrice Source #

min :: AmountPrice -> AmountPrice -> AmountPrice Source #

Ord AmountStyle |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountStyle -> AmountStyle -> Ordering Source #

(<) :: AmountStyle -> AmountStyle -> Bool Source #

(<=) :: AmountStyle -> AmountStyle -> Bool Source #

(>) :: AmountStyle -> AmountStyle -> Bool Source #

(>=) :: AmountStyle -> AmountStyle -> Bool Source #

max :: AmountStyle -> AmountStyle -> AmountStyle Source #

min :: AmountStyle -> AmountStyle -> AmountStyle Source #

Ord DateSpan |
Instance details Defined in Hledger.Data.Types Methods compare :: DateSpan -> DateSpan -> Ordering Source # (<) :: DateSpan -> DateSpan -> Bool Source # (<=) :: DateSpan -> DateSpan -> Bool Source # (>) :: DateSpan -> DateSpan -> Bool Source # (>=) :: DateSpan -> DateSpan -> Bool Source # max :: DateSpan -> DateSpan -> DateSpan Source # min :: DateSpan -> DateSpan -> DateSpan Source #
Ord DigitGroupStyle |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: DigitGroupStyle -> DigitGroupStyle -> Ordering Source #

(<) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(<=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

max :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

min :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

Ord EFDay |
Instance details Defined in Hledger.Data.Types Methods compare :: EFDay -> EFDay -> Ordering Source # (<) :: EFDay -> EFDay -> Bool Source # (<=) :: EFDay -> EFDay -> Bool Source # (>) :: EFDay -> EFDay -> Bool Source # (>=) :: EFDay -> EFDay -> Bool Source # max :: EFDay -> EFDay -> EFDay Source # min :: EFDay -> EFDay -> EFDay Source #
Ord Interval |
Instance details Defined in Hledger.Data.Types Methods compare :: Interval -> Interval -> Ordering Source # (<) :: Interval -> Interval -> Bool Source # (<=) :: Interval -> Interval -> Bool Source # (>) :: Interval -> Interval -> Bool Source # (>=) :: Interval -> Interval -> Bool Source # max :: Interval -> Interval -> Interval Source # min :: Interval -> Interval -> Interval Source #
Ord MarketPrice |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MarketPrice -> MarketPrice -> Ordering Source #

(<) :: MarketPrice -> MarketPrice -> Bool Source #

(<=) :: MarketPrice -> MarketPrice -> Bool Source #

(>) :: MarketPrice -> MarketPrice -> Bool Source #

(>=) :: MarketPrice -> MarketPrice -> Bool Source #

max :: MarketPrice -> MarketPrice -> MarketPrice Source #

min :: MarketPrice -> MarketPrice -> MarketPrice Source #

Ord MixedAmount |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MixedAmount -> MixedAmount -> Ordering Source #

(<) :: MixedAmount -> MixedAmount -> Bool Source #

(<=) :: MixedAmount -> MixedAmount -> Bool Source #

(>) :: MixedAmount -> MixedAmount -> Bool Source #

(>=) :: MixedAmount -> MixedAmount -> Bool Source #

max :: MixedAmount -> MixedAmount -> MixedAmount Source #

min :: MixedAmount -> MixedAmount -> MixedAmount Source #

Ord MixedAmountKey

We don't auto-derive the Ord instance because it would give an undesired ordering. We want the keys to be sorted lexicographically: (1) By the primary commodity of the amount. (2) By the commodity of the price, with no price being first. (3) By the unit price, from most negative to most positive, with total prices before unit prices. For example, we would like the ordering to give MixedAmountKeyNoPrice X < MixedAmountKeyTotalPrice X Z < MixedAmountKeyNoPrice Y

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MixedAmountKey -> MixedAmountKey -> Ordering Source #

(<) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

(<=) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

(>) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

(>=) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

max :: MixedAmountKey -> MixedAmountKey -> MixedAmountKey Source #

min :: MixedAmountKey -> MixedAmountKey -> MixedAmountKey Source #

Ord Period |
Instance details Defined in Hledger.Data.Types Methods compare :: Period -> Period -> Ordering Source # (<) :: Period -> Period -> Bool Source # (<=) :: Period -> Period -> Bool Source # (>) :: Period -> Period -> Bool Source # (>=) :: Period -> Period -> Bool Source # max :: Period -> Period -> Period Source # min :: Period -> Period -> Period Source #
Ord PriceDirective |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: PriceDirective -> PriceDirective -> Ordering Source #

(<) :: PriceDirective -> PriceDirective -> Bool Source #

(<=) :: PriceDirective -> PriceDirective -> Bool Source #

(>) :: PriceDirective -> PriceDirective -> Bool Source #

(>=) :: PriceDirective -> PriceDirective -> Bool Source #

max :: PriceDirective -> PriceDirective -> PriceDirective Source #

min :: PriceDirective -> PriceDirective -> PriceDirective Source #

Ord Side |
Instance details Defined in Hledger.Data.Types Methods compare :: Side -> Side -> Ordering Source # (<) :: Side -> Side -> Bool Source # (<=) :: Side -> Side -> Bool Source # (>) :: Side -> Side -> Bool Source # (>=) :: Side -> Side -> Bool Source # max :: Side -> Side -> Side Source # min :: Side -> Side -> Side Source #
Ord Status |
Instance details Defined in Hledger.Data.Types Methods compare :: Status -> Status -> Ordering Source # (<) :: Status -> Status -> Bool Source # (<=) :: Status -> Status -> Bool Source # (>) :: Status -> Status -> Bool Source # (>=) :: Status -> Status -> Bool Source # max :: Status -> Status -> Status Source # min :: Status -> Status -> Status Source #
Ord TimeclockCode |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockCode -> TimeclockCode -> Ordering Source #

(<) :: TimeclockCode -> TimeclockCode -> Bool Source #

(<=) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>=) :: TimeclockCode -> TimeclockCode -> Bool Source #

max :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

min :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

Ord TimeclockEntry |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockEntry -> TimeclockEntry -> Ordering Source #

(<) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(<=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

max :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

min :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

Ord DisplayName |

Instance details

Defined in Hledger.Reports.ReportTypes

Methods

compare :: DisplayName -> DisplayName -> Ordering Source #

(<) :: DisplayName -> DisplayName -> Bool Source #

(<=) :: DisplayName -> DisplayName -> Bool Source #

(>) :: DisplayName -> DisplayName -> Bool Source #

(>=) :: DisplayName -> DisplayName -> Bool Source #

max :: DisplayName -> DisplayName -> DisplayName Source #

min :: DisplayName -> DisplayName -> DisplayName Source #

Ord Regexp |
Instance details Defined in Hledger.Utils.Regex Methods compare :: Regexp -> Regexp -> Ordering Source # (<) :: Regexp -> Regexp -> Bool Source # (<=) :: Regexp -> Regexp -> Bool Source # (>) :: Regexp -> Regexp -> Bool Source # (>=) :: Regexp -> Regexp -> Bool Source # max :: Regexp -> Regexp -> Regexp Source # min :: Regexp -> Regexp -> Regexp Source #
Ord HledgerParseErrorData |

Instance details

Defined in Text.Megaparsec.Custom

Methods

compare :: HledgerParseErrorData -> HledgerParseErrorData -> Ordering Source #

(<) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

(<=) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

(>) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

(>=) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

max :: HledgerParseErrorData -> HledgerParseErrorData -> HledgerParseErrorData Source #

min :: HledgerParseErrorData -> HledgerParseErrorData -> HledgerParseErrorData Source #

Ord Pos |
Instance details Defined in Text.Megaparsec.Pos Methods compare :: Pos -> Pos -> Ordering Source # (<) :: Pos -> Pos -> Bool Source # (<=) :: Pos -> Pos -> Bool Source # (>) :: Pos -> Pos -> Bool Source # (>=) :: Pos -> Pos -> Bool Source # max :: Pos -> Pos -> Pos Source # min :: Pos -> Pos -> Pos Source #
Ord SourcePos |

Instance details

Defined in Text.Megaparsec.Pos

Methods

compare :: SourcePos -> SourcePos -> Ordering Source #

(<) :: SourcePos -> SourcePos -> Bool Source #

(<=) :: SourcePos -> SourcePos -> Bool Source #

(>) :: SourcePos -> SourcePos -> Bool Source #

(>=) :: SourcePos -> SourcePos -> Bool Source #

max :: SourcePos -> SourcePos -> SourcePos Source #

min :: SourcePos -> SourcePos -> SourcePos Source #

Ord FusionDepth |

Instance details

Defined in Prettyprinter.Internal

Methods

compare :: FusionDepth -> FusionDepth -> Ordering Source #

(<) :: FusionDepth -> FusionDepth -> Bool Source #

(<=) :: FusionDepth -> FusionDepth -> Bool Source #

(>) :: FusionDepth -> FusionDepth -> Bool Source #

(>=) :: FusionDepth -> FusionDepth -> Bool Source #

max :: FusionDepth -> FusionDepth -> FusionDepth Source #

min :: FusionDepth -> FusionDepth -> FusionDepth Source #

Ord LayoutOptions |

Instance details

Defined in Prettyprinter.Internal

Methods

compare :: LayoutOptions -> LayoutOptions -> Ordering Source #

(<) :: LayoutOptions -> LayoutOptions -> Bool Source #

(<=) :: LayoutOptions -> LayoutOptions -> Bool Source #

(>) :: LayoutOptions -> LayoutOptions -> Bool Source #

(>=) :: LayoutOptions -> LayoutOptions -> Bool Source #

max :: LayoutOptions -> LayoutOptions -> LayoutOptions Source #

min :: LayoutOptions -> LayoutOptions -> LayoutOptions Source #

Ord PageWidth |

Instance details

Defined in Prettyprinter.Internal

Methods

compare :: PageWidth -> PageWidth -> Ordering Source #

(<) :: PageWidth -> PageWidth -> Bool Source #

(<=) :: PageWidth -> PageWidth -> Bool Source #

(>) :: PageWidth -> PageWidth -> Bool Source #

(>=) :: PageWidth -> PageWidth -> Bool Source #

max :: PageWidth -> PageWidth -> PageWidth Source #

min :: PageWidth -> PageWidth -> PageWidth Source #

Ord AnsiStyle |

Instance details

Defined in Prettyprinter.Render.Terminal.Internal

Methods

compare :: AnsiStyle -> AnsiStyle -> Ordering Source #

(<) :: AnsiStyle -> AnsiStyle -> Bool Source #

(<=) :: AnsiStyle -> AnsiStyle -> Bool Source #

(>) :: AnsiStyle -> AnsiStyle -> Bool Source #

(>=) :: AnsiStyle -> AnsiStyle -> Bool Source #

max :: AnsiStyle -> AnsiStyle -> AnsiStyle Source #

min :: AnsiStyle -> AnsiStyle -> AnsiStyle Source #

Ord Bold |
Instance details Defined in Prettyprinter.Render.Terminal.Internal Methods compare :: Bold -> Bold -> Ordering Source # (<) :: Bold -> Bold -> Bool Source # (<=) :: Bold -> Bold -> Bool Source # (>) :: Bold -> Bold -> Bool Source # (>=) :: Bold -> Bold -> Bool Source # max :: Bold -> Bold -> Bold Source # min :: Bold -> Bold -> Bold Source #
Ord Color |
Instance details Defined in Prettyprinter.Render.Terminal.Internal Methods compare :: Color -> Color -> Ordering Source # (<) :: Color -> Color -> Bool Source # (<=) :: Color -> Color -> Bool Source # (>) :: Color -> Color -> Bool Source # (>=) :: Color -> Color -> Bool Source # max :: Color -> Color -> Color Source # min :: Color -> Color -> Color Source #
Ord Intensity |

Instance details

Defined in Prettyprinter.Render.Terminal.Internal

Methods

compare :: Intensity -> Intensity -> Ordering Source #

(<) :: Intensity -> Intensity -> Bool Source #

(<=) :: Intensity -> Intensity -> Bool Source #

(>) :: Intensity -> Intensity -> Bool Source #

(>=) :: Intensity -> Intensity -> Bool Source #

max :: Intensity -> Intensity -> Intensity Source #

min :: Intensity -> Intensity -> Intensity Source #

Ord Italicized |

Instance details

Defined in Prettyprinter.Render.Terminal.Internal

Methods

compare :: Italicized -> Italicized -> Ordering Source #

(<) :: Italicized -> Italicized -> Bool Source #

(<=) :: Italicized -> Italicized -> Bool Source #

(>) :: Italicized -> Italicized -> Bool Source #

(>=) :: Italicized -> Italicized -> Bool Source #

max :: Italicized -> Italicized -> Italicized Source #

min :: Italicized -> Italicized -> Italicized Source #

Ord Layer |
Instance details Defined in Prettyprinter.Render.Terminal.Internal Methods compare :: Layer -> Layer -> Ordering Source # (<) :: Layer -> Layer -> Bool Source # (<=) :: Layer -> Layer -> Bool Source # (>) :: Layer -> Layer -> Bool Source # (>=) :: Layer -> Layer -> Bool Source # max :: Layer -> Layer -> Layer Source # min :: Layer -> Layer -> Layer Source #
Ord Underlined |

Instance details

Defined in Prettyprinter.Render.Terminal.Internal

Methods

compare :: Underlined -> Underlined -> Ordering Source #

(<) :: Underlined -> Underlined -> Bool Source #

(<=) :: Underlined -> Underlined -> Bool Source #

(>) :: Underlined -> Underlined -> Bool Source #

(>=) :: Underlined -> Underlined -> Bool Source #

max :: Underlined -> Underlined -> Underlined Source #

min :: Underlined -> Underlined -> Underlined Source #

Ord DoPa |
Instance details Defined in Text.Regex.TDFA.Common Methods compare :: DoPa -> DoPa -> Ordering Source # (<) :: DoPa -> DoPa -> Bool Source # (<=) :: DoPa -> DoPa -> Bool Source # (>) :: DoPa -> DoPa -> Bool Source # (>=) :: DoPa -> DoPa -> Bool Source # max :: DoPa -> DoPa -> DoPa Source # min :: DoPa -> DoPa -> DoPa Source #
Ord WhichTest |

Instance details

Defined in Text.Regex.TDFA.Common

Methods

compare :: WhichTest -> WhichTest -> Ordering Source #

(<) :: WhichTest -> WhichTest -> Bool Source #

(<=) :: WhichTest -> WhichTest -> Bool Source #

(>) :: WhichTest -> WhichTest -> Bool Source #

(>=) :: WhichTest -> WhichTest -> Bool Source #

max :: WhichTest -> WhichTest -> WhichTest Source #

min :: WhichTest -> WhichTest -> WhichTest Source #

Ord Scientific |

Instance details

Defined in Data.Scientific

Methods

compare :: Scientific -> Scientific -> Ordering Source #

(<) :: Scientific -> Scientific -> Bool Source #

(<=) :: Scientific -> Scientific -> Bool Source #

(>) :: Scientific -> Scientific -> Bool Source #

(>=) :: Scientific -> Scientific -> Bool Source #

max :: Scientific -> Scientific -> Scientific Source #

min :: Scientific -> Scientific -> Scientific Source #

Ord NumThreads |

Instance details

Defined in Test.Tasty.Options.Core

Methods

compare :: NumThreads -> NumThreads -> Ordering Source #

(<) :: NumThreads -> NumThreads -> Bool Source #

(<=) :: NumThreads -> NumThreads -> Bool Source #

(>) :: NumThreads -> NumThreads -> Bool Source #

(>=) :: NumThreads -> NumThreads -> Bool Source #

max :: NumThreads -> NumThreads -> NumThreads Source #

min :: NumThreads -> NumThreads -> NumThreads Source #

Ord AnnLookup |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: AnnLookup -> AnnLookup -> Ordering Source #

(<) :: AnnLookup -> AnnLookup -> Bool Source #

(<=) :: AnnLookup -> AnnLookup -> Bool Source #

(>) :: AnnLookup -> AnnLookup -> Bool Source #

(>=) :: AnnLookup -> AnnLookup -> Bool Source #

max :: AnnLookup -> AnnLookup -> AnnLookup Source #

min :: AnnLookup -> AnnLookup -> AnnLookup Source #

Ord AnnTarget |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: AnnTarget -> AnnTarget -> Ordering Source #

(<) :: AnnTarget -> AnnTarget -> Bool Source #

(<=) :: AnnTarget -> AnnTarget -> Bool Source #

(>) :: AnnTarget -> AnnTarget -> Bool Source #

(>=) :: AnnTarget -> AnnTarget -> Bool Source #

max :: AnnTarget -> AnnTarget -> AnnTarget Source #

min :: AnnTarget -> AnnTarget -> AnnTarget Source #

Ord Bang |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Bang -> Bang -> Ordering Source # (<) :: Bang -> Bang -> Bool Source # (<=) :: Bang -> Bang -> Bool Source # (>) :: Bang -> Bang -> Bool Source # (>=) :: Bang -> Bang -> Bool Source # max :: Bang -> Bang -> Bang Source # min :: Bang -> Bang -> Bang Source #
Ord Body |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Body -> Body -> Ordering Source # (<) :: Body -> Body -> Bool Source # (<=) :: Body -> Body -> Bool Source # (>) :: Body -> Body -> Bool Source # (>=) :: Body -> Body -> Bool Source # max :: Body -> Body -> Body Source # min :: Body -> Body -> Body Source #
Ord Bytes |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Bytes -> Bytes -> Ordering Source # (<) :: Bytes -> Bytes -> Bool Source # (<=) :: Bytes -> Bytes -> Bool Source # (>) :: Bytes -> Bytes -> Bool Source # (>=) :: Bytes -> Bytes -> Bool Source # max :: Bytes -> Bytes -> Bytes Source # min :: Bytes -> Bytes -> Bytes Source #
Ord Callconv |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Callconv -> Callconv -> Ordering Source # (<) :: Callconv -> Callconv -> Bool Source # (<=) :: Callconv -> Callconv -> Bool Source # (>) :: Callconv -> Callconv -> Bool Source # (>=) :: Callconv -> Callconv -> Bool Source # max :: Callconv -> Callconv -> Callconv Source # min :: Callconv -> Callconv -> Callconv Source #
Ord Clause |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Clause -> Clause -> Ordering Source # (<) :: Clause -> Clause -> Bool Source # (<=) :: Clause -> Clause -> Bool Source # (>) :: Clause -> Clause -> Bool Source # (>=) :: Clause -> Clause -> Bool Source # max :: Clause -> Clause -> Clause Source # min :: Clause -> Clause -> Clause Source #
Ord Con |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Con -> Con -> Ordering Source # (<) :: Con -> Con -> Bool Source # (<=) :: Con -> Con -> Bool Source # (>) :: Con -> Con -> Bool Source # (>=) :: Con -> Con -> Bool Source # max :: Con -> Con -> Con Source # min :: Con -> Con -> Con Source #
Ord Dec |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Dec -> Dec -> Ordering Source # (<) :: Dec -> Dec -> Bool Source # (<=) :: Dec -> Dec -> Bool Source # (>) :: Dec -> Dec -> Bool Source # (>=) :: Dec -> Dec -> Bool Source # max :: Dec -> Dec -> Dec Source # min :: Dec -> Dec -> Dec Source #
Ord DecidedStrictness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: DecidedStrictness -> DecidedStrictness -> Ordering Source #

(<) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

(<=) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

(>) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

(>=) :: DecidedStrictness -> DecidedStrictness -> Bool Source #

max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source #

min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source #

Ord DerivClause |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: DerivClause -> DerivClause -> Ordering Source #

(<) :: DerivClause -> DerivClause -> Bool Source #

(<=) :: DerivClause -> DerivClause -> Bool Source #

(>) :: DerivClause -> DerivClause -> Bool Source #

(>=) :: DerivClause -> DerivClause -> Bool Source #

max :: DerivClause -> DerivClause -> DerivClause Source #

min :: DerivClause -> DerivClause -> DerivClause Source #

Ord DerivStrategy |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: DerivStrategy -> DerivStrategy -> Ordering Source #

(<) :: DerivStrategy -> DerivStrategy -> Bool Source #

(<=) :: DerivStrategy -> DerivStrategy -> Bool Source #

(>) :: DerivStrategy -> DerivStrategy -> Bool Source #

(>=) :: DerivStrategy -> DerivStrategy -> Bool Source #

max :: DerivStrategy -> DerivStrategy -> DerivStrategy Source #

min :: DerivStrategy -> DerivStrategy -> DerivStrategy Source #

Ord DocLoc |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: DocLoc -> DocLoc -> Ordering Source # (<) :: DocLoc -> DocLoc -> Bool Source # (<=) :: DocLoc -> DocLoc -> Bool Source # (>) :: DocLoc -> DocLoc -> Bool Source # (>=) :: DocLoc -> DocLoc -> Bool Source # max :: DocLoc -> DocLoc -> DocLoc Source # min :: DocLoc -> DocLoc -> DocLoc Source #
Ord Exp |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Exp -> Exp -> Ordering Source # (<) :: Exp -> Exp -> Bool Source # (<=) :: Exp -> Exp -> Bool Source # (>) :: Exp -> Exp -> Bool Source # (>=) :: Exp -> Exp -> Bool Source # max :: Exp -> Exp -> Exp Source # min :: Exp -> Exp -> Exp Source #
Ord FamilyResultSig |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: FamilyResultSig -> FamilyResultSig -> Ordering Source #

(<) :: FamilyResultSig -> FamilyResultSig -> Bool Source #

(<=) :: FamilyResultSig -> FamilyResultSig -> Bool Source #

(>) :: FamilyResultSig -> FamilyResultSig -> Bool Source #

(>=) :: FamilyResultSig -> FamilyResultSig -> Bool Source #

max :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig Source #

min :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig Source #

Ord Fixity |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Fixity -> Fixity -> Ordering Source # (<) :: Fixity -> Fixity -> Bool Source # (<=) :: Fixity -> Fixity -> Bool Source # (>) :: Fixity -> Fixity -> Bool Source # (>=) :: Fixity -> Fixity -> Bool Source # max :: Fixity -> Fixity -> Fixity Source # min :: Fixity -> Fixity -> Fixity Source #
Ord FixityDirection |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: FixityDirection -> FixityDirection -> Ordering Source #

(<) :: FixityDirection -> FixityDirection -> Bool Source #

(<=) :: FixityDirection -> FixityDirection -> Bool Source #

(>) :: FixityDirection -> FixityDirection -> Bool Source #

(>=) :: FixityDirection -> FixityDirection -> Bool Source #

max :: FixityDirection -> FixityDirection -> FixityDirection Source #

min :: FixityDirection -> FixityDirection -> FixityDirection Source #

Ord Foreign |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Foreign -> Foreign -> Ordering Source # (<) :: Foreign -> Foreign -> Bool Source # (<=) :: Foreign -> Foreign -> Bool Source # (>) :: Foreign -> Foreign -> Bool Source # (>=) :: Foreign -> Foreign -> Bool Source # max :: Foreign -> Foreign -> Foreign Source # min :: Foreign -> Foreign -> Foreign Source #
Ord FunDep |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: FunDep -> FunDep -> Ordering Source # (<) :: FunDep -> FunDep -> Bool Source # (<=) :: FunDep -> FunDep -> Bool Source # (>) :: FunDep -> FunDep -> Bool Source # (>=) :: FunDep -> FunDep -> Bool Source # max :: FunDep -> FunDep -> FunDep Source # min :: FunDep -> FunDep -> FunDep Source #
Ord Guard |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Guard -> Guard -> Ordering Source # (<) :: Guard -> Guard -> Bool Source # (<=) :: Guard -> Guard -> Bool Source # (>) :: Guard -> Guard -> Bool Source # (>=) :: Guard -> Guard -> Bool Source # max :: Guard -> Guard -> Guard Source # min :: Guard -> Guard -> Guard Source #
Ord Info |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Info -> Info -> Ordering Source # (<) :: Info -> Info -> Bool Source # (<=) :: Info -> Info -> Bool Source # (>) :: Info -> Info -> Bool Source # (>=) :: Info -> Info -> Bool Source # max :: Info -> Info -> Info Source # min :: Info -> Info -> Info Source #
Ord InjectivityAnn |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: InjectivityAnn -> InjectivityAnn -> Ordering Source #

(<) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

(<=) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

(>) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

(>=) :: InjectivityAnn -> InjectivityAnn -> Bool Source #

max :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn Source #

min :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn Source #

Ord Inline |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Inline -> Inline -> Ordering Source # (<) :: Inline -> Inline -> Bool Source # (<=) :: Inline -> Inline -> Bool Source # (>) :: Inline -> Inline -> Bool Source # (>=) :: Inline -> Inline -> Bool Source # max :: Inline -> Inline -> Inline Source # min :: Inline -> Inline -> Inline Source #
Ord Lit |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Lit -> Lit -> Ordering Source # (<) :: Lit -> Lit -> Bool Source # (<=) :: Lit -> Lit -> Bool Source # (>) :: Lit -> Lit -> Bool Source # (>=) :: Lit -> Lit -> Bool Source # max :: Lit -> Lit -> Lit Source # min :: Lit -> Lit -> Lit Source #
Ord Loc |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Loc -> Loc -> Ordering Source # (<) :: Loc -> Loc -> Bool Source # (<=) :: Loc -> Loc -> Bool Source # (>) :: Loc -> Loc -> Bool Source # (>=) :: Loc -> Loc -> Bool Source # max :: Loc -> Loc -> Loc Source # min :: Loc -> Loc -> Loc Source #
Ord Match |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Match -> Match -> Ordering Source # (<) :: Match -> Match -> Bool Source # (<=) :: Match -> Match -> Bool Source # (>) :: Match -> Match -> Bool Source # (>=) :: Match -> Match -> Bool Source # max :: Match -> Match -> Match Source # min :: Match -> Match -> Match Source #
Ord ModName |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: ModName -> ModName -> Ordering Source # (<) :: ModName -> ModName -> Bool Source # (<=) :: ModName -> ModName -> Bool Source # (>) :: ModName -> ModName -> Bool Source # (>=) :: ModName -> ModName -> Bool Source # max :: ModName -> ModName -> ModName Source # min :: ModName -> ModName -> ModName Source #
Ord Module |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Module -> Module -> Ordering Source # (<) :: Module -> Module -> Bool Source # (<=) :: Module -> Module -> Bool Source # (>) :: Module -> Module -> Bool Source # (>=) :: Module -> Module -> Bool Source # max :: Module -> Module -> Module Source # min :: Module -> Module -> Module Source #
Ord ModuleInfo |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: ModuleInfo -> ModuleInfo -> Ordering Source #

(<) :: ModuleInfo -> ModuleInfo -> Bool Source #

(<=) :: ModuleInfo -> ModuleInfo -> Bool Source #

(>) :: ModuleInfo -> ModuleInfo -> Bool Source #

(>=) :: ModuleInfo -> ModuleInfo -> Bool Source #

max :: ModuleInfo -> ModuleInfo -> ModuleInfo Source #

min :: ModuleInfo -> ModuleInfo -> ModuleInfo Source #

Ord Name |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Name -> Name -> Ordering Source # (<) :: Name -> Name -> Bool Source # (<=) :: Name -> Name -> Bool Source # (>) :: Name -> Name -> Bool Source # (>=) :: Name -> Name -> Bool Source # max :: Name -> Name -> Name Source # min :: Name -> Name -> Name Source #
Ord NameFlavour |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: NameFlavour -> NameFlavour -> Ordering Source #

(<) :: NameFlavour -> NameFlavour -> Bool Source #

(<=) :: NameFlavour -> NameFlavour -> Bool Source #

(>) :: NameFlavour -> NameFlavour -> Bool Source #

(>=) :: NameFlavour -> NameFlavour -> Bool Source #

max :: NameFlavour -> NameFlavour -> NameFlavour Source #

min :: NameFlavour -> NameFlavour -> NameFlavour Source #

Ord NameSpace |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: NameSpace -> NameSpace -> Ordering Source #

(<) :: NameSpace -> NameSpace -> Bool Source #

(<=) :: NameSpace -> NameSpace -> Bool Source #

(>) :: NameSpace -> NameSpace -> Bool Source #

(>=) :: NameSpace -> NameSpace -> Bool Source #

max :: NameSpace -> NameSpace -> NameSpace Source #

min :: NameSpace -> NameSpace -> NameSpace Source #

Ord OccName |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: OccName -> OccName -> Ordering Source # (<) :: OccName -> OccName -> Bool Source # (<=) :: OccName -> OccName -> Bool Source # (>) :: OccName -> OccName -> Bool Source # (>=) :: OccName -> OccName -> Bool Source # max :: OccName -> OccName -> OccName Source # min :: OccName -> OccName -> OccName Source #
Ord Overlap |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Overlap -> Overlap -> Ordering Source # (<) :: Overlap -> Overlap -> Bool Source # (<=) :: Overlap -> Overlap -> Bool Source # (>) :: Overlap -> Overlap -> Bool Source # (>=) :: Overlap -> Overlap -> Bool Source # max :: Overlap -> Overlap -> Overlap Source # min :: Overlap -> Overlap -> Overlap Source #
Ord Pat |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Pat -> Pat -> Ordering Source # (<) :: Pat -> Pat -> Bool Source # (<=) :: Pat -> Pat -> Bool Source # (>) :: Pat -> Pat -> Bool Source # (>=) :: Pat -> Pat -> Bool Source # max :: Pat -> Pat -> Pat Source # min :: Pat -> Pat -> Pat Source #
Ord PatSynArgs |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: PatSynArgs -> PatSynArgs -> Ordering Source #

(<) :: PatSynArgs -> PatSynArgs -> Bool Source #

(<=) :: PatSynArgs -> PatSynArgs -> Bool Source #

(>) :: PatSynArgs -> PatSynArgs -> Bool Source #

(>=) :: PatSynArgs -> PatSynArgs -> Bool Source #

max :: PatSynArgs -> PatSynArgs -> PatSynArgs Source #

min :: PatSynArgs -> PatSynArgs -> PatSynArgs Source #

Ord PatSynDir |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: PatSynDir -> PatSynDir -> Ordering Source #

(<) :: PatSynDir -> PatSynDir -> Bool Source #

(<=) :: PatSynDir -> PatSynDir -> Bool Source #

(>) :: PatSynDir -> PatSynDir -> Bool Source #

(>=) :: PatSynDir -> PatSynDir -> Bool Source #

max :: PatSynDir -> PatSynDir -> PatSynDir Source #

min :: PatSynDir -> PatSynDir -> PatSynDir Source #

Ord Phases |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Phases -> Phases -> Ordering Source # (<) :: Phases -> Phases -> Bool Source # (<=) :: Phases -> Phases -> Bool Source # (>) :: Phases -> Phases -> Bool Source # (>=) :: Phases -> Phases -> Bool Source # max :: Phases -> Phases -> Phases Source # min :: Phases -> Phases -> Phases Source #
Ord PkgName |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: PkgName -> PkgName -> Ordering Source # (<) :: PkgName -> PkgName -> Bool Source # (<=) :: PkgName -> PkgName -> Bool Source # (>) :: PkgName -> PkgName -> Bool Source # (>=) :: PkgName -> PkgName -> Bool Source # max :: PkgName -> PkgName -> PkgName Source # min :: PkgName -> PkgName -> PkgName Source #
Ord Pragma |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Pragma -> Pragma -> Ordering Source # (<) :: Pragma -> Pragma -> Bool Source # (<=) :: Pragma -> Pragma -> Bool Source # (>) :: Pragma -> Pragma -> Bool Source # (>=) :: Pragma -> Pragma -> Bool Source # max :: Pragma -> Pragma -> Pragma Source # min :: Pragma -> Pragma -> Pragma Source #
Ord Range |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Range -> Range -> Ordering Source # (<) :: Range -> Range -> Bool Source # (<=) :: Range -> Range -> Bool Source # (>) :: Range -> Range -> Bool Source # (>=) :: Range -> Range -> Bool Source # max :: Range -> Range -> Range Source # min :: Range -> Range -> Range Source #
Ord Role |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Role -> Role -> Ordering Source # (<) :: Role -> Role -> Bool Source # (<=) :: Role -> Role -> Bool Source # (>) :: Role -> Role -> Bool Source # (>=) :: Role -> Role -> Bool Source # max :: Role -> Role -> Role Source # min :: Role -> Role -> Role Source #
Ord RuleBndr |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: RuleBndr -> RuleBndr -> Ordering Source # (<) :: RuleBndr -> RuleBndr -> Bool Source # (<=) :: RuleBndr -> RuleBndr -> Bool Source # (>) :: RuleBndr -> RuleBndr -> Bool Source # (>=) :: RuleBndr -> RuleBndr -> Bool Source # max :: RuleBndr -> RuleBndr -> RuleBndr Source # min :: RuleBndr -> RuleBndr -> RuleBndr Source #
Ord RuleMatch |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: RuleMatch -> RuleMatch -> Ordering Source #

(<) :: RuleMatch -> RuleMatch -> Bool Source #

(<=) :: RuleMatch -> RuleMatch -> Bool Source #

(>) :: RuleMatch -> RuleMatch -> Bool Source #

(>=) :: RuleMatch -> RuleMatch -> Bool Source #

max :: RuleMatch -> RuleMatch -> RuleMatch Source #

min :: RuleMatch -> RuleMatch -> RuleMatch Source #

Ord Safety |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Safety -> Safety -> Ordering Source # (<) :: Safety -> Safety -> Bool Source # (<=) :: Safety -> Safety -> Bool Source # (>) :: Safety -> Safety -> Bool Source # (>=) :: Safety -> Safety -> Bool Source # max :: Safety -> Safety -> Safety Source # min :: Safety -> Safety -> Safety Source #
Ord SourceStrictness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: SourceStrictness -> SourceStrictness -> Ordering Source #

(<) :: SourceStrictness -> SourceStrictness -> Bool Source #

(<=) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>) :: SourceStrictness -> SourceStrictness -> Bool Source #

(>=) :: SourceStrictness -> SourceStrictness -> Bool Source #

max :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

min :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #

Ord SourceUnpackedness |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering Source #

(<) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

(>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #

max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #

Ord Specificity |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: Specificity -> Specificity -> Ordering Source #

(<) :: Specificity -> Specificity -> Bool Source #

(<=) :: Specificity -> Specificity -> Bool Source #

(>) :: Specificity -> Specificity -> Bool Source #

(>=) :: Specificity -> Specificity -> Bool Source #

max :: Specificity -> Specificity -> Specificity Source #

min :: Specificity -> Specificity -> Specificity Source #

Ord Stmt |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Stmt -> Stmt -> Ordering Source # (<) :: Stmt -> Stmt -> Bool Source # (<=) :: Stmt -> Stmt -> Bool Source # (>) :: Stmt -> Stmt -> Bool Source # (>=) :: Stmt -> Stmt -> Bool Source # max :: Stmt -> Stmt -> Stmt Source # min :: Stmt -> Stmt -> Stmt Source #
Ord TyLit |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: TyLit -> TyLit -> Ordering Source # (<) :: TyLit -> TyLit -> Bool Source # (<=) :: TyLit -> TyLit -> Bool Source # (>) :: TyLit -> TyLit -> Bool Source # (>=) :: TyLit -> TyLit -> Bool Source # max :: TyLit -> TyLit -> TyLit Source # min :: TyLit -> TyLit -> TyLit Source #
Ord TySynEqn |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: TySynEqn -> TySynEqn -> Ordering Source # (<) :: TySynEqn -> TySynEqn -> Bool Source # (<=) :: TySynEqn -> TySynEqn -> Bool Source # (>) :: TySynEqn -> TySynEqn -> Bool Source # (>=) :: TySynEqn -> TySynEqn -> Bool Source # max :: TySynEqn -> TySynEqn -> TySynEqn Source # min :: TySynEqn -> TySynEqn -> TySynEqn Source #
Ord Type |
Instance details Defined in Language.Haskell.TH.Syntax Methods compare :: Type -> Type -> Ordering Source # (<) :: Type -> Type -> Bool Source # (<=) :: Type -> Type -> Bool Source # (>) :: Type -> Type -> Bool Source # (>=) :: Type -> Type -> Bool Source # max :: Type -> Type -> Type Source # min :: Type -> Type -> Type Source #
Ord TypeFamilyHead |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: TypeFamilyHead -> TypeFamilyHead -> Ordering Source #

(<) :: TypeFamilyHead -> TypeFamilyHead -> Bool Source #

(<=) :: TypeFamilyHead -> TypeFamilyHead -> Bool Source #

(>) :: TypeFamilyHead -> TypeFamilyHead -> Bool Source #

(>=) :: TypeFamilyHead -> TypeFamilyHead -> Bool Source #

max :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead Source #

min :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead Source #

Ord Color |
Instance details Defined in System.Console.Terminfo.Color Methods compare :: Color -> Color -> Ordering Source # (<) :: Color -> Color -> Bool Source # (<=) :: Color -> Color -> Bool Source # (>) :: Color -> Color -> Bool Source # (>=) :: Color -> Color -> Bool Source # max :: Color -> Color -> Color Source # min :: Color -> Color -> Color Source #
Ord Builder |
Instance details Defined in Data.Text.Internal.Builder Methods compare :: Builder -> Builder -> Ordering Source # (<) :: Builder -> Builder -> Bool Source # (<=) :: Builder -> Builder -> Bool Source # (>) :: Builder -> Builder -> Bool Source # (>=) :: Builder -> Builder -> Bool Source # max :: Builder -> Builder -> Builder Source # min :: Builder -> Builder -> Builder Source #
Ord B |
Instance details Defined in Data.Text.Short.Internal Methods compare :: B -> B -> Ordering Source # (<) :: B -> B -> Bool Source # (<=) :: B -> B -> Bool Source # (>) :: B -> B -> Bool Source # (>=) :: B -> B -> Bool Source # max :: B -> B -> B Source # min :: B -> B -> B Source #
Ord ShortText |

Instance details

Defined in Data.Text.Short.Internal

Methods

compare :: ShortText -> ShortText -> Ordering Source #

(<) :: ShortText -> ShortText -> Bool Source #

(<=) :: ShortText -> ShortText -> Bool Source #

(>) :: ShortText -> ShortText -> Bool Source #

(>=) :: ShortText -> ShortText -> Bool Source #

max :: ShortText -> ShortText -> ShortText Source #

min :: ShortText -> ShortText -> ShortText Source #

Ord ConstructorVariant |

Instance details

Defined in Language.Haskell.TH.Datatype

Methods

compare :: ConstructorVariant -> ConstructorVariant -> Ordering Source #

(<) :: ConstructorVariant -> ConstructorVariant -> Bool Source #

(<=) :: ConstructorVariant -> ConstructorVariant -> Bool Source #

(>) :: ConstructorVariant -> ConstructorVariant -> Bool Source #

(>=) :: ConstructorVariant -> ConstructorVariant -> Bool Source #

max :: ConstructorVariant -> ConstructorVariant -> ConstructorVariant Source #

min :: ConstructorVariant -> ConstructorVariant -> ConstructorVariant Source #

Ord DatatypeVariant |

Instance details

Defined in Language.Haskell.TH.Datatype

Methods

compare :: DatatypeVariant -> DatatypeVariant -> Ordering Source #

(<) :: DatatypeVariant -> DatatypeVariant -> Bool Source #

(<=) :: DatatypeVariant -> DatatypeVariant -> Bool Source #

(>) :: DatatypeVariant -> DatatypeVariant -> Bool Source #

(>=) :: DatatypeVariant -> DatatypeVariant -> Bool Source #

max :: DatatypeVariant -> DatatypeVariant -> DatatypeVariant Source #

min :: DatatypeVariant -> DatatypeVariant -> DatatypeVariant Source #

Ord FieldStrictness |

Instance details

Defined in Language.Haskell.TH.Datatype

Methods

compare :: FieldStrictness -> FieldStrictness -> Ordering Source #

(<) :: FieldStrictness -> FieldStrictness -> Bool Source #

(<=) :: FieldStrictness -> FieldStrictness -> Bool Source #

(>) :: FieldStrictness -> FieldStrictness -> Bool Source #

(>=) :: FieldStrictness -> FieldStrictness -> Bool Source #

max :: FieldStrictness -> FieldStrictness -> FieldStrictness Source #

min :: FieldStrictness -> FieldStrictness -> FieldStrictness Source #

Ord Strictness |

Instance details

Defined in Language.Haskell.TH.Datatype

Methods

compare :: Strictness -> Strictness -> Ordering Source #

(<) :: Strictness -> Strictness -> Bool Source #

(<=) :: Strictness -> Strictness -> Bool Source #

(>) :: Strictness -> Strictness -> Bool Source #

(>=) :: Strictness -> Strictness -> Bool Source #

max :: Strictness -> Strictness -> Strictness Source #

min :: Strictness -> Strictness -> Strictness Source #

Ord Unpackedness |

Instance details

Defined in Language.Haskell.TH.Datatype

Methods

compare :: Unpackedness -> Unpackedness -> Ordering Source #

(<) :: Unpackedness -> Unpackedness -> Bool Source #

(<=) :: Unpackedness -> Unpackedness -> Bool Source #

(>) :: Unpackedness -> Unpackedness -> Bool Source #

(>=) :: Unpackedness -> Unpackedness -> Bool Source #

max :: Unpackedness -> Unpackedness -> Unpackedness Source #

min :: Unpackedness -> Unpackedness -> Unpackedness Source #

Ord Day |
Instance details Defined in Data.Time.Calendar.Days Methods compare :: Day -> Day -> Ordering Source # (<) :: Day -> Day -> Bool Source # (<=) :: Day -> Day -> Bool Source # (>) :: Day -> Day -> Bool Source # (>=) :: Day -> Day -> Bool Source # max :: Day -> Day -> Day Source # min :: Day -> Day -> Day Source #
Ord DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

compare :: DayOfWeek -> DayOfWeek -> Ordering Source #

(<) :: DayOfWeek -> DayOfWeek -> Bool Source #

(<=) :: DayOfWeek -> DayOfWeek -> Bool Source #

(>) :: DayOfWeek -> DayOfWeek -> Bool Source #

(>=) :: DayOfWeek -> DayOfWeek -> Bool Source #

max :: DayOfWeek -> DayOfWeek -> DayOfWeek Source #

min :: DayOfWeek -> DayOfWeek -> DayOfWeek Source #

Ord DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

compare :: DiffTime -> DiffTime -> Ordering Source #

(<) :: DiffTime -> DiffTime -> Bool Source #

(<=) :: DiffTime -> DiffTime -> Bool Source #

(>) :: DiffTime -> DiffTime -> Bool Source #

(>=) :: DiffTime -> DiffTime -> Bool Source #

max :: DiffTime -> DiffTime -> DiffTime Source #

min :: DiffTime -> DiffTime -> DiffTime Source #

Ord NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

compare :: NominalDiffTime -> NominalDiffTime -> Ordering Source #

(<) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(<=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

max :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

min :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

Ord SystemTime |

Instance details

Defined in Data.Time.Clock.Internal.SystemTime

Methods

compare :: SystemTime -> SystemTime -> Ordering Source #

(<) :: SystemTime -> SystemTime -> Bool Source #

(<=) :: SystemTime -> SystemTime -> Bool Source #

(>) :: SystemTime -> SystemTime -> Bool Source #

(>=) :: SystemTime -> SystemTime -> Bool Source #

max :: SystemTime -> SystemTime -> SystemTime Source #

min :: SystemTime -> SystemTime -> SystemTime Source #

Ord UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods compare :: UTCTime -> UTCTime -> Ordering Source # (<) :: UTCTime -> UTCTime -> Bool Source # (<=) :: UTCTime -> UTCTime -> Bool Source # (>) :: UTCTime -> UTCTime -> Bool Source # (>=) :: UTCTime -> UTCTime -> Bool Source # max :: UTCTime -> UTCTime -> UTCTime Source # min :: UTCTime -> UTCTime -> UTCTime Source #
Ord UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

compare :: UniversalTime -> UniversalTime -> Ordering Source #

(<) :: UniversalTime -> UniversalTime -> Bool Source #

(<=) :: UniversalTime -> UniversalTime -> Bool Source #

(>) :: UniversalTime -> UniversalTime -> Bool Source #

(>=) :: UniversalTime -> UniversalTime -> Bool Source #

max :: UniversalTime -> UniversalTime -> UniversalTime Source #

min :: UniversalTime -> UniversalTime -> UniversalTime Source #

Ord TimeLocale |

Instance details

Defined in Data.Time.Format.Locale

Methods

compare :: TimeLocale -> TimeLocale -> Ordering Source #

(<) :: TimeLocale -> TimeLocale -> Bool Source #

(<=) :: TimeLocale -> TimeLocale -> Bool Source #

(>) :: TimeLocale -> TimeLocale -> Bool Source #

(>=) :: TimeLocale -> TimeLocale -> Bool Source #

max :: TimeLocale -> TimeLocale -> TimeLocale Source #

min :: TimeLocale -> TimeLocale -> TimeLocale Source #

Ord LocalTime |

Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Methods

compare :: LocalTime -> LocalTime -> Ordering Source #

(<) :: LocalTime -> LocalTime -> Bool Source #

(<=) :: LocalTime -> LocalTime -> Bool Source #

(>) :: LocalTime -> LocalTime -> Bool Source #

(>=) :: LocalTime -> LocalTime -> Bool Source #

max :: LocalTime -> LocalTime -> LocalTime Source #

min :: LocalTime -> LocalTime -> LocalTime Source #

Ord TimeOfDay |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeOfDay

Methods

compare :: TimeOfDay -> TimeOfDay -> Ordering Source #

(<) :: TimeOfDay -> TimeOfDay -> Bool Source #

(<=) :: TimeOfDay -> TimeOfDay -> Bool Source #

(>) :: TimeOfDay -> TimeOfDay -> Bool Source #

(>=) :: TimeOfDay -> TimeOfDay -> Bool Source #

max :: TimeOfDay -> TimeOfDay -> TimeOfDay Source #

min :: TimeOfDay -> TimeOfDay -> TimeOfDay Source #

Ord TimeZone |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeZone

Methods

compare :: TimeZone -> TimeZone -> Ordering Source #

(<) :: TimeZone -> TimeZone -> Bool Source #

(<=) :: TimeZone -> TimeZone -> Bool Source #

(>) :: TimeZone -> TimeZone -> Bool Source #

(>=) :: TimeZone -> TimeZone -> Bool Source #

max :: TimeZone -> TimeZone -> TimeZone Source #

min :: TimeZone -> TimeZone -> TimeZone Source #

Ord UUID |
Instance details Defined in Data.UUID.Types.Internal Methods compare :: UUID -> UUID -> Ordering Source # (<) :: UUID -> UUID -> Bool Source # (<=) :: UUID -> UUID -> Bool Source # (>) :: UUID -> UUID -> Bool Source # (>=) :: UUID -> UUID -> Bool Source # max :: UUID -> UUID -> UUID Source # min :: UUID -> UUID -> UUID Source #
Ord UnpackedUUID |

Instance details

Defined in Data.UUID.Types.Internal

Methods

compare :: UnpackedUUID -> UnpackedUUID -> Ordering Source #

(<) :: UnpackedUUID -> UnpackedUUID -> Bool Source #

(<=) :: UnpackedUUID -> UnpackedUUID -> Bool Source #

(>) :: UnpackedUUID -> UnpackedUUID -> Bool Source #

(>=) :: UnpackedUUID -> UnpackedUUID -> Bool Source #

max :: UnpackedUUID -> UnpackedUUID -> UnpackedUUID Source #

min :: UnpackedUUID -> UnpackedUUID -> UnpackedUUID Source #

Ord Integer |
Instance details Defined in GHC.Num.Integer Methods compare :: Integer -> Integer -> Ordering Source # (<) :: Integer -> Integer -> Bool Source # (<=) :: Integer -> Integer -> Bool Source # (>) :: Integer -> Integer -> Bool Source # (>=) :: Integer -> Integer -> Bool Source # max :: Integer -> Integer -> Integer Source # min :: Integer -> Integer -> Integer Source #
Ord () |
Instance details Defined in GHC.Classes Methods compare :: () -> () -> Ordering Source # (<) :: () -> () -> Bool Source # (<=) :: () -> () -> Bool Source # (>) :: () -> () -> Bool Source # (>=) :: () -> () -> Bool Source # max :: () -> () -> () Source # min :: () -> () -> () Source #
Ord Bool |
Instance details Defined in GHC.Classes Methods compare :: Bool -> Bool -> Ordering Source # (<) :: Bool -> Bool -> Bool Source # (<=) :: Bool -> Bool -> Bool Source # (>) :: Bool -> Bool -> Bool Source # (>=) :: Bool -> Bool -> Bool Source # max :: Bool -> Bool -> Bool Source # min :: Bool -> Bool -> Bool Source #
Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering Source # (<) :: Char -> Char -> Bool Source # (<=) :: Char -> Char -> Bool Source # (>) :: Char -> Char -> Bool Source # (>=) :: Char -> Char -> Bool Source # max :: Char -> Char -> Char Source # min :: Char -> Char -> Char Source #

Ord Double

Note that due to the presence of `NaN`, `Double`'s `Ord` instance does not satisfy reflexivity.

    >>> 0/0 <= (0/0 :: Double)
    False

Also note that, due to the same, `Ord`'s operator interactions are not respected by `Double`'s instance:

    >>> (0/0 :: Double) > 1
    False
    >>> compare (0/0 :: Double) 1
    GT

Instance details Defined in GHC.Classes Methods compare :: Double -> Double -> Ordering Source # (<) :: Double -> Double -> Bool Source # (<=) :: Double -> Double -> Bool Source # (>) :: Double -> Double -> Bool Source # (>=) :: Double -> Double -> Bool Source # max :: Double -> Double -> Double Source # min :: Double -> Double -> Double Source #

Ord Float

Note that due to the presence of `NaN`, `Float`'s `Ord` instance does not satisfy reflexivity.

    >>> 0/0 <= (0/0 :: Float)
    False

Also note that, due to the same, `Ord`'s operator interactions are not respected by `Float`'s instance:

    >>> (0/0 :: Float) > 1
    False
    >>> compare (0/0 :: Float) 1
    GT

Instance details Defined in GHC.Classes Methods compare :: Float -> Float -> Ordering Source # (<) :: Float -> Float -> Bool Source # (<=) :: Float -> Float -> Bool Source # (>) :: Float -> Float -> Bool Source # (>=) :: Float -> Float -> Bool Source # max :: Float -> Float -> Float Source # min :: Float -> Float -> Float Source #
Ord Int |
Instance details Defined in GHC.Classes Methods compare :: Int -> Int -> Ordering Source # (<) :: Int -> Int -> Bool Source # (<=) :: Int -> Int -> Bool Source # (>) :: Int -> Int -> Bool Source # (>=) :: Int -> Int -> Bool Source # max :: Int -> Int -> Int Source # min :: Int -> Int -> Int Source #
Ord Word |
Instance details Defined in GHC.Classes Methods compare :: Word -> Word -> Ordering Source # (<) :: Word -> Word -> Bool Source # (<=) :: Word -> Word -> Bool Source # (>) :: Word -> Word -> Bool Source # (>=) :: Word -> Word -> Bool Source # max :: Word -> Word -> Word Source # min :: Word -> Word -> Word Source #
Integral i => Ord (DecimalRaw i) |

Instance details

Defined in Data.Decimal

Methods

compare :: DecimalRaw i -> DecimalRaw i -> Ordering Source #

(<) :: DecimalRaw i -> DecimalRaw i -> Bool Source #

(<=) :: DecimalRaw i -> DecimalRaw i -> Bool Source #

(>) :: DecimalRaw i -> DecimalRaw i -> Bool Source #

(>=) :: DecimalRaw i -> DecimalRaw i -> Bool Source #

max :: DecimalRaw i -> DecimalRaw i -> DecimalRaw i Source #

min :: DecimalRaw i -> DecimalRaw i -> DecimalRaw i Source #

Ord a => Ord (Only a) |
Instance details Defined in Data.Tuple.Only Methods compare :: Only a -> Only a -> Ordering Source # (<) :: Only a -> Only a -> Bool Source # (<=) :: Only a -> Only a -> Bool Source # (>) :: Only a -> Only a -> Bool Source # (>=) :: Only a -> Only a -> Bool Source # max :: Only a -> Only a -> Only a Source # min :: Only a -> Only a -> Only a Source #
Ord v => Ord (KeyMap v) |
Instance details Defined in Data.Aeson.KeyMap Methods compare :: KeyMap v -> KeyMap v -> Ordering Source # (<) :: KeyMap v -> KeyMap v -> Bool Source # (<=) :: KeyMap v -> KeyMap v -> Bool Source # (>) :: KeyMap v -> KeyMap v -> Bool Source # (>=) :: KeyMap v -> KeyMap v -> Bool Source # max :: KeyMap v -> KeyMap v -> KeyMap v Source # min :: KeyMap v -> KeyMap v -> KeyMap v Source #
Ord a => Ord (ZipList a) | Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Methods

compare :: ZipList a -> ZipList a -> Ordering Source #

(<) :: ZipList a -> ZipList a -> Bool Source #

(<=) :: ZipList a -> ZipList a -> Bool Source #

(>) :: ZipList a -> ZipList a -> Bool Source #

(>=) :: ZipList a -> ZipList a -> Bool Source #

max :: ZipList a -> ZipList a -> ZipList a Source #

min :: ZipList a -> ZipList a -> ZipList a Source #

Ord a => Ord (Identity a) | Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

compare :: Identity a -> Identity a -> Ordering Source #

(<) :: Identity a -> Identity a -> Bool Source #

(<=) :: Identity a -> Identity a -> Bool Source #

(>) :: Identity a -> Identity a -> Bool Source #

(>=) :: Identity a -> Identity a -> Bool Source #

max :: Identity a -> Identity a -> Identity a Source #

min :: Identity a -> Identity a -> Identity a Source #

Ord a => Ord (Down a) | Since: base-4.6.0.0
Instance details Defined in Data.Ord Methods compare :: Down a -> Down a -> Ordering Source # (<) :: Down a -> Down a -> Bool Source # (<=) :: Down a -> Down a -> Bool Source # (>) :: Down a -> Down a -> Bool Source # (>=) :: Down a -> Down a -> Bool Source # max :: Down a -> Down a -> Down a Source # min :: Down a -> Down a -> Down a Source #
Ord a => Ord (First a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: First a -> First a -> Ordering Source # (<) :: First a -> First a -> Bool Source # (<=) :: First a -> First a -> Bool Source # (>) :: First a -> First a -> Bool Source # (>=) :: First a -> First a -> Bool Source # max :: First a -> First a -> First a Source # min :: First a -> First a -> First a Source #
Ord a => Ord (Last a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Last a -> Last a -> Ordering Source # (<) :: Last a -> Last a -> Bool Source # (<=) :: Last a -> Last a -> Bool Source # (>) :: Last a -> Last a -> Bool Source # (>=) :: Last a -> Last a -> Bool Source # max :: Last a -> Last a -> Last a Source # min :: Last a -> Last a -> Last a Source #
Ord a => Ord (Max a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Max a -> Max a -> Ordering Source # (<) :: Max a -> Max a -> Bool Source # (<=) :: Max a -> Max a -> Bool Source # (>) :: Max a -> Max a -> Bool Source # (>=) :: Max a -> Max a -> Bool Source # max :: Max a -> Max a -> Max a Source # min :: Max a -> Max a -> Max a Source #
Ord a => Ord (Min a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Min a -> Min a -> Ordering Source # (<) :: Min a -> Min a -> Bool Source # (<=) :: Min a -> Min a -> Bool Source # (>) :: Min a -> Min a -> Bool Source # (>=) :: Min a -> Min a -> Bool Source # max :: Min a -> Min a -> Min a Source # min :: Min a -> Min a -> Min a Source #
Ord m => Ord (WrappedMonoid m) | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering Source #

(<) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source #

(<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source #

(>) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source #

(>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source #

max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source #

min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source #

Ord a => Ord (Dual a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods compare :: Dual a -> Dual a -> Ordering Source # (<) :: Dual a -> Dual a -> Bool Source # (<=) :: Dual a -> Dual a -> Bool Source # (>) :: Dual a -> Dual a -> Bool Source # (>=) :: Dual a -> Dual a -> Bool Source # max :: Dual a -> Dual a -> Dual a Source # min :: Dual a -> Dual a -> Dual a Source #
Ord a => Ord (Product a) | Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Product a -> Product a -> Ordering Source #

(<) :: Product a -> Product a -> Bool Source #

(<=) :: Product a -> Product a -> Bool Source #

(>) :: Product a -> Product a -> Bool Source #

(>=) :: Product a -> Product a -> Bool Source #

max :: Product a -> Product a -> Product a Source #

min :: Product a -> Product a -> Product a Source #

Ord a => Ord (Sum a) | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods compare :: Sum a -> Sum a -> Ordering Source # (<) :: Sum a -> Sum a -> Bool Source # (<=) :: Sum a -> Sum a -> Bool Source # (>) :: Sum a -> Sum a -> Bool Source # (>=) :: Sum a -> Sum a -> Bool Source # max :: Sum a -> Sum a -> Sum a Source # min :: Sum a -> Sum a -> Sum a Source #
Ord (ForeignPtr a) | Since: base-2.1

Instance details

Defined in GHC.ForeignPtr

Methods

compare :: ForeignPtr a -> ForeignPtr a -> Ordering Source #

(<) :: ForeignPtr a -> ForeignPtr a -> Bool Source #

(<=) :: ForeignPtr a -> ForeignPtr a -> Bool Source #

(>) :: ForeignPtr a -> ForeignPtr a -> Bool Source #

(>=) :: ForeignPtr a -> ForeignPtr a -> Bool Source #

max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source #

min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source #

Ord p => Ord (Par1 p) | Since: base-4.7.0.0
Instance details Defined in GHC.Generics Methods compare :: Par1 p -> Par1 p -> Ordering Source # (<) :: Par1 p -> Par1 p -> Bool Source # (<=) :: Par1 p -> Par1 p -> Bool Source # (>) :: Par1 p -> Par1 p -> Bool Source # (>=) :: Par1 p -> Par1 p -> Bool Source # max :: Par1 p -> Par1 p -> Par1 p Source # min :: Par1 p -> Par1 p -> Par1 p Source #
Ord (FunPtr a) |
Instance details Defined in GHC.Ptr Methods compare :: FunPtr a -> FunPtr a -> Ordering Source # (<) :: FunPtr a -> FunPtr a -> Bool Source # (<=) :: FunPtr a -> FunPtr a -> Bool Source # (>) :: FunPtr a -> FunPtr a -> Bool Source # (>=) :: FunPtr a -> FunPtr a -> Bool Source # max :: FunPtr a -> FunPtr a -> FunPtr a Source # min :: FunPtr a -> FunPtr a -> FunPtr a Source #
Ord (Ptr a) | Since: base-2.1
Instance details Defined in GHC.Ptr Methods compare :: Ptr a -> Ptr a -> Ordering Source # (<) :: Ptr a -> Ptr a -> Bool Source # (<=) :: Ptr a -> Ptr a -> Bool Source # (>) :: Ptr a -> Ptr a -> Bool Source # (>=) :: Ptr a -> Ptr a -> Bool Source # max :: Ptr a -> Ptr a -> Ptr a Source # min :: Ptr a -> Ptr a -> Ptr a Source #
Integral a => Ord (Ratio a) | Since: base-2.0.1
Instance details Defined in GHC.Real Methods compare :: Ratio a -> Ratio a -> Ordering Source # (<) :: Ratio a -> Ratio a -> Bool Source # (<=) :: Ratio a -> Ratio a -> Bool Source # (>) :: Ratio a -> Ratio a -> Bool Source # (>=) :: Ratio a -> Ratio a -> Bool Source # max :: Ratio a -> Ratio a -> Ratio a Source # min :: Ratio a -> Ratio a -> Ratio a Source #
Ord a => Ord (CmdArgs a) |

Instance details

Defined in System.Console.CmdArgs.Implicit.Type

Methods

compare :: CmdArgs a -> CmdArgs a -> Ordering Source #

(<) :: CmdArgs a -> CmdArgs a -> Bool Source #

(<=) :: CmdArgs a -> CmdArgs a -> Bool Source #

(>) :: CmdArgs a -> CmdArgs a -> Bool Source #

(>=) :: CmdArgs a -> CmdArgs a -> Bool Source #

max :: CmdArgs a -> CmdArgs a -> CmdArgs a Source #

min :: CmdArgs a -> CmdArgs a -> CmdArgs a Source #

Ord a => Ord (Flush a) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods compare :: Flush a -> Flush a -> Ordering Source # (<) :: Flush a -> Flush a -> Bool Source # (<=) :: Flush a -> Flush a -> Bool Source # (>) :: Flush a -> Flush a -> Bool Source # (>=) :: Flush a -> Flush a -> Bool Source # max :: Flush a -> Flush a -> Flush a Source # min :: Flush a -> Flush a -> Flush a Source #
Ord a => Ord (IntMap a) |
Instance details Defined in Data.IntMap.Internal Methods compare :: IntMap a -> IntMap a -> Ordering Source # (<) :: IntMap a -> IntMap a -> Bool Source # (<=) :: IntMap a -> IntMap a -> Bool Source # (>) :: IntMap a -> IntMap a -> Bool Source # (>=) :: IntMap a -> IntMap a -> Bool Source # max :: IntMap a -> IntMap a -> IntMap a Source # min :: IntMap a -> IntMap a -> IntMap a Source #
Ord a => Ord (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods compare :: Seq a -> Seq a -> Ordering Source # (<) :: Seq a -> Seq a -> Bool Source # (<=) :: Seq a -> Seq a -> Bool Source # (>) :: Seq a -> Seq a -> Bool Source # (>=) :: Seq a -> Seq a -> Bool Source # max :: Seq a -> Seq a -> Seq a Source # min :: Seq a -> Seq a -> Seq a Source #
Ord a => Ord (ViewL a) |
Instance details Defined in Data.Sequence.Internal Methods compare :: ViewL a -> ViewL a -> Ordering Source # (<) :: ViewL a -> ViewL a -> Bool Source # (<=) :: ViewL a -> ViewL a -> Bool Source # (>) :: ViewL a -> ViewL a -> Bool Source # (>=) :: ViewL a -> ViewL a -> Bool Source # max :: ViewL a -> ViewL a -> ViewL a Source # min :: ViewL a -> ViewL a -> ViewL a Source #
Ord a => Ord (ViewR a) |
Instance details Defined in Data.Sequence.Internal Methods compare :: ViewR a -> ViewR a -> Ordering Source # (<) :: ViewR a -> ViewR a -> Bool Source # (<=) :: ViewR a -> ViewR a -> Bool Source # (>) :: ViewR a -> ViewR a -> Bool Source # (>=) :: ViewR a -> ViewR a -> Bool Source # max :: ViewR a -> ViewR a -> ViewR a Source # min :: ViewR a -> ViewR a -> ViewR a Source #
Ord a => Ord (Intersection a) |

Instance details

Defined in Data.Set.Internal

Methods

compare :: Intersection a -> Intersection a -> Ordering Source #

(<) :: Intersection a -> Intersection a -> Bool Source #

(<=) :: Intersection a -> Intersection a -> Bool Source #

(>) :: Intersection a -> Intersection a -> Bool Source #

(>=) :: Intersection a -> Intersection a -> Bool Source #

max :: Intersection a -> Intersection a -> Intersection a Source #

min :: Intersection a -> Intersection a -> Intersection a Source #

Ord a => Ord (Set a) |
Instance details Defined in Data.Set.Internal Methods compare :: Set a -> Set a -> Ordering Source # (<) :: Set a -> Set a -> Bool Source # (<=) :: Set a -> Set a -> Bool Source # (>) :: Set a -> Set a -> Bool Source # (>=) :: Set a -> Set a -> Bool Source # max :: Set a -> Set a -> Set a Source # min :: Set a -> Set a -> Set a Source #
Ord a => Ord (Tree a) | Since: containers-0.6.5
Instance details Defined in Data.Tree Methods compare :: Tree a -> Tree a -> Ordering Source # (<) :: Tree a -> Tree a -> Bool Source # (<=) :: Tree a -> Tree a -> Bool Source # (>) :: Tree a -> Tree a -> Bool Source # (>=) :: Tree a -> Tree a -> Bool Source # max :: Tree a -> Tree a -> Tree a Source # min :: Tree a -> Tree a -> Tree a Source #
Ord1 f => Ord (Fix f) |
Instance details Defined in Data.Fix Methods compare :: Fix f -> Fix f -> Ordering Source # (<) :: Fix f -> Fix f -> Bool Source # (<=) :: Fix f -> Fix f -> Bool Source # (>) :: Fix f -> Fix f -> Bool Source # (>=) :: Fix f -> Fix f -> Bool Source # max :: Fix f -> Fix f -> Fix f Source # min :: Fix f -> Fix f -> Fix f Source #
(Functor f, Ord1 f) => Ord (Mu f) |
Instance details Defined in Data.Fix Methods compare :: Mu f -> Mu f -> Ordering Source # (<) :: Mu f -> Mu f -> Bool Source # (<=) :: Mu f -> Mu f -> Bool Source # (>) :: Mu f -> Mu f -> Bool Source # (>=) :: Mu f -> Mu f -> Bool Source # max :: Mu f -> Mu f -> Mu f Source # min :: Mu f -> Mu f -> Mu f Source #
(Functor f, Ord1 f) => Ord (Nu f) |
Instance details Defined in Data.Fix Methods compare :: Nu f -> Nu f -> Ordering Source # (<) :: Nu f -> Nu f -> Bool Source # (<=) :: Nu f -> Nu f -> Bool Source # (>) :: Nu f -> Nu f -> Bool Source # (>=) :: Nu f -> Nu f -> Bool Source # max :: Nu f -> Nu f -> Nu f Source # min :: Nu f -> Nu f -> Nu f Source #
Ord a => Ord (DNonEmpty a) |

Instance details

Defined in Data.DList.DNonEmpty.Internal

Methods

compare :: DNonEmpty a -> DNonEmpty a -> Ordering Source #

(<) :: DNonEmpty a -> DNonEmpty a -> Bool Source #

(<=) :: DNonEmpty a -> DNonEmpty a -> Bool Source #

(>) :: DNonEmpty a -> DNonEmpty a -> Bool Source #

(>=) :: DNonEmpty a -> DNonEmpty a -> Bool Source #

max :: DNonEmpty a -> DNonEmpty a -> DNonEmpty a Source #

min :: DNonEmpty a -> DNonEmpty a -> DNonEmpty a Source #

Ord a => Ord (DList a) |
Instance details Defined in Data.DList.Internal Methods compare :: DList a -> DList a -> Ordering Source # (<) :: DList a -> DList a -> Bool Source # (<=) :: DList a -> DList a -> Bool Source # (>) :: DList a -> DList a -> Bool Source # (>=) :: DList a -> DList a -> Bool Source # max :: DList a -> DList a -> DList a Source # min :: DList a -> DList a -> DList a Source #
Ord a => Ord (Doc a) |
Instance details Defined in Text.DocLayout Methods compare :: Doc a -> Doc a -> Ordering Source # (<) :: Doc a -> Doc a -> Bool Source # (<=) :: Doc a -> Doc a -> Bool Source # (>) :: Doc a -> Doc a -> Bool Source # (>=) :: Doc a -> Doc a -> Bool Source # max :: Doc a -> Doc a -> Doc a Source # min :: Doc a -> Doc a -> Doc a Source #
Ord a => Ord (Hashed a) |
Instance details Defined in Data.Hashable.Class Methods compare :: Hashed a -> Hashed a -> Ordering Source # (<) :: Hashed a -> Hashed a -> Bool Source # (<=) :: Hashed a -> Hashed a -> Bool Source # (>) :: Hashed a -> Hashed a -> Bool Source # (>=) :: Hashed a -> Hashed a -> Bool Source # max :: Hashed a -> Hashed a -> Hashed a Source # min :: Hashed a -> Hashed a -> Hashed a Source #
Ord a => Ord (FastTree a) |

Instance details

Defined in Hledger.Data.Account

Methods

compare :: FastTree a -> FastTree a -> Ordering Source #

(<) :: FastTree a -> FastTree a -> Bool Source #

(<=) :: FastTree a -> FastTree a -> Bool Source #

(>) :: FastTree a -> FastTree a -> Bool Source #

(>=) :: FastTree a -> FastTree a -> Bool Source #

max :: FastTree a -> FastTree a -> FastTree a Source #

min :: FastTree a -> FastTree a -> FastTree a Source #

Ord e => Ord (ErrorFancy e) |

Instance details

Defined in Text.Megaparsec.Error

Methods

compare :: ErrorFancy e -> ErrorFancy e -> Ordering Source #

(<) :: ErrorFancy e -> ErrorFancy e -> Bool Source #

(<=) :: ErrorFancy e -> ErrorFancy e -> Bool Source #

(>) :: ErrorFancy e -> ErrorFancy e -> Bool Source #

(>=) :: ErrorFancy e -> ErrorFancy e -> Bool Source #

max :: ErrorFancy e -> ErrorFancy e -> ErrorFancy e Source #

min :: ErrorFancy e -> ErrorFancy e -> ErrorFancy e Source #

Ord t => Ord (ErrorItem t) |

Instance details

Defined in Text.Megaparsec.Error

Methods

compare :: ErrorItem t -> ErrorItem t -> Ordering Source #

(<) :: ErrorItem t -> ErrorItem t -> Bool Source #

(<=) :: ErrorItem t -> ErrorItem t -> Bool Source #

(>) :: ErrorItem t -> ErrorItem t -> Bool Source #

(>=) :: ErrorItem t -> ErrorItem t -> Bool Source #

max :: ErrorItem t -> ErrorItem t -> ErrorItem t Source #

min :: ErrorItem t -> ErrorItem t -> ErrorItem t Source #

Ord mono => Ord (NonNull mono) |

Instance details

Defined in Data.NonNull

Methods

compare :: NonNull mono -> NonNull mono -> Ordering Source #

(<) :: NonNull mono -> NonNull mono -> Bool Source #

(<=) :: NonNull mono -> NonNull mono -> Bool Source #

(>) :: NonNull mono -> NonNull mono -> Bool Source #

(>=) :: NonNull mono -> NonNull mono -> Bool Source #

max :: NonNull mono -> NonNull mono -> NonNull mono Source #

min :: NonNull mono -> NonNull mono -> NonNull mono Source #

Ord ann => Ord (SimpleDocStream ann) |

Instance details

Defined in Prettyprinter.Internal

Methods

compare :: SimpleDocStream ann -> SimpleDocStream ann -> Ordering Source #

(<) :: SimpleDocStream ann -> SimpleDocStream ann -> Bool Source #

(<=) :: SimpleDocStream ann -> SimpleDocStream ann -> Bool Source #

(>) :: SimpleDocStream ann -> SimpleDocStream ann -> Bool Source #

(>=) :: SimpleDocStream ann -> SimpleDocStream ann -> Bool Source #

max :: SimpleDocStream ann -> SimpleDocStream ann -> SimpleDocStream ann Source #

min :: SimpleDocStream ann -> SimpleDocStream ann -> SimpleDocStream ann Source #

Ord a => Ord (Array a) |
Instance details Defined in Data.Primitive.Array Methods compare :: Array a -> Array a -> Ordering Source # (<) :: Array a -> Array a -> Bool Source # (<=) :: Array a -> Array a -> Bool Source # (>) :: Array a -> Array a -> Bool Source # (>=) :: Array a -> Array a -> Bool Source # max :: Array a -> Array a -> Array a Source # min :: Array a -> Array a -> Array a Source #
(Ord a, Prim a) => Ord (PrimArray a) |

Instance details

Defined in Data.Primitive.PrimArray

Methods

compare :: PrimArray a -> PrimArray a -> Ordering Source #

(<) :: PrimArray a -> PrimArray a -> Bool Source #

(<=) :: PrimArray a -> PrimArray a -> Bool Source #

(>) :: PrimArray a -> PrimArray a -> Bool Source #

(>=) :: PrimArray a -> PrimArray a -> Bool Source #

max :: PrimArray a -> PrimArray a -> PrimArray a Source #

min :: PrimArray a -> PrimArray a -> PrimArray a Source #

Ord a => Ord (SmallArray a) |

Instance details

Defined in Data.Primitive.SmallArray

Methods

compare :: SmallArray a -> SmallArray a -> Ordering Source #

(<) :: SmallArray a -> SmallArray a -> Bool Source #

(<=) :: SmallArray a -> SmallArray a -> Bool Source #

(>) :: SmallArray a -> SmallArray a -> Bool Source #

(>=) :: SmallArray a -> SmallArray a -> Bool Source #

max :: SmallArray a -> SmallArray a -> SmallArray a Source #

min :: SmallArray a -> SmallArray a -> SmallArray a Source #

Ord g => Ord (StateGen g) |

Instance details

Defined in System.Random.Internal

Methods

compare :: StateGen g -> StateGen g -> Ordering Source #

(<) :: StateGen g -> StateGen g -> Bool Source #

(<=) :: StateGen g -> StateGen g -> Bool Source #

(>) :: StateGen g -> StateGen g -> Bool Source #

(>=) :: StateGen g -> StateGen g -> Bool Source #

max :: StateGen g -> StateGen g -> StateGen g Source #

min :: StateGen g -> StateGen g -> StateGen g Source #

Ord g => Ord (AtomicGen g) |

Instance details

Defined in System.Random.Stateful

Methods

compare :: AtomicGen g -> AtomicGen g -> Ordering Source #

(<) :: AtomicGen g -> AtomicGen g -> Bool Source #

(<=) :: AtomicGen g -> AtomicGen g -> Bool Source #

(>) :: AtomicGen g -> AtomicGen g -> Bool Source #

(>=) :: AtomicGen g -> AtomicGen g -> Bool Source #

max :: AtomicGen g -> AtomicGen g -> AtomicGen g Source #

min :: AtomicGen g -> AtomicGen g -> AtomicGen g Source #

Ord g => Ord (IOGen g) |
Instance details Defined in System.Random.Stateful Methods compare :: IOGen g -> IOGen g -> Ordering Source # (<) :: IOGen g -> IOGen g -> Bool Source # (<=) :: IOGen g -> IOGen g -> Bool Source # (>) :: IOGen g -> IOGen g -> Bool Source # (>=) :: IOGen g -> IOGen g -> Bool Source # max :: IOGen g -> IOGen g -> IOGen g Source # min :: IOGen g -> IOGen g -> IOGen g Source #
Ord g => Ord (STGen g) |
Instance details Defined in System.Random.Stateful Methods compare :: STGen g -> STGen g -> Ordering Source # (<) :: STGen g -> STGen g -> Bool Source # (<=) :: STGen g -> STGen g -> Bool Source # (>) :: STGen g -> STGen g -> Bool Source # (>=) :: STGen g -> STGen g -> Bool Source # max :: STGen g -> STGen g -> STGen g Source # min :: STGen g -> STGen g -> STGen g Source #
Ord g => Ord (TGen g) |
Instance details Defined in System.Random.Stateful Methods compare :: TGen g -> TGen g -> Ordering Source # (<) :: TGen g -> TGen g -> Bool Source # (<=) :: TGen g -> TGen g -> Bool Source # (>) :: TGen g -> TGen g -> Bool Source # (>=) :: TGen g -> TGen g -> Bool Source # max :: TGen g -> TGen g -> TGen g Source # min :: TGen g -> TGen g -> TGen g Source #
Ord a => Ord (Maybe a) |
Instance details Defined in Data.Strict.Maybe Methods compare :: Maybe a -> Maybe a -> Ordering Source # (<) :: Maybe a -> Maybe a -> Bool Source # (<=) :: Maybe a -> Maybe a -> Bool Source # (>) :: Maybe a -> Maybe a -> Bool Source # (>=) :: Maybe a -> Maybe a -> Bool Source # max :: Maybe a -> Maybe a -> Maybe a Source # min :: Maybe a -> Maybe a -> Maybe a Source #
Ord flag => Ord (TyVarBndr flag) |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

compare :: TyVarBndr flag -> TyVarBndr flag -> Ordering Source #

(<) :: TyVarBndr flag -> TyVarBndr flag -> Bool Source #

(<=) :: TyVarBndr flag -> TyVarBndr flag -> Bool Source #

(>) :: TyVarBndr flag -> TyVarBndr flag -> Bool Source #

(>=) :: TyVarBndr flag -> TyVarBndr flag -> Bool Source #

max :: TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag Source #

min :: TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag Source #

Ord a => Ord (HashSet a) |

Instance details

Defined in Data.HashSet.Internal

Methods

compare :: HashSet a -> HashSet a -> Ordering Source #

(<) :: HashSet a -> HashSet a -> Bool Source #

(<=) :: HashSet a -> HashSet a -> Bool Source #

(>) :: HashSet a -> HashSet a -> Bool Source #

(>=) :: HashSet a -> HashSet a -> Bool Source #

max :: HashSet a -> HashSet a -> HashSet a Source #

min :: HashSet a -> HashSet a -> HashSet a Source #

Ord a => Ord (Vector a) |
Instance details Defined in Data.Vector Methods compare :: Vector a -> Vector a -> Ordering Source # (<) :: Vector a -> Vector a -> Bool Source # (<=) :: Vector a -> Vector a -> Bool Source # (>) :: Vector a -> Vector a -> Bool Source # (>=) :: Vector a -> Vector a -> Bool Source # max :: Vector a -> Vector a -> Vector a Source # min :: Vector a -> Vector a -> Vector a Source #
(Prim a, Ord a) => Ord (Vector a) |
Instance details Defined in Data.Vector.Primitive Methods compare :: Vector a -> Vector a -> Ordering Source # (<) :: Vector a -> Vector a -> Bool Source # (<=) :: Vector a -> Vector a -> Bool Source # (>) :: Vector a -> Vector a -> Bool Source # (>=) :: Vector a -> Vector a -> Bool Source # max :: Vector a -> Vector a -> Vector a Source # min :: Vector a -> Vector a -> Vector a Source #
(Storable a, Ord a) => Ord (Vector a) |
Instance details Defined in Data.Vector.Storable Methods compare :: Vector a -> Vector a -> Ordering Source # (<) :: Vector a -> Vector a -> Bool Source # (<=) :: Vector a -> Vector a -> Bool Source # (>) :: Vector a -> Vector a -> Bool Source # (>=) :: Vector a -> Vector a -> Bool Source # max :: Vector a -> Vector a -> Vector a Source # min :: Vector a -> Vector a -> Vector a Source #
Ord a => Ord (NonEmpty a) | Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering Source #

(<) :: NonEmpty a -> NonEmpty a -> Bool Source #

(<=) :: NonEmpty a -> NonEmpty a -> Bool Source #

(>) :: NonEmpty a -> NonEmpty a -> Bool Source #

(>=) :: NonEmpty a -> NonEmpty a -> Bool Source #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a Source #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a Source #

Ord a => Ord (Maybe a) | Since: base-2.1
Instance details Defined in GHC.Maybe Methods compare :: Maybe a -> Maybe a -> Ordering Source # (<) :: Maybe a -> Maybe a -> Bool Source # (<=) :: Maybe a -> Maybe a -> Bool Source # (>) :: Maybe a -> Maybe a -> Bool Source # (>=) :: Maybe a -> Maybe a -> Bool Source # max :: Maybe a -> Maybe a -> Maybe a Source # min :: Maybe a -> Maybe a -> Maybe a Source #
Ord a => Ord (a) |
Instance details Defined in GHC.Classes Methods compare :: (a) -> (a) -> Ordering Source # (<) :: (a) -> (a) -> Bool Source # (<=) :: (a) -> (a) -> Bool Source # (>) :: (a) -> (a) -> Bool Source # (>=) :: (a) -> (a) -> Bool Source # max :: (a) -> (a) -> (a) Source # min :: (a) -> (a) -> (a) Source #
Ord a => Ord [a] |
Instance details Defined in GHC.Classes Methods compare :: [a] -> [a] -> Ordering Source # (<) :: [a] -> [a] -> Bool Source # (<=) :: [a] -> [a] -> Bool Source # (>) :: [a] -> [a] -> Bool Source # (>=) :: [a] -> [a] -> Bool Source # max :: [a] -> [a] -> [a] Source # min :: [a] -> [a] -> [a] Source #
(Ord a, Ord b) => Ord (Either a b) | Since: base-2.1

Instance details

Defined in Data.Either

Methods

compare :: Either a b -> Either a b -> Ordering Source #

(<) :: Either a b -> Either a b -> Bool Source #

(<=) :: Either a b -> Either a b -> Bool Source #

(>) :: Either a b -> Either a b -> Bool Source #

(>=) :: Either a b -> Either a b -> Bool Source #

max :: Either a b -> Either a b -> Either a b Source #

min :: Either a b -> Either a b -> Either a b Source #

Ord (Fixed a) | Since: base-2.1
Instance details Defined in Data.Fixed Methods compare :: Fixed a -> Fixed a -> Ordering Source # (<) :: Fixed a -> Fixed a -> Bool Source # (<=) :: Fixed a -> Fixed a -> Bool Source # (>) :: Fixed a -> Fixed a -> Bool Source # (>=) :: Fixed a -> Fixed a -> Bool Source # max :: Fixed a -> Fixed a -> Fixed a Source # min :: Fixed a -> Fixed a -> Fixed a Source #
Ord a => Ord (Arg a b) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Arg a b -> Arg a b -> Ordering Source # (<) :: Arg a b -> Arg a b -> Bool Source # (<=) :: Arg a b -> Arg a b -> Bool Source # (>) :: Arg a b -> Arg a b -> Bool Source # (>=) :: Arg a b -> Arg a b -> Bool Source # max :: Arg a b -> Arg a b -> Arg a b Source # min :: Arg a b -> Arg a b -> Arg a b Source #
Ord (TypeRep a) | Since: base-4.4.0.0

Instance details

Defined in Data.Typeable.Internal

Methods

compare :: TypeRep a -> TypeRep a -> Ordering Source #

(<) :: TypeRep a -> TypeRep a -> Bool Source #

(<=) :: TypeRep a -> TypeRep a -> Bool Source #

(>) :: TypeRep a -> TypeRep a -> Bool Source #

(>=) :: TypeRep a -> TypeRep a -> Bool Source #

max :: TypeRep a -> TypeRep a -> TypeRep a Source #

min :: TypeRep a -> TypeRep a -> TypeRep a Source #

Ord (U1 p) | Since: base-4.7.0.0
Instance details Defined in GHC.Generics Methods compare :: U1 p -> U1 p -> Ordering Source # (<) :: U1 p -> U1 p -> Bool Source # (<=) :: U1 p -> U1 p -> Bool Source # (>) :: U1 p -> U1 p -> Bool Source # (>=) :: U1 p -> U1 p -> Bool Source # max :: U1 p -> U1 p -> U1 p Source # min :: U1 p -> U1 p -> U1 p Source #
Ord (V1 p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods compare :: V1 p -> V1 p -> Ordering Source # (<) :: V1 p -> V1 p -> Bool Source # (<=) :: V1 p -> V1 p -> Bool Source # (>) :: V1 p -> V1 p -> Bool Source # (>=) :: V1 p -> V1 p -> Bool Source # max :: V1 p -> V1 p -> V1 p Source # min :: V1 p -> V1 p -> V1 p Source #
(Ord k, Ord v) => Ord (Map k v) |
Instance details Defined in Data.Map.Internal Methods compare :: Map k v -> Map k v -> Ordering Source # (<) :: Map k v -> Map k v -> Bool Source # (<=) :: Map k v -> Map k v -> Bool Source # (>) :: Map k v -> Map k v -> Bool Source # (>=) :: Map k v -> Map k v -> Bool Source # max :: Map k v -> Map k v -> Map k v Source # min :: Map k v -> Map k v -> Map k v Source #
(Ord a, Ord1 f) => Ord (Free f a) |
Instance details Defined in Control.Monad.Free Methods compare :: Free f a -> Free f a -> Ordering Source # (<) :: Free f a -> Free f a -> Bool Source # (<=) :: Free f a -> Free f a -> Bool Source # (>) :: Free f a -> Free f a -> Bool Source # (>=) :: Free f a -> Free f a -> Bool Source # max :: Free f a -> Free f a -> Free f a Source # min :: Free f a -> Free f a -> Free f a Source #
Ord (ParseError Text HledgerParseErrorData) |

Instance details

Defined in Text.Megaparsec.Custom

Methods

compare :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Ordering Source #

(<) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(<=) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(>) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(>=) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

max :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData Source #

min :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData Source #

(Ord a, Ord b) => Ord (Either a b) |

Instance details

Defined in Data.Strict.Either

Methods

compare :: Either a b -> Either a b -> Ordering Source #

(<) :: Either a b -> Either a b -> Bool Source #

(<=) :: Either a b -> Either a b -> Bool Source #

(>) :: Either a b -> Either a b -> Bool Source #

(>=) :: Either a b -> Either a b -> Bool Source #

max :: Either a b -> Either a b -> Either a b Source #

min :: Either a b -> Either a b -> Either a b Source #

(Ord a, Ord b) => Ord (These a b) |

Instance details

Defined in Data.Strict.These

Methods

compare :: These a b -> These a b -> Ordering Source #

(<) :: These a b -> These a b -> Bool Source #

(<=) :: These a b -> These a b -> Bool Source #

(>) :: These a b -> These a b -> Bool Source #

(>=) :: These a b -> These a b -> Bool Source #

max :: These a b -> These a b -> These a b Source #

min :: These a b -> These a b -> These a b Source #

(Ord a, Ord b) => Ord (Pair a b) |
Instance details Defined in Data.Strict.Tuple Methods compare :: Pair a b -> Pair a b -> Ordering Source # (<) :: Pair a b -> Pair a b -> Bool Source # (<=) :: Pair a b -> Pair a b -> Bool Source # (>) :: Pair a b -> Pair a b -> Bool Source # (>=) :: Pair a b -> Pair a b -> Bool Source # max :: Pair a b -> Pair a b -> Pair a b Source # min :: Pair a b -> Pair a b -> Pair a b Source #
(Ord a, Ord b) => Ord (These a b) |
Instance details Defined in Data.These Methods compare :: These a b -> These a b -> Ordering Source # (<) :: These a b -> These a b -> Bool Source # (<=) :: These a b -> These a b -> Bool Source # (>) :: These a b -> These a b -> Bool Source # (>=) :: These a b -> These a b -> Bool Source # max :: These a b -> These a b -> These a b Source # min :: These a b -> These a b -> These a b Source #
(Ord1 m, Ord a) => Ord (MaybeT m a) |

Instance details

Defined in Control.Monad.Trans.Maybe

Methods

compare :: MaybeT m a -> MaybeT m a -> Ordering Source #

(<) :: MaybeT m a -> MaybeT m a -> Bool Source #

(<=) :: MaybeT m a -> MaybeT m a -> Bool Source #

(>) :: MaybeT m a -> MaybeT m a -> Bool Source #

(>=) :: MaybeT m a -> MaybeT m a -> Bool Source #

max :: MaybeT m a -> MaybeT m a -> MaybeT m a Source #

min :: MaybeT m a -> MaybeT m a -> MaybeT m a Source #

(Ord k, Ord v) => Ord (HashMap k v) | The ordering is total and consistent with the `Eq` instance. However, nothing else about the ordering is specified, and it may change from version to version of either this package or of hashable.

Instance details

Defined in Data.HashMap.Internal

Methods

compare :: HashMap k v -> HashMap k v -> Ordering Source #

(<) :: HashMap k v -> HashMap k v -> Bool Source #

(<=) :: HashMap k v -> HashMap k v -> Bool Source #

(>) :: HashMap k v -> HashMap k v -> Bool Source #

(>=) :: HashMap k v -> HashMap k v -> Bool Source #

max :: HashMap k v -> HashMap k v -> HashMap k v Source #

min :: HashMap k v -> HashMap k v -> HashMap k v Source #

(Ord a, Ord b) => Ord (a, b) |
Instance details Defined in GHC.Classes Methods compare :: (a, b) -> (a, b) -> Ordering Source # (<) :: (a, b) -> (a, b) -> Bool Source # (<=) :: (a, b) -> (a, b) -> Bool Source # (>) :: (a, b) -> (a, b) -> Bool Source # (>=) :: (a, b) -> (a, b) -> Bool Source # max :: (a, b) -> (a, b) -> (a, b) Source # min :: (a, b) -> (a, b) -> (a, b) Source #
Ord a => Ord (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

compare :: Const a b -> Const a b -> Ordering Source #

(<) :: Const a b -> Const a b -> Bool Source #

(<=) :: Const a b -> Const a b -> Bool Source #

(>) :: Const a b -> Const a b -> Bool Source #

(>=) :: Const a b -> Const a b -> Bool Source #

max :: Const a b -> Const a b -> Const a b Source #

min :: Const a b -> Const a b -> Const a b Source #

Ord (f a) => Ord (Alt f a) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods compare :: Alt f a -> Alt f a -> Ordering Source # (<) :: Alt f a -> Alt f a -> Bool Source # (<=) :: Alt f a -> Alt f a -> Bool Source # (>) :: Alt f a -> Alt f a -> Bool Source # (>=) :: Alt f a -> Alt f a -> Bool Source # max :: Alt f a -> Alt f a -> Alt f a Source # min :: Alt f a -> Alt f a -> Alt f a Source #
Ord (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods compare :: (a :~: b) -> (a :~: b) -> Ordering Source # (<) :: (a :~: b) -> (a :~: b) -> Bool Source # (<=) :: (a :~: b) -> (a :~: b) -> Bool Source # (>) :: (a :~: b) -> (a :~: b) -> Bool Source # (>=) :: (a :~: b) -> (a :~: b) -> Bool Source # max :: (a :~: b) -> (a :~: b) -> a :~: b Source # min :: (a :~: b) -> (a :~: b) -> a :~: b Source #
Ord (f p) => Ord (Rec1 f p) | Since: base-4.7.0.0
Instance details Defined in GHC.Generics Methods compare :: Rec1 f p -> Rec1 f p -> Ordering Source # (<) :: Rec1 f p -> Rec1 f p -> Bool Source # (<=) :: Rec1 f p -> Rec1 f p -> Bool Source # (>) :: Rec1 f p -> Rec1 f p -> Bool Source # (>=) :: Rec1 f p -> Rec1 f p -> Bool Source # max :: Rec1 f p -> Rec1 f p -> Rec1 f p Source # min :: Rec1 f p -> Rec1 f p -> Rec1 f p Source #
Ord (URec (Ptr ()) p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering Source #

(<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #

(<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #

(>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #

(>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #

max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source #

min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source #

Ord (URec Char p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Char p -> URec Char p -> Ordering Source #

(<) :: URec Char p -> URec Char p -> Bool Source #

(<=) :: URec Char p -> URec Char p -> Bool Source #

(>) :: URec Char p -> URec Char p -> Bool Source #

(>=) :: URec Char p -> URec Char p -> Bool Source #

max :: URec Char p -> URec Char p -> URec Char p Source #

min :: URec Char p -> URec Char p -> URec Char p Source #

Ord (URec Double p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Double p -> URec Double p -> Ordering Source #

(<) :: URec Double p -> URec Double p -> Bool Source #

(<=) :: URec Double p -> URec Double p -> Bool Source #

(>) :: URec Double p -> URec Double p -> Bool Source #

(>=) :: URec Double p -> URec Double p -> Bool Source #

max :: URec Double p -> URec Double p -> URec Double p Source #

min :: URec Double p -> URec Double p -> URec Double p Source #

Ord (URec Float p) |

Instance details

Defined in GHC.Generics

Methods

compare :: URec Float p -> URec Float p -> Ordering Source #

(<) :: URec Float p -> URec Float p -> Bool Source #

(<=) :: URec Float p -> URec Float p -> Bool Source #

(>) :: URec Float p -> URec Float p -> Bool Source #

(>=) :: URec Float p -> URec Float p -> Bool Source #

max :: URec Float p -> URec Float p -> URec Float p Source #

min :: URec Float p -> URec Float p -> URec Float p Source #

Ord (URec Int p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Int p -> URec Int p -> Ordering Source #

(<) :: URec Int p -> URec Int p -> Bool Source #

(<=) :: URec Int p -> URec Int p -> Bool Source #

(>) :: URec Int p -> URec Int p -> Bool Source #

(>=) :: URec Int p -> URec Int p -> Bool Source #

max :: URec Int p -> URec Int p -> URec Int p Source #

min :: URec Int p -> URec Int p -> URec Int p Source #

Ord (URec Word p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Word p -> URec Word p -> Ordering Source #

(<) :: URec Word p -> URec Word p -> Bool Source #

(<=) :: URec Word p -> URec Word p -> Bool Source #

(>) :: URec Word p -> URec Word p -> Bool Source #

(>=) :: URec Word p -> URec Word p -> Bool Source #

max :: URec Word p -> URec Word p -> URec Word p Source #

min :: URec Word p -> URec Word p -> URec Word p Source #

Ord (p a a) => Ord (Join p a) |
Instance details Defined in Data.Bifunctor.Join Methods compare :: Join p a -> Join p a -> Ordering Source # (<) :: Join p a -> Join p a -> Bool Source # (<=) :: Join p a -> Join p a -> Bool Source # (>) :: Join p a -> Join p a -> Bool Source # (>=) :: Join p a -> Join p a -> Bool Source # max :: Join p a -> Join p a -> Join p a Source # min :: Join p a -> Join p a -> Join p a Source #
Ord b => Ord (Tagged s b) |

Instance details

Defined in Data.Tagged

Methods

compare :: Tagged s b -> Tagged s b -> Ordering Source #

(<) :: Tagged s b -> Tagged s b -> Bool Source #

(<=) :: Tagged s b -> Tagged s b -> Bool Source #

(>) :: Tagged s b -> Tagged s b -> Bool Source #

(>=) :: Tagged s b -> Tagged s b -> Bool Source #

max :: Tagged s b -> Tagged s b -> Tagged s b Source #

min :: Tagged s b -> Tagged s b -> Tagged s b Source #

(Ord (f a), Ord (g a), Ord a) => Ord (These1 f g a) |

Instance details

Defined in Data.Functor.These

Methods

compare :: These1 f g a -> These1 f g a -> Ordering Source #

(<) :: These1 f g a -> These1 f g a -> Bool Source #

(<=) :: These1 f g a -> These1 f g a -> Bool Source #

(>) :: These1 f g a -> These1 f g a -> Bool Source #

(>=) :: These1 f g a -> These1 f g a -> Bool Source #

max :: These1 f g a -> These1 f g a -> These1 f g a Source #

min :: These1 f g a -> These1 f g a -> These1 f g a Source #

(Ord e, Ord1 m, Ord a) => Ord (ErrorT e m a) |

Instance details

Defined in Control.Monad.Trans.Error

Methods

compare :: ErrorT e m a -> ErrorT e m a -> Ordering Source #

(<) :: ErrorT e m a -> ErrorT e m a -> Bool Source #

(<=) :: ErrorT e m a -> ErrorT e m a -> Bool Source #

(>) :: ErrorT e m a -> ErrorT e m a -> Bool Source #

(>=) :: ErrorT e m a -> ErrorT e m a -> Bool Source #

max :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a Source #

min :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a Source #

(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a) |

Instance details

Defined in Control.Monad.Trans.Except

Methods

compare :: ExceptT e m a -> ExceptT e m a -> Ordering Source #

(<) :: ExceptT e m a -> ExceptT e m a -> Bool Source #

(<=) :: ExceptT e m a -> ExceptT e m a -> Bool Source #

(>) :: ExceptT e m a -> ExceptT e m a -> Bool Source #

(>=) :: ExceptT e m a -> ExceptT e m a -> Bool Source #

max :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

min :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

(Ord a, Ord b, Ord c) => Ord (a, b, c) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c) -> (a, b, c) -> Ordering Source # (<) :: (a, b, c) -> (a, b, c) -> Bool Source # (<=) :: (a, b, c) -> (a, b, c) -> Bool Source # (>) :: (a, b, c) -> (a, b, c) -> Bool Source # (>=) :: (a, b, c) -> (a, b, c) -> Bool Source # max :: (a, b, c) -> (a, b, c) -> (a, b, c) Source # min :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #
Ord (a :~~: b) | Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

Methods

compare :: (a :~~: b) -> (a :~~: b) -> Ordering Source #

(<) :: (a :~~: b) -> (a :~~: b) -> Bool Source #

(<=) :: (a :~~: b) -> (a :~~: b) -> Bool Source #

(>) :: (a :~~: b) -> (a :~~: b) -> Bool Source #

(>=) :: (a :~~: b) -> (a :~~: b) -> Bool Source #

max :: (a :~~: b) -> (a :~~: b) -> a :~~: b Source #

min :: (a :~~: b) -> (a :~~: b) -> a :~~: b Source #

(Ord (f p), Ord (g p)) => Ord ((f :*: g) p) | Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :*: g) p -> (f :*: g) p -> Ordering Source #

(<) :: (f :*: g) p -> (f :*: g) p -> Bool Source #

(<=) :: (f :*: g) p -> (f :*: g) p -> Bool Source #

(>) :: (f :*: g) p -> (f :*: g) p -> Bool Source #

(>=) :: (f :*: g) p -> (f :*: g) p -> Bool Source #

max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source #

min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source #

(Ord (f p), Ord (g p)) => Ord ((f :+: g) p) | Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :+: g) p -> (f :+: g) p -> Ordering Source #

(<) :: (f :+: g) p -> (f :+: g) p -> Bool Source #

(<=) :: (f :+: g) p -> (f :+: g) p -> Bool Source #

(>) :: (f :+: g) p -> (f :+: g) p -> Bool Source #

(>=) :: (f :+: g) p -> (f :+: g) p -> Bool Source #

max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p Source #

min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p Source #

Ord c => Ord (K1 i c p) | Since: base-4.7.0.0
Instance details Defined in GHC.Generics Methods compare :: K1 i c p -> K1 i c p -> Ordering Source # (<) :: K1 i c p -> K1 i c p -> Bool Source # (<=) :: K1 i c p -> K1 i c p -> Bool Source # (>) :: K1 i c p -> K1 i c p -> Bool Source # (>=) :: K1 i c p -> K1 i c p -> Bool Source # max :: K1 i c p -> K1 i c p -> K1 i c p Source # min :: K1 i c p -> K1 i c p -> K1 i c p Source #
(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering Source #

(<) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #

(<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #

(>) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #

(>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #

max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

(Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

compare :: Compose f g a -> Compose f g a -> Ordering Source #

(<) :: Compose f g a -> Compose f g a -> Bool Source #

(<=) :: Compose f g a -> Compose f g a -> Bool Source #

(>) :: Compose f g a -> Compose f g a -> Bool Source #

(>=) :: Compose f g a -> Compose f g a -> Bool Source #

max :: Compose f g a -> Compose f g a -> Compose f g a Source #

min :: Compose f g a -> Compose f g a -> Compose f g a Source #

Ord (f (g p)) => Ord ((f :.: g) p) | Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :.: g) p -> (f :.: g) p -> Ordering Source #

(<) :: (f :.: g) p -> (f :.: g) p -> Bool Source #

(<=) :: (f :.: g) p -> (f :.: g) p -> Bool Source #

(>) :: (f :.: g) p -> (f :.: g) p -> Bool Source #

(>=) :: (f :.: g) p -> (f :.: g) p -> Bool Source #

max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source #

min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source #

Ord (f p) => Ord (M1 i c f p) | Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: M1 i c f p -> M1 i c f p -> Ordering Source #

(<) :: M1 i c f p -> M1 i c f p -> Bool Source #

(<=) :: M1 i c f p -> M1 i c f p -> Bool Source #

(>) :: M1 i c f p -> M1 i c f p -> Bool Source #

(>=) :: M1 i c f p -> M1 i c f p -> Bool Source #

max :: M1 i c f p -> M1 i c f p -> M1 i c f p Source #

min :: M1 i c f p -> M1 i c f p -> M1 i c f p Source #

Ord (f a) => Ord (Clown f a b) |

Instance details

Defined in Data.Bifunctor.Clown

Methods

compare :: Clown f a b -> Clown f a b -> Ordering Source #

(<) :: Clown f a b -> Clown f a b -> Bool Source #

(<=) :: Clown f a b -> Clown f a b -> Bool Source #

(>) :: Clown f a b -> Clown f a b -> Bool Source #

(>=) :: Clown f a b -> Clown f a b -> Bool Source #

max :: Clown f a b -> Clown f a b -> Clown f a b Source #

min :: Clown f a b -> Clown f a b -> Clown f a b Source #

Ord (p b a) => Ord (Flip p a b) |

Instance details

Defined in Data.Bifunctor.Flip

Methods

compare :: Flip p a b -> Flip p a b -> Ordering Source #

(<) :: Flip p a b -> Flip p a b -> Bool Source #

(<=) :: Flip p a b -> Flip p a b -> Bool Source #

(>) :: Flip p a b -> Flip p a b -> Bool Source #

(>=) :: Flip p a b -> Flip p a b -> Bool Source #

max :: Flip p a b -> Flip p a b -> Flip p a b Source #

min :: Flip p a b -> Flip p a b -> Flip p a b Source #

Ord (g b) => Ord (Joker g a b) |

Instance details

Defined in Data.Bifunctor.Joker

Methods

compare :: Joker g a b -> Joker g a b -> Ordering Source #

(<) :: Joker g a b -> Joker g a b -> Bool Source #

(<=) :: Joker g a b -> Joker g a b -> Bool Source #

(>) :: Joker g a b -> Joker g a b -> Bool Source #

(>=) :: Joker g a b -> Joker g a b -> Bool Source #

max :: Joker g a b -> Joker g a b -> Joker g a b Source #

min :: Joker g a b -> Joker g a b -> Joker g a b Source #

Ord (p a b) => Ord (WrappedBifunctor p a b) |

Instance details

Defined in Data.Bifunctor.Wrapped

Methods

compare :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Ordering Source #

(<) :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Bool Source #

(<=) :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Bool Source #

(>) :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Bool Source #

(>=) :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> Bool Source #

max :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> WrappedBifunctor p a b Source #

min :: WrappedBifunctor p a b -> WrappedBifunctor p a b -> WrappedBifunctor p a b Source #

(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering Source #

(<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #

(<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #

(>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #

(>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #

max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

(Ord (f a b), Ord (g a b)) => Ord (Product f g a b) |

Instance details

Defined in Data.Bifunctor.Product

Methods

compare :: Product f g a b -> Product f g a b -> Ordering Source #

(<) :: Product f g a b -> Product f g a b -> Bool Source #

(<=) :: Product f g a b -> Product f g a b -> Bool Source #

(>) :: Product f g a b -> Product f g a b -> Bool Source #

(>=) :: Product f g a b -> Product f g a b -> Bool Source #

max :: Product f g a b -> Product f g a b -> Product f g a b Source #

min :: Product f g a b -> Product f g a b -> Product f g a b Source #

(Ord (p a b), Ord (q a b)) => Ord (Sum p q a b) |

Instance details

Defined in Data.Bifunctor.Sum

Methods

compare :: Sum p q a b -> Sum p q a b -> Ordering Source #

(<) :: Sum p q a b -> Sum p q a b -> Bool Source #

(<=) :: Sum p q a b -> Sum p q a b -> Bool Source #

(>) :: Sum p q a b -> Sum p q a b -> Bool Source #

(>=) :: Sum p q a b -> Sum p q a b -> Bool Source #

max :: Sum p q a b -> Sum p q a b -> Sum p q a b Source #

min :: Sum p q a b -> Sum p q a b -> Sum p q a b Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering Source #

(<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #

(<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #

(>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #

(>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #

max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

Ord (f (p a b)) => Ord (Tannen f p a b) |

Instance details

Defined in Data.Bifunctor.Tannen

Methods

compare :: Tannen f p a b -> Tannen f p a b -> Ordering Source #

(<) :: Tannen f p a b -> Tannen f p a b -> Bool Source #

(<=) :: Tannen f p a b -> Tannen f p a b -> Bool Source #

(>) :: Tannen f p a b -> Tannen f p a b -> Bool Source #

(>=) :: Tannen f p a b -> Tannen f p a b -> Bool Source #

max :: Tannen f p a b -> Tannen f p a b -> Tannen f p a b Source #

min :: Tannen f p a b -> Tannen f p a b -> Tannen f p a b Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #

(>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #

max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #

max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #

min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #

Ord (p (f a) (g b)) => Ord (Biff p f g a b) |

Instance details

Defined in Data.Bifunctor.Biff

Methods

compare :: Biff p f g a b -> Biff p f g a b -> Ordering Source #

(<) :: Biff p f g a b -> Biff p f g a b -> Bool Source #

(<=) :: Biff p f g a b -> Biff p f g a b -> Bool Source #

(>) :: Biff p f g a b -> Biff p f g a b -> Bool Source #

(>=) :: Biff p f g a b -> Biff p f g a b -> Bool Source #

max :: Biff p f g a b -> Biff p f g a b -> Biff p f g a b Source #

min :: Biff p f g a b -> Biff p f g a b -> Biff p f g a b Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) Source #

min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) Source #

min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) Source #

min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) Source #

min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) |

Instance details

Defined in GHC.Classes

Methods

compare :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Ordering Source #

(<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #

(>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #

(>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool Source #

max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

data Text Source #

A space efficient, packed, unboxed Unicode text type.

#### Instances

Instances details

FromJSON Text |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser Text Source # parseJSONList :: Value -> Parser [Text] Source #
FromJSONKey Text |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction Text Source # fromJSONKeyList :: FromJSONKeyFunction [Text] Source #
ToJSON Text |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Text -> Value Source # toEncoding :: Text -> Encoding Source # toJSONList :: [Text] -> Value Source # toEncodingList :: [Text] -> Encoding Source #
ToJSONKey Text |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction Text Source # toJSONKeyList :: ToJSONKeyFunction [Text] Source #
Chunk Text |
Instance details Defined in Data.Attoparsec.Internal.Types Associated Types type ChunkElem Text Methods nullChunk :: Text -> Bool pappendChunk :: State Text -> Text -> State Text atBufferEnd :: Text -> State Text -> Pos bufferElemAt :: Text -> Pos -> State Text -> Maybe (ChunkElem Text, Int) chunkElemToChar :: Text -> ChunkElem Text -> Char
Show CsvRules |
Instance details Defined in Hledger.Read.RulesReader Methods showsPrec :: Int -> CsvRules -> ShowS Source # show :: CsvRules -> String Source # showList :: [CsvRules] -> ShowS Source #
HasChars Text |
Instance details Defined in Text.DocLayout Methods foldrChar :: (Char -> b -> b) -> b -> Text -> b foldlChar :: (b -> Char -> b) -> b -> Text -> b replicateChar :: Int -> Char -> Text isNull :: Text -> Bool splitLines :: Text -> [Text]
Eq CsvRules |
Instance details Defined in Hledger.Read.RulesReader Methods (==) :: CsvRules -> CsvRules -> Bool Source # (/=) :: CsvRules -> CsvRules -> Bool Source #
Hashable Text |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Text -> Int Source # hash :: Text -> Int Source #
Anon Text Source # |
Instance details Defined in Hledger.Cli.Anon Methods anon :: Text -> Text Source #
ToHtml Text |
Instance details Defined in Lucid.Base Methods toHtml :: forall (m :: Type -> Type). Monad m => Text -> HtmlT m () Source # toHtmlRaw :: forall (m :: Type -> Type). Monad m => Text -> HtmlT m () Source #
Stream Text |

Instance details

Defined in Text.Megaparsec.Stream

Associated Types

type Token Text Source #

type Tokens Text Source #

Methods

tokenToChunk :: Proxy Text -> Token Text -> Tokens Text Source #

tokensToChunk :: Proxy Text -> [Token Text] -> Tokens Text Source #

chunkToTokens :: Proxy Text -> Tokens Text -> [Token Text] Source #

chunkLength :: Proxy Text -> Tokens Text -> Int Source #

chunkEmpty :: Proxy Text -> Tokens Text -> Bool Source #

take1_ :: Text -> Maybe (Token Text, Text) Source #

takeN_ :: Int -> Text -> Maybe (Tokens Text, Text) Source #

takeWhile_ :: (Token Text -> Bool) -> Text -> (Tokens Text, Text) Source #

TraversableStream Text |
Instance details Defined in Text.Megaparsec.Stream Methods reachOffset :: Int -> PosState Text -> (Maybe String, PosState Text) Source # reachOffsetNoLine :: Int -> PosState Text -> PosState Text Source #
VisualStream Text |
Instance details Defined in Text.Megaparsec.Stream Methods showTokens :: Proxy Text -> NonEmpty (Token Text) -> String Source # tokensLength :: Proxy Text -> NonEmpty (Token Text) -> Int Source #
GrowingAppend Text |
Instance details Defined in Data.MonoTraversable
MonoFoldable Text |

Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element Text -> m) -> Text -> m

ofoldr :: (Element Text -> b -> b) -> b -> Text -> b

ofoldl' :: (a -> Element Text -> a) -> a -> Text -> a

otoList :: Text -> [Element Text]

oall :: (Element Text -> Bool) -> Text -> Bool

oany :: (Element Text -> Bool) -> Text -> Bool

onull :: Text -> Bool

olength :: Text -> Int

olength64 :: Text -> Int64

ocompareLength :: Integral i => Text -> i -> Ordering

otraverse_ :: Applicative f => (Element Text -> f b) -> Text -> f ()

ofor_ :: Applicative f => Text -> (Element Text -> f b) -> f ()

omapM_ :: Applicative m => (Element Text -> m ()) -> Text -> m ()

oforM_ :: Applicative m => Text -> (Element Text -> m ()) -> m ()

ofoldlM :: Monad m => (a -> Element Text -> m a) -> a -> Text -> m a

ofoldMap1Ex :: Semigroup m => (Element Text -> m) -> Text -> m

ofoldr1Ex :: (Element Text -> Element Text -> Element Text) -> Text -> Element Text

ofoldl1Ex' :: (Element Text -> Element Text -> Element Text) -> Text -> Element Text

headEx :: Text -> Element Text

lastEx :: Text -> Element Text

unsafeHead :: Text -> Element Text

unsafeLast :: Text -> Element Text

maximumByEx :: (Element Text -> Element Text -> Ordering) -> Text -> Element Text

minimumByEx :: (Element Text -> Element Text -> Ordering) -> Text -> Element Text

oelem :: Element Text -> Text -> Bool

onotElem :: Element Text -> Text -> Bool

MonoFunctor Text |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element Text -> Element Text) -> Text -> Text
MonoPointed Text |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element Text -> Text
MonoTraversable Text |
Instance details Defined in Data.MonoTraversable Methods otraverse :: Applicative f => (Element Text -> f (Element Text)) -> Text -> f Text omapM :: Applicative m => (Element Text -> m (Element Text)) -> Text -> m Text
IsSequence Text |

Instance details

Defined in Data.Sequences

Methods

fromList :: [Element Text] -> Text

lengthIndex :: Text -> Index Text

break :: (Element Text -> Bool) -> Text -> (Text, Text)

span :: (Element Text -> Bool) -> Text -> (Text, Text)

dropWhile :: (Element Text -> Bool) -> Text -> Text

takeWhile :: (Element Text -> Bool) -> Text -> Text

splitAt :: Index Text -> Text -> (Text, Text)

unsafeSplitAt :: Index Text -> Text -> (Text, Text)

take :: Index Text -> Text -> Text

unsafeTake :: Index Text -> Text -> Text

drop :: Index Text -> Text -> Text

unsafeDrop :: Index Text -> Text -> Text

dropEnd :: Index Text -> Text -> Text

partition :: (Element Text -> Bool) -> Text -> (Text, Text)

uncons :: Text -> Maybe (Element Text, Text)

unsnoc :: Text -> Maybe (Text, Element Text)

filter :: (Element Text -> Bool) -> Text -> Text

filterM :: Monad m => (Element Text -> m Bool) -> Text -> m Text

replicate :: Index Text -> Element Text -> Text

replicateM :: Monad m => Index Text -> m (Element Text) -> m Text

groupBy :: (Element Text -> Element Text -> Bool) -> Text -> [Text]

groupAllOn :: Eq b => (Element Text -> b) -> Text -> [Text]

subsequences :: Text -> [Text]

permutations :: Text -> [Text]

tailEx :: Text -> Text

tailMay :: Text -> Maybe Text

initEx :: Text -> Text

initMay :: Text -> Maybe Text

unsafeTail :: Text -> Text

unsafeInit :: Text -> Text

index :: Text -> Index Text -> Maybe (Element Text)

indexEx :: Text -> Index Text -> Element Text

unsafeIndex :: Text -> Index Text -> Element Text

splitWhen :: (Element Text -> Bool) -> Text -> [Text]

SemiSequence Text |
Instance details Defined in Data.Sequences Associated Types type Index Text Methods intersperse :: Element Text -> Text -> Text reverse :: Text -> Text find :: (Element Text -> Bool) -> Text -> Maybe (Element Text) sortBy :: (Element Text -> Element Text -> Ordering) -> Text -> Text cons :: Element Text -> Text -> Text snoc :: Text -> Element Text -> Text
Textual Text |
Instance details Defined in Data.Sequences Methods words :: Text -> [Text] unwords :: (Element seq ~ Text, MonoFoldable seq) => seq -> Text lines :: Text -> [Text] unlines :: (Element seq ~ Text, MonoFoldable seq) => seq -> Text toLower :: Text -> Text toUpper :: Text -> Text toCaseFold :: Text -> Text breakWord :: Text -> (Text, Text) breakLine :: Text -> (Text, Text)
Pretty Text |
Instance details Defined in Prettyprinter.Internal Methods pretty :: Text -> Doc ann prettyList :: [Text] -> Doc ann
Extract Text |
Instance details Defined in Text.Regex.Base.RegexLike Methods before :: Int -> Text -> Text after :: Int -> Text -> Text empty :: Text extract :: (Int, Int) -> Text -> Text
Term Text Attribute | Some terms (like `style_`, `title_`) can be used for attributes as well as elements.
Instance details Defined in Lucid.Base Methods term :: Text -> Text -> Attribute Source # termWith :: Text -> [Attribute] -> Text -> Attribute Source #
TermRaw Text Attribute | Some termRaws (like `style_`, `title_`) can be used for attributes as well as elements.
Instance details Defined in Lucid.Base Methods termRaw :: Text -> Text -> Attribute Source # termRawWith :: Text -> [Attribute] -> Text -> Attribute Source #
LazySequence Text Text |
Instance details Defined in Data.Sequences Methods toChunks :: Text -> [Text0] fromChunks :: [Text0] -> Text toStrict :: Text -> Text0 fromStrict :: Text0 -> Text
Utf8 Text ByteString |
Instance details Defined in Data.Sequences Methods encodeUtf8 :: Text -> ByteString decodeUtf8 :: ByteString -> Text
(Monad m, a ~ ()) => TermRaw Text (HtmlT m a) | Given children immediately, just use that and expect no attributes.
Instance details Defined in Lucid.Base Methods termRaw :: Text -> Text -> HtmlT m a Source # termRawWith :: Text -> [Attribute] -> Text -> HtmlT m a Source #
Stream (NoShareInput Text) |

Instance details

Defined in Text.Megaparsec.Stream

Associated Types

type Token (NoShareInput Text) Source #

type Tokens (NoShareInput Text) Source #

Methods

tokenToChunk :: Proxy (NoShareInput Text) -> Token (NoShareInput Text) -> Tokens (NoShareInput Text) Source #

tokensToChunk :: Proxy (NoShareInput Text) -> [Token (NoShareInput Text)] -> Tokens (NoShareInput Text) Source #

chunkToTokens :: Proxy (NoShareInput Text) -> Tokens (NoShareInput Text) -> [Token (NoShareInput Text)] Source #

chunkLength :: Proxy (NoShareInput Text) -> Tokens (NoShareInput Text) -> Int Source #

chunkEmpty :: Proxy (NoShareInput Text) -> Tokens (NoShareInput Text) -> Bool Source #

take1_ :: NoShareInput Text -> Maybe (Token (NoShareInput Text), NoShareInput Text) Source #

takeN_ :: Int -> NoShareInput Text -> Maybe (Tokens (NoShareInput Text), NoShareInput Text) Source #

takeWhile_ :: (Token (NoShareInput Text) -> Bool) -> NoShareInput Text -> (Tokens (NoShareInput Text), NoShareInput Text) Source #

Stream (ShareInput Text) |

Instance details

Defined in Text.Megaparsec.Stream

Associated Types

type Token (ShareInput Text) Source #

type Tokens (ShareInput Text) Source #

Methods

tokenToChunk :: Proxy (ShareInput Text) -> Token (ShareInput Text) -> Tokens (ShareInput Text) Source #

tokensToChunk :: Proxy (ShareInput Text) -> [Token (ShareInput Text)] -> Tokens (ShareInput Text) Source #

chunkToTokens :: Proxy (ShareInput Text) -> Tokens (ShareInput Text) -> [Token (ShareInput Text)] Source #

chunkLength :: Proxy (ShareInput Text) -> Tokens (ShareInput Text) -> Int Source #

chunkEmpty :: Proxy (ShareInput Text) -> Tokens (ShareInput Text) -> Bool Source #

take1_ :: ShareInput Text -> Maybe (Token (ShareInput Text), ShareInput Text) Source #

takeN_ :: Int -> ShareInput Text -> Maybe (Tokens (ShareInput Text), ShareInput Text) Source #

takeWhile_ :: (Token (ShareInput Text) -> Bool) -> ShareInput Text -> (Tokens (ShareInput Text), ShareInput Text) Source #

Ord (ParseError Text HledgerParseErrorData) |

Instance details

Defined in Text.Megaparsec.Custom

Methods

compare :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Ordering Source #

(<) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(<=) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(>) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(>=) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

max :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData Source #

min :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData Source #

type ChunkElem Text |
Instance details Defined in Data.Attoparsec.Internal.Types type ChunkElem Text = Char
type State Text |
Instance details Defined in Data.Attoparsec.Internal.Types type State Text = Buffer
type Item Text |
Instance details Defined in Data.Text type Item Text = Char
type Token Text |
Instance details Defined in Text.Megaparsec.Stream type Token Text = Token (ShareInput Text)
type Tokens Text |
Instance details Defined in Text.Megaparsec.Stream type Tokens Text = Tokens (ShareInput Text)
type Element Text |
Instance details Defined in Data.MonoTraversable type Element Text = Char
type Index Text |
Instance details Defined in Data.Sequences type Index Text = Int
type Token (NoShareInput Text) |
Instance details Defined in Text.Megaparsec.Stream type Token (NoShareInput Text) = Char
type Token (ShareInput Text) |
Instance details Defined in Text.Megaparsec.Stream type Token (ShareInput Text) = Char
type Tokens (NoShareInput Text) |
Instance details Defined in Text.Megaparsec.Stream type Tokens (NoShareInput Text) = Text
type Tokens (ShareInput Text) |
Instance details Defined in Text.Megaparsec.Stream type Tokens (ShareInput Text) = Text

data UTCTime Source #

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Constructors

UTCTime |

Fields

- utctDay :: Day

  the day

- utctDayTime :: DiffTime

  the time from midnight, 0 <= t < 86401s (because of leap-seconds)

#### Instances

Instances details

FromJSON UTCTime |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser UTCTime Source # parseJSONList :: Value -> Parser [UTCTime] Source #
FromJSONKey UTCTime |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction UTCTime Source # fromJSONKeyList :: FromJSONKeyFunction [UTCTime] Source #
ToJSON UTCTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: UTCTime -> Value Source # toEncoding :: UTCTime -> Encoding Source # toJSONList :: [UTCTime] -> Value Source # toEncodingList :: [UTCTime] -> Encoding Source #
ToJSONKey UTCTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction UTCTime Source # toJSONKeyList :: ToJSONKeyFunction [UTCTime] Source #
Data UTCTime |

Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCTime -> c UTCTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime Source #

toConstr :: UTCTime -> Constr Source #

dataTypeOf :: UTCTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime) Source #

gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

NFData UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods rnf :: UTCTime -> () Source #
Eq UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods (==) :: UTCTime -> UTCTime -> Bool Source # (/=) :: UTCTime -> UTCTime -> Bool Source #
Ord UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods compare :: UTCTime -> UTCTime -> Ordering Source # (<) :: UTCTime -> UTCTime -> Bool Source # (<=) :: UTCTime -> UTCTime -> Bool Source # (>) :: UTCTime -> UTCTime -> Bool Source # (>=) :: UTCTime -> UTCTime -> Bool Source # max :: UTCTime -> UTCTime -> UTCTime Source # min :: UTCTime -> UTCTime -> UTCTime Source #

data Either a b Source #

The `Either` type represents values with two possibilities: a value of type ``Either` a b` is either ``Left` a` or ``Right` b`.

The `Either` type is sometimes used to represent a value which is either correct or an error; by convention, the `Left` constructor is used to hold an error value and the `Right` constructor is used to hold a correct value (mnemonic: "right" also means "correct").

#### Examples

Expand

The type ``Either` `String` `Int`` is the type of values which can be either a `String` or an `Int`. The `Left` constructor can be used only on `String`s, and the `Right` constructor can be used only on `Int`s:

    >>> let s = Left "foo" :: Either String Int
    >>> s
    Left "foo"
    >>> let n = Right 3 :: Either String Int
    >>> n
    Right 3
    >>> :type s
    s :: Either String Int
    >>> :type n
    n :: Either String Int

The `fmap` from our `Functor` instance will ignore `Left` values, but will apply the supplied function to values contained in a `Right`:

    >>> let s = Left "foo" :: Either String Int
    >>> let n = Right 3 :: Either String Int
    >>> fmap (*2) s
    Left "foo"
    >>> fmap (*2) n
    Right 6

The `Monad` instance for `Either` allows us to chain together multiple actions which may fail, and fail overall if any of the individual steps failed. First we'll write a function that can either parse an `Int` from a `Char`, or fail.

    >>> import Data.Char ( digitToInt, isDigit )
    >>> :{
        let parseEither :: Char -> Either String Int
            parseEither c
              | isDigit c = Right (digitToInt c)
              | otherwise = Left "parse error"
    >>> :}

The following should work, since both `'1'` and `'2'` can be parsed as `Int`s.

    >>> :{
        let parseMultiple :: Either String Int
            parseMultiple = do
              x <- parseEither '1'
              y <- parseEither '2'
              return (x + y)
    >>> :}

    >>> parseMultiple
    Right 3

But the following should fail overall, since the first operation where we attempt to parse `'m'` as an `Int` will fail:

    >>> :{
        let parseMultiple :: Either String Int
            parseMultiple = do
              x <- parseEither 'm'
              y <- parseEither '2'
              return (x + y)
    >>> :}

    >>> parseMultiple
    Left "parse error"

Constructors

Left a |
Right b |

#### Instances

Instances details

FromJSON2 Either |
Instance details Defined in Data.Aeson.Types.FromJSON Methods liftParseJSON2 :: (Value -> Parser a) -> (Value -> Parser [a]) -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser (Either a b) Source # liftParseJSONList2 :: (Value -> Parser a) -> (Value -> Parser [a]) -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser [Either a b] Source #
ToJSON2 Either |

Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Either a b -> Value Source #

liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Either a b] -> Value Source #

liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Either a b -> Encoding Source #

liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Either a b] -> Encoding Source #

Bifunctor Either | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d Source # first :: (a -> b) -> Either a c -> Either b c Source # second :: (b -> c) -> Either a b -> Either a c Source #
Eq2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool Source #
Ord2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering Source #
Read2 Either | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] Source #

Show2 Either | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS Source #
NFData2 Either | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf2 :: (a -> ()) -> (b -> ()) -> Either a b -> () Source #
Hashable2 Either |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt2 :: (Int -> a -> Int) -> (Int -> b -> Int) -> Int -> Either a b -> Int Source #
Generic1 (Either a :: Type -> Type) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (Either a) :: k -> Type Source # Methods from1 :: forall (a0 :: k). Either a a0 -> Rep1 (Either a) a0 Source # to1 :: forall (a0 :: k). Rep1 (Either a) a0 -> Either a a0 Source #
(Lift a, Lift b) => Lift (Either a b :: Type) |
Instance details Defined in Language.Haskell.TH.Syntax Methods lift :: Quote m => Either a b -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Either a b -> Code m (Either a b) Source #
FromJSON a => FromJSON1 (Either a) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods liftParseJSON :: (Value -> Parser a0) -> (Value -> Parser [a0]) -> Value -> Parser (Either a a0) Source # liftParseJSONList :: (Value -> Parser a0) -> (Value -> Parser [a0]) -> Value -> Parser [Either a a0] Source #
ToJSON a => ToJSON1 (Either a) |

Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a0 -> Value) -> ([a0] -> Value) -> Either a a0 -> Value Source #

liftToJSONList :: (a0 -> Value) -> ([a0] -> Value) -> [Either a a0] -> Value Source #

liftToEncoding :: (a0 -> Encoding) -> ([a0] -> Encoding) -> Either a a0 -> Encoding Source #

liftToEncodingList :: (a0 -> Encoding) -> ([a0] -> Encoding) -> [Either a a0] -> Encoding Source #

Foldable (Either a) | Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Either a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

toList :: Either a a0 -> [a0] Source #

null :: Either a a0 -> Bool Source #

length :: Either a a0 -> Int Source #

elem :: Eq a0 => a0 -> Either a a0 -> Bool Source #

maximum :: Ord a0 => Either a a0 -> a0 Source #

minimum :: Ord a0 => Either a a0 -> a0 Source #

sum :: Num a0 => Either a a0 -> a0 Source #

product :: Num a0 => Either a a0 -> a0 Source #

Eq a => Eq1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool Source #
Ord a => Ord1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering Source #
Read a => Read1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] Source #
Show a => Show1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS Source #
Traversable (Either a) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) Source # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) Source # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) Source # sequence :: Monad m => Either a (m a0) -> m (Either a a0) Source #
Applicative (Either e) | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a Source # (<*>) :: Either e (a -> b) -> Either e a -> Either e b Source # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source # (*>) :: Either e a -> Either e b -> Either e b Source # (<*) :: Either e a -> Either e b -> Either e a Source #
Functor (Either a) | Since: base-3.0
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b Source # (<$) :: a0 -> Either a b -> Either a a0 Source #
Monad (Either e) | Since: base-4.4.0.0
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b Source # (>>) :: Either e a -> Either e b -> Either e b Source # return :: a -> Either e a Source #
NFData a => NFData1 (Either a) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a0 -> ()) -> Either a a0 -> () Source #
e ~ SomeException => MonadCatch (Either e) | Since: exceptions-0.8.3
Instance details Defined in Control.Monad.Catch Methods catch :: Exception e0 => Either e a -> (e0 -> Either e a) -> Either e a Source #
e ~ SomeException => MonadMask (Either e) | Since: exceptions-0.8.3
Instance details Defined in Control.Monad.Catch Methods mask :: ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b Source # uninterruptibleMask :: ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b Source # generalBracket :: Either e a -> (a -> ExitCase b -> Either e c) -> (a -> Either e b) -> Either e (b, c) Source #
e ~ SomeException => MonadThrow (Either e) |
Instance details Defined in Control.Monad.Catch Methods throwM :: Exception e0 => e0 -> Either e a Source #
Hashable a => Hashable1 (Either a) |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt :: (Int -> a0 -> Int) -> Int -> Either a a0 -> Int Source #
e ~ a => Reportable (Either a) e |
Instance details Defined in Hledger.Reports.ReportOptions Methods report :: a0 -> Either a (Either e a0) -> Either a a0
(FromJSON a, FromJSON b) => FromJSON (Either a b) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser (Either a b) Source # parseJSONList :: Value -> Parser [Either a b] Source #
(ToJSON a, ToJSON b) => ToJSON (Either a b) |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Either a b -> Value Source # toEncoding :: Either a b -> Encoding Source # toJSONList :: [Either a b] -> Value Source # toEncodingList :: [Either a b] -> Encoding Source #
(Data a, Data b) => Data (Either a b) | Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Either a b -> c (Either a b) Source #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Either a b) Source #

toConstr :: Either a b -> Constr Source #

dataTypeOf :: Either a b -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Either a b)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Either a b)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Either a b -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Either a b -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) Source #

Semigroup (Either a b) | Since: base-4.9.0.0
Instance details Defined in Data.Either Methods (<>) :: Either a b -> Either a b -> Either a b Source # sconcat :: NonEmpty (Either a b) -> Either a b Source # stimes :: Integral b0 => b0 -> Either a b -> Either a b Source #
Generic (Either a b) |
Instance details Defined in GHC.Generics Associated Types type Rep (Either a b) :: Type -> Type Source # Methods from :: Either a b -> Rep (Either a b) x Source # to :: Rep (Either a b) x -> Either a b Source #
(Read a, Read b) => Read (Either a b) | Since: base-3.0
Instance details Defined in Data.Either Methods readsPrec :: Int -> ReadS (Either a b) Source # readList :: ReadS [Either a b] Source # readPrec :: ReadPrec (Either a b) Source # readListPrec :: ReadPrec [Either a b] Source #
(Show a, Show b) => Show (Either a b) | Since: base-3.0
Instance details Defined in Data.Either Methods showsPrec :: Int -> Either a b -> ShowS Source # show :: Either a b -> String Source # showList :: [Either a b] -> ShowS Source #
(NFData a, NFData b) => NFData (Either a b) |
Instance details Defined in Control.DeepSeq Methods rnf :: Either a b -> () Source #
(Eq a, Eq b) => Eq (Either a b) | Since: base-2.1
Instance details Defined in Data.Either Methods (==) :: Either a b -> Either a b -> Bool Source # (/=) :: Either a b -> Either a b -> Bool Source #
(Ord a, Ord b) => Ord (Either a b) | Since: base-2.1

Instance details

Defined in Data.Either

Methods

compare :: Either a b -> Either a b -> Ordering Source #

(<) :: Either a b -> Either a b -> Bool Source #

(<=) :: Either a b -> Either a b -> Bool Source #

(>) :: Either a b -> Either a b -> Bool Source #

(>=) :: Either a b -> Either a b -> Bool Source #

max :: Either a b -> Either a b -> Either a b Source #

min :: Either a b -> Either a b -> Either a b Source #

(Hashable a, Hashable b) => Hashable (Either a b) |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Either a b -> Int Source # hash :: Either a b -> Int Source #
MonoFoldable (Either a b) |

Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element (Either a b) -> m) -> Either a b -> m

ofoldr :: (Element (Either a b) -> b0 -> b0) -> b0 -> Either a b -> b0

ofoldl' :: (a0 -> Element (Either a b) -> a0) -> a0 -> Either a b -> a0

otoList :: Either a b -> [Element (Either a b)]

oall :: (Element (Either a b) -> Bool) -> Either a b -> Bool

oany :: (Element (Either a b) -> Bool) -> Either a b -> Bool

onull :: Either a b -> Bool

olength :: Either a b -> Int

olength64 :: Either a b -> Int64

ocompareLength :: Integral i => Either a b -> i -> Ordering

otraverse_ :: Applicative f => (Element (Either a b) -> f b0) -> Either a b -> f ()

ofor_ :: Applicative f => Either a b -> (Element (Either a b) -> f b0) -> f ()

omapM_ :: Applicative m => (Element (Either a b) -> m ()) -> Either a b -> m ()

oforM_ :: Applicative m => Either a b -> (Element (Either a b) -> m ()) -> m ()

ofoldlM :: Monad m => (a0 -> Element (Either a b) -> m a0) -> a0 -> Either a b -> m a0

ofoldMap1Ex :: Semigroup m => (Element (Either a b) -> m) -> Either a b -> m

ofoldr1Ex :: (Element (Either a b) -> Element (Either a b) -> Element (Either a b)) -> Either a b -> Element (Either a b)

ofoldl1Ex' :: (Element (Either a b) -> Element (Either a b) -> Element (Either a b)) -> Either a b -> Element (Either a b)

headEx :: Either a b -> Element (Either a b)

lastEx :: Either a b -> Element (Either a b)

unsafeHead :: Either a b -> Element (Either a b)

unsafeLast :: Either a b -> Element (Either a b)

maximumByEx :: (Element (Either a b) -> Element (Either a b) -> Ordering) -> Either a b -> Element (Either a b)

minimumByEx :: (Element (Either a b) -> Element (Either a b) -> Ordering) -> Either a b -> Element (Either a b)

oelem :: Element (Either a b) -> Either a b -> Bool

onotElem :: Element (Either a b) -> Either a b -> Bool

MonoFunctor (Either a b) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (Either a b) -> Element (Either a b)) -> Either a b -> Either a b
MonoPointed (Either a b) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (Either a b) -> Either a b
MonoTraversable (Either a b) |
Instance details Defined in Data.MonoTraversable Methods otraverse :: Applicative f => (Element (Either a b) -> f (Element (Either a b))) -> Either a b -> f (Either a b) omapM :: Applicative m => (Element (Either a b) -> m (Element (Either a b))) -> Either a b -> m (Either a b)
(a ~ a', b ~ b') => Each (Either a a') (Either b b') a b | Since: microlens-0.4.11
Instance details Defined in Lens.Micro.Internal Methods each :: Traversal (Either a a') (Either b b') a b Source #
type Rep1 (Either a :: Type -> Type) | Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep1 (Either a :: Type -> Type) = D1 ('MetaData "Either" "Data.Either" "base" 'False) (C1 ('MetaCons "Left" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

type Rep (Either a b) | Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (Either a b) = D1 ('MetaData "Either" "Data.Either" "base" 'False) (C1 ('MetaCons "Left" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)))

type Element (Either a b) |
Instance details Defined in Data.MonoTraversable type Element (Either a b) = b

type Year = Integer Source #

Year of Common Era (when positive).

data IO a Source #

A value of type ``IO` a` is a computation which, when performed, does some I/O before returning a value of type `a`.

There is really only one way to "perform" an I/O action: bind it to `Main.main` in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the `IO` monad and called at some point, directly or indirectly, from `Main.main`.

`IO` is a monad, so `IO` actions can be combined using either the do-notation or the `>>` and `>>=` operations from the `Monad` class.

#### Instances

Instances details

MonadFail IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> IO a Source #
MonadIO IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.IO.Class Methods liftIO :: IO a -> IO a Source #
Alternative IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods empty :: IO a Source # (<|>) :: IO a -> IO a -> IO a Source # some :: IO a -> IO [a] Source # many :: IO a -> IO [a] Source #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a Source # (<*>) :: IO (a -> b) -> IO a -> IO b Source # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source # (*>) :: IO a -> IO b -> IO b Source # (<*) :: IO a -> IO b -> IO a Source #
Functor IO | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b Source # (<$) :: a -> IO b -> IO a Source #
Monad IO | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b Source # (>>) :: IO a -> IO b -> IO b Source # return :: a -> IO a Source #
MonadPlus IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mzero :: IO a Source # mplus :: IO a -> IO a -> IO a Source #
MonadCatch IO |
Instance details Defined in Control.Monad.Catch Methods catch :: Exception e => IO a -> (e -> IO a) -> IO a Source #
MonadMask IO |
Instance details Defined in Control.Monad.Catch Methods mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b Source # uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b Source # generalBracket :: IO a -> (a -> ExitCase b -> IO c) -> (a -> IO b) -> IO (b, c) Source #
MonadThrow IO |
Instance details Defined in Control.Monad.Catch Methods throwM :: Exception e => e -> IO a Source #
PrimBase IO |
Instance details Defined in Control.Monad.Primitive Methods internal :: IO a -> State# (PrimState IO) -> (# State# (PrimState IO), a #)
PrimMonad IO |
Instance details Defined in Control.Monad.Primitive Associated Types type PrimState IO Methods primitive :: (State# (PrimState IO) -> (# State# (PrimState IO), a #)) -> IO a
Quasi IO |

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

qNewName :: String -> IO Name Source #

qReport :: Bool -> String -> IO () Source #

qRecover :: IO a -> IO a -> IO a Source #

qLookupName :: Bool -> String -> IO (Maybe Name) Source #

qReify :: Name -> IO Info Source #

qReifyFixity :: Name -> IO (Maybe Fixity) Source #

qReifyType :: Name -> IO Type Source #

qReifyInstances :: Name -> [Type] -> IO [Dec] Source #

qReifyRoles :: Name -> IO [Role] Source #

qReifyAnnotations :: Data a => AnnLookup -> IO [a] Source #

qReifyModule :: Module -> IO ModuleInfo Source #

qReifyConStrictness :: Name -> IO [DecidedStrictness] Source #

qLocation :: IO Loc Source #

qRunIO :: IO a -> IO a Source #

qGetPackageRoot :: IO FilePath Source #

qAddDependentFile :: FilePath -> IO () Source #

qAddTempFile :: String -> IO FilePath Source #

qAddTopDecls :: [Dec] -> IO () Source #

qAddForeignFilePath :: ForeignSrcLang -> String -> IO () Source #

qAddModFinalizer :: Q () -> IO () Source #

qAddCorePlugin :: String -> IO () Source #

qGetQ :: Typeable a => IO (Maybe a) Source #

qPutQ :: Typeable a => a -> IO () Source #

qIsExtEnabled :: Extension -> IO Bool Source #

qExtsEnabled :: IO [Extension] Source #

qPutDoc :: DocLoc -> String -> IO () Source #

qGetDoc :: DocLoc -> IO (Maybe String) Source #

Quote IO |
Instance details Defined in Language.Haskell.TH.Syntax Methods newName :: String -> IO Name Source #
Monoid a => Monoid (IO a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mempty :: IO a Source # mappend :: IO a -> IO a -> IO a Source # mconcat :: [IO a] -> IO a Source #
Semigroup a => Semigroup (IO a) | Since: base-4.10.0.0
Instance details Defined in GHC.Base Methods (<>) :: IO a -> IO a -> IO a Source # sconcat :: NonEmpty (IO a) -> IO a Source # stimes :: Integral b => b -> IO a -> IO a Source #
a ~ () => HPrintfType (IO a) | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods hspr :: Handle -> String -> [UPrintf] -> IO a
a ~ () => PrintfType (IO a) | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods spr :: String -> [UPrintf] -> IO a
Default a => Default (IO a) |
Instance details Defined in Data.Default.Class Methods def :: IO a #
MonoFunctor (IO a) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (IO a) -> Element (IO a)) -> IO a -> IO a
MonoPointed (IO a) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (IO a) -> IO a
Assertable t => Assertable (IO t) |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assert :: IO t -> Assertion #
AssertionPredicable t => AssertionPredicable (IO t) |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assertionPredicate :: IO t -> IO Bool #
Run (InputT IO) Haskeline |
Instance details Defined in System.Console.Wizard.Haskeline Methods runAlgebra :: Haskeline (InputT IO v) -> InputT IO v Source #
Run (InputT IO) WithSettings |
Instance details Defined in System.Console.Wizard.Haskeline Methods runAlgebra :: WithSettings (InputT IO v) -> InputT IO v Source #
type PrimState IO |
Instance details Defined in Control.Monad.Primitive type PrimState IO = RealWorld
type Element (IO a) |
Instance details Defined in Data.MonoTraversable type Element (IO a) = a

class Functor f => Applicative (f :: Type -> Type) where Source #

A functor with application, providing operations to

- embed pure expressions (`pure`), and
- sequence computations and combine their results (`<*>` and `liftA2`).

A minimal complete definition must include implementations of `pure` and of either `<*>` or `liftA2`. If it defines both, then they must behave the same as their default definitions:

    (<*>) = liftA2 id

    liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

Identity

      pure id <*> v = v

Composition

      pure (.) <*> u <*> v <*> w = u <*> (v <*> w)

Homomorphism

      pure f <*> pure x = pure (f x)

Interchange

      u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

-     u *> v = (id <$ u) <*> v

-     u <* v = liftA2 const u v

As a consequence of these laws, the `Functor` instance for `f` will satisfy

-     fmap f x = pure f <*> x

It may be useful to note that supposing

    forall x y. p (q x y) = f x . g y

it follows from the above that

    liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If `f` is also a `Monad`, it should satisfy

-     pure = return

-     m1 <*> m2 = m1 >>= (\x1 -> m2 >>= (\x2 -> return (x1 x2)))

-     (*>) = (>>)

(which implies that `pure` and `<*>` satisfy the applicative functor laws).

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a Source #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 Source #

Sequential application.

A few functors support an implementation of `<*>` that is more efficient than the default one.

#### Example

Expand

Used in combination with `(`<$>`)`, `(`<*>`)` can be used to build a record.

    >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}

    >>> produceFoo :: Applicative f => f Foo

    >>> produceBar :: Applicative f => f Bar
    >>> produceBaz :: Applicative f => f Baz

    >>> mkState :: Applicative f => f MyState
    >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz

liftA2 :: (a -> b -> c) -> f a -> f b -> f c Source #

Lift a binary function to actions.

Some functors support an implementation of `liftA2` that is more efficient than the default one. In particular, if `fmap` is an expensive operation, it is likely better to use `liftA2` than to `fmap` over the structure and then use `<*>`.

This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of `<*>` and `fmap`.

#### Example

Expand

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)

(*>) :: f a -> f b -> f b infixl 4 Source #

Sequence actions, discarding the value of the first argument.

#### Examples

Expand

If used in conjunction with the Applicative instance for `Maybe`, you can chain Maybe computations, with a possible "early return" in case of `Nothing`.

    >>> Just 2 *> Just 3
    Just 3

    >>> Nothing *> Just 3
    Nothing

Of course a more interesting use case would be to have effectful computations instead of just returning pure values.

    >>> import Data.Char
    >>> import Text.ParserCombinators.ReadP
    >>> let p = string "my name is " *> munch1 isAlpha <* eof
    >>> readP_to_S p "my name is Simon"
    [("Simon","")]

(<*) :: f a -> f b -> f a infixl 4 Source #

Sequence actions, discarding the value of the second argument.

#### Instances

Instances details

Applicative IResult |
Instance details Defined in Data.Aeson.Types.Internal Methods pure :: a -> IResult a Source # (<*>) :: IResult (a -> b) -> IResult a -> IResult b Source # liftA2 :: (a -> b -> c) -> IResult a -> IResult b -> IResult c Source # (*>) :: IResult a -> IResult b -> IResult b Source # (<*) :: IResult a -> IResult b -> IResult a Source #
Applicative Parser |
Instance details Defined in Data.Aeson.Types.Internal Methods pure :: a -> Parser a Source # (<*>) :: Parser (a -> b) -> Parser a -> Parser b Source # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source # (*>) :: Parser a -> Parser b -> Parser b Source # (<*) :: Parser a -> Parser b -> Parser a Source #
Applicative Result |
Instance details Defined in Data.Aeson.Types.Internal Methods pure :: a -> Result a Source # (<*>) :: Result (a -> b) -> Result a -> Result b Source # liftA2 :: (a -> b -> c) -> Result a -> Result b -> Result c Source # (*>) :: Result a -> Result b -> Result b Source # (<*) :: Result a -> Result b -> Result a Source #

Applicative ZipList

    f <$> ZipList xs1 <*> ... <*> ZipList xsN
        = ZipList (zipWithN f xs1 ... xsN)

where `zipWithN` refers to the `zipWith` function of the appropriate arity (`zipWith`, `zipWith3`, `zipWith4`, ...). For example:

    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: base-2.1

Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a Source # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source # (*>) :: ZipList a -> ZipList b -> ZipList b Source # (<*) :: ZipList a -> ZipList b -> ZipList a Source #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a Source # (<*>) :: Identity (a -> b) -> Identity a -> Identity b Source # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source # (*>) :: Identity a -> Identity b -> Identity b Source # (<*) :: Identity a -> Identity b -> Identity a Source #
Applicative Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods pure :: a -> Down a Source # (<*>) :: Down (a -> b) -> Down a -> Down b Source # liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source # (*>) :: Down a -> Down b -> Down b Source # (<*) :: Down a -> Down b -> Down a Source #
Applicative First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a Source # (<*>) :: First (a -> b) -> First a -> First b Source # liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source # (*>) :: First a -> First b -> First b Source # (<*) :: First a -> First b -> First a Source #
Applicative Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a Source # (<*>) :: Last (a -> b) -> Last a -> Last b Source # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source # (*>) :: Last a -> Last b -> Last b Source # (<*) :: Last a -> Last b -> Last a Source #
Applicative Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a Source # (<*>) :: Max (a -> b) -> Max a -> Max b Source # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c Source # (*>) :: Max a -> Max b -> Max b Source # (<*) :: Max a -> Max b -> Max a Source #
Applicative Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a Source # (<*>) :: Min (a -> b) -> Min a -> Min b Source # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c Source # (*>) :: Min a -> Min b -> Min b Source # (<*) :: Min a -> Min b -> Min a Source #
Applicative Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Dual a Source # (<*>) :: Dual (a -> b) -> Dual a -> Dual b Source # liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c Source # (*>) :: Dual a -> Dual b -> Dual b Source # (<*) :: Dual a -> Dual b -> Dual a Source #
Applicative Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Product a Source # (<*>) :: Product (a -> b) -> Product a -> Product b Source # liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c Source # (*>) :: Product a -> Product b -> Product b Source # (<*) :: Product a -> Product b -> Product a Source #
Applicative Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Sum a Source # (<*>) :: Sum (a -> b) -> Sum a -> Sum b Source # liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c Source # (*>) :: Sum a -> Sum b -> Sum b Source # (<*) :: Sum a -> Sum b -> Sum a Source #
Applicative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods pure :: a -> STM a Source # (<*>) :: STM (a -> b) -> STM a -> STM b Source # liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c Source # (*>) :: STM a -> STM b -> STM b Source # (<*) :: STM a -> STM b -> STM a Source #
Applicative Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Par1 a Source # (<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b Source # liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c Source # (*>) :: Par1 a -> Par1 b -> Par1 b Source # (<*) :: Par1 a -> Par1 b -> Par1 a Source #
Applicative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> P a Source # (<*>) :: P (a -> b) -> P a -> P b Source # liftA2 :: (a -> b -> c) -> P a -> P b -> P c Source # (*>) :: P a -> P b -> P b Source # (<*) :: P a -> P b -> P a Source #
Applicative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a Source # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b Source # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c Source # (*>) :: ReadP a -> ReadP b -> ReadP b Source # (<*) :: ReadP a -> ReadP b -> ReadP a Source #
Applicative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a Source # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b Source # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c Source # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b Source # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a Source #
Applicative Put |
Instance details Defined in Data.ByteString.Builder.Internal Methods pure :: a -> Put a Source # (<*>) :: Put (a -> b) -> Put a -> Put b Source # liftA2 :: (a -> b -> c) -> Put a -> Put b -> Put c Source # (*>) :: Put a -> Put b -> Put b Source # (<*) :: Put a -> Put b -> Put a Source #
Applicative RGB |
Instance details Defined in Data.Colour.RGB Methods pure :: a -> RGB a Source # (<*>) :: RGB (a -> b) -> RGB a -> RGB b Source # liftA2 :: (a -> b -> c) -> RGB a -> RGB b -> RGB c Source # (*>) :: RGB a -> RGB b -> RGB b Source # (<*) :: RGB a -> RGB b -> RGB a Source #
Applicative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods pure :: a -> Seq a Source # (<*>) :: Seq (a -> b) -> Seq a -> Seq b Source # liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c Source # (*>) :: Seq a -> Seq b -> Seq b Source # (<*) :: Seq a -> Seq b -> Seq a Source #
Applicative Tree |
Instance details Defined in Data.Tree Methods pure :: a -> Tree a Source # (<*>) :: Tree (a -> b) -> Tree a -> Tree b Source # liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c Source # (*>) :: Tree a -> Tree b -> Tree b Source # (<*) :: Tree a -> Tree b -> Tree a Source #
Applicative DNonEmpty |
Instance details Defined in Data.DList.DNonEmpty.Internal Methods pure :: a -> DNonEmpty a Source # (<*>) :: DNonEmpty (a -> b) -> DNonEmpty a -> DNonEmpty b Source # liftA2 :: (a -> b -> c) -> DNonEmpty a -> DNonEmpty b -> DNonEmpty c Source # (*>) :: DNonEmpty a -> DNonEmpty b -> DNonEmpty b Source # (<*) :: DNonEmpty a -> DNonEmpty b -> DNonEmpty a Source #
Applicative DList |
Instance details Defined in Data.DList.Internal Methods pure :: a -> DList a Source # (<*>) :: DList (a -> b) -> DList a -> DList b Source # liftA2 :: (a -> b -> c) -> DList a -> DList b -> DList c Source # (*>) :: DList a -> DList b -> DList b Source # (<*) :: DList a -> DList b -> DList a Source #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a Source # (<*>) :: IO (a -> b) -> IO a -> IO b Source # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source # (*>) :: IO a -> IO b -> IO b Source # (<*) :: IO a -> IO b -> IO a Source #
Applicative Root |
Instance details Defined in Numeric.RootFinding Methods pure :: a -> Root a Source # (<*>) :: Root (a -> b) -> Root a -> Root b Source # liftA2 :: (a -> b -> c) -> Root a -> Root b -> Root c Source # (*>) :: Root a -> Root b -> Root b Source # (<*) :: Root a -> Root b -> Root a Source #
Applicative Array |
Instance details Defined in Data.Primitive.Array Methods pure :: a -> Array a Source # (<*>) :: Array (a -> b) -> Array a -> Array b Source # liftA2 :: (a -> b -> c) -> Array a -> Array b -> Array c Source # (*>) :: Array a -> Array b -> Array b Source # (<*) :: Array a -> Array b -> Array a Source #
Applicative SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods pure :: a -> SmallArray a Source # (<*>) :: SmallArray (a -> b) -> SmallArray a -> SmallArray b Source # liftA2 :: (a -> b -> c) -> SmallArray a -> SmallArray b -> SmallArray c Source # (*>) :: SmallArray a -> SmallArray b -> SmallArray b Source # (<*) :: SmallArray a -> SmallArray b -> SmallArray a Source #
Applicative Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods pure :: a -> Q a Source # (<*>) :: Q (a -> b) -> Q a -> Q b Source # liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c Source # (*>) :: Q a -> Q b -> Q b Source # (<*) :: Q a -> Q b -> Q a Source #
Applicative Capability |
Instance details Defined in System.Console.Terminfo.Base Methods pure :: a -> Capability a Source # (<*>) :: Capability (a -> b) -> Capability a -> Capability b Source # liftA2 :: (a -> b -> c) -> Capability a -> Capability b -> Capability c Source # (*>) :: Capability a -> Capability b -> Capability b Source # (<*) :: Capability a -> Capability b -> Capability a Source #
Applicative Vector |
Instance details Defined in Data.Vector Methods pure :: a -> Vector a Source # (<*>) :: Vector (a -> b) -> Vector a -> Vector b Source # liftA2 :: (a -> b -> c) -> Vector a -> Vector b -> Vector c Source # (*>) :: Vector a -> Vector b -> Vector b Source # (<*) :: Vector a -> Vector b -> Vector a Source #
Applicative NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods pure :: a -> NonEmpty a Source # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b Source # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c Source # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a Source #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a Source # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source # (*>) :: Maybe a -> Maybe b -> Maybe b Source # (<*) :: Maybe a -> Maybe b -> Maybe a Source #
Applicative Solo | Since: base-4.15
Instance details Defined in GHC.Base Methods pure :: a -> Solo a Source # (<*>) :: Solo (a -> b) -> Solo a -> Solo b Source # liftA2 :: (a -> b -> c) -> Solo a -> Solo b -> Solo c Source # (*>) :: Solo a -> Solo b -> Solo b Source # (<*) :: Solo a -> Solo b -> Solo a Source #
Applicative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> [a] Source # (<*>) :: [a -> b] -> [a] -> [b] Source # liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] Source # (*>) :: [a] -> [b] -> [b] Source # (<*) :: [a] -> [b] -> [a] Source #
Applicative (Parser i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods pure :: a -> Parser i a Source # (<*>) :: Parser i (a -> b) -> Parser i a -> Parser i b Source # liftA2 :: (a -> b -> c) -> Parser i a -> Parser i b -> Parser i c Source # (*>) :: Parser i a -> Parser i b -> Parser i b Source # (<*) :: Parser i a -> Parser i b -> Parser i a Source #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a Source #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source #

Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 Source # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 Source #
Applicative (Either e) | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a Source # (<*>) :: Either e (a -> b) -> Either e a -> Either e b Source # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source # (*>) :: Either e a -> Either e b -> Either e b Source # (<*) :: Either e a -> Either e b -> Either e a Source #
Applicative (StateL s) | Since: base-4.0
Instance details Defined in Data.Functor.Utils Methods pure :: a -> StateL s a Source # (<*>) :: StateL s (a -> b) -> StateL s a -> StateL s b Source # liftA2 :: (a -> b -> c) -> StateL s a -> StateL s b -> StateL s c Source # (*>) :: StateL s a -> StateL s b -> StateL s b Source # (<*) :: StateL s a -> StateL s b -> StateL s a Source #
Applicative (StateR s) | Since: base-4.0
Instance details Defined in Data.Functor.Utils Methods pure :: a -> StateR s a Source # (<*>) :: StateR s (a -> b) -> StateR s a -> StateR s b Source # liftA2 :: (a -> b -> c) -> StateR s a -> StateR s b -> StateR s c Source # (*>) :: StateR s a -> StateR s b -> StateR s b Source # (<*) :: StateR s a -> StateR s b -> StateR s a Source #
Applicative (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> U1 a Source # (<*>) :: U1 (a -> b) -> U1 a -> U1 b Source # liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c Source # (*>) :: U1 a -> U1 b -> U1 b Source # (<*) :: U1 a -> U1 b -> U1 a Source #
Applicative (ST s) | Since: base-4.4.0.0
Instance details Defined in GHC.ST Methods pure :: a -> ST s a Source # (<*>) :: ST s (a -> b) -> ST s a -> ST s b Source # liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c Source # (*>) :: ST s a -> ST s b -> ST s b Source # (<*) :: ST s a -> ST s b -> ST s a Source #
Monad m => Applicative (ZipSource m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods pure :: a -> ZipSource m a Source # (<*>) :: ZipSource m (a -> b) -> ZipSource m a -> ZipSource m b Source # liftA2 :: (a -> b -> c) -> ZipSource m a -> ZipSource m b -> ZipSource m c Source # (*>) :: ZipSource m a -> ZipSource m b -> ZipSource m b Source # (<*) :: ZipSource m a -> ZipSource m b -> ZipSource m a Source #
Applicative (SetM s) |
Instance details Defined in Data.Graph Methods pure :: a -> SetM s a Source # (<*>) :: SetM s (a -> b) -> SetM s a -> SetM s b Source # liftA2 :: (a -> b -> c) -> SetM s a -> SetM s b -> SetM s c Source # (*>) :: SetM s a -> SetM s b -> SetM s b Source # (<*) :: SetM s a -> SetM s b -> SetM s a Source #
Functor f => Applicative (Free f) |
Instance details Defined in Control.Monad.Free Methods pure :: a -> Free f a Source # (<*>) :: Free f (a -> b) -> Free f a -> Free f b Source # liftA2 :: (a -> b -> c) -> Free f a -> Free f b -> Free f c Source # (*>) :: Free f a -> Free f b -> Free f b Source # (<*) :: Free f a -> Free f b -> Free f a Source #
Applicative m => Applicative (InputT m) |
Instance details Defined in System.Console.Haskeline.InputT Methods pure :: a -> InputT m a Source # (<*>) :: InputT m (a -> b) -> InputT m a -> InputT m b Source # liftA2 :: (a -> b -> c) -> InputT m a -> InputT m b -> InputT m c Source # (*>) :: InputT m a -> InputT m b -> InputT m b Source # (<*) :: InputT m a -> InputT m b -> InputT m a Source #
Applicative m => Applicative (HtmlT m) | Based on the monad instance.
Instance details Defined in Lucid.Base Methods pure :: a -> HtmlT m a Source # (<*>) :: HtmlT m (a -> b) -> HtmlT m a -> HtmlT m b Source # liftA2 :: (a -> b -> c) -> HtmlT m a -> HtmlT m b -> HtmlT m c Source # (*>) :: HtmlT m a -> HtmlT m b -> HtmlT m b Source # (<*) :: HtmlT m a -> HtmlT m b -> HtmlT m a Source #
Applicative f => Applicative (WrappedPoly f) |

Instance details

Defined in Data.MonoTraversable

Methods

pure :: a -> WrappedPoly f a Source #

(<*>) :: WrappedPoly f (a -> b) -> WrappedPoly f a -> WrappedPoly f b Source #

liftA2 :: (a -> b -> c) -> WrappedPoly f a -> WrappedPoly f b -> WrappedPoly f c Source #

(*>) :: WrappedPoly f a -> WrappedPoly f b -> WrappedPoly f b Source #

(<*) :: WrappedPoly f a -> WrappedPoly f b -> WrappedPoly f a Source #

Applicative m => Applicative (ResourceT m) |
Instance details Defined in Control.Monad.Trans.Resource.Internal Methods pure :: a -> ResourceT m a Source # (<*>) :: ResourceT m (a -> b) -> ResourceT m a -> ResourceT m b Source # liftA2 :: (a -> b -> c) -> ResourceT m a -> ResourceT m b -> ResourceT m c Source # (*>) :: ResourceT m a -> ResourceT m b -> ResourceT m b Source # (<*) :: ResourceT m a -> ResourceT m b -> ResourceT m a Source #
Semigroup a => Applicative (These a) |
Instance details Defined in Data.Strict.These Methods pure :: a0 -> These a a0 Source # (<*>) :: These a (a0 -> b) -> These a a0 -> These a b Source # liftA2 :: (a0 -> b -> c) -> These a a0 -> These a b -> These a c Source # (*>) :: These a a0 -> These a b -> These a b Source # (<*) :: These a a0 -> These a b -> These a a0 Source #
Applicative m => Applicative (QuoteToQuasi m) |

Instance details

Defined in Language.Haskell.TH.Syntax.Compat

Methods

pure :: a -> QuoteToQuasi m a Source #

(<*>) :: QuoteToQuasi m (a -> b) -> QuoteToQuasi m a -> QuoteToQuasi m b Source #

liftA2 :: (a -> b -> c) -> QuoteToQuasi m a -> QuoteToQuasi m b -> QuoteToQuasi m c Source #

(*>) :: QuoteToQuasi m a -> QuoteToQuasi m b -> QuoteToQuasi m b Source #

(<*) :: QuoteToQuasi m a -> QuoteToQuasi m b -> QuoteToQuasi m a Source #

Semigroup a => Applicative (These a) |
Instance details Defined in Data.These Methods pure :: a0 -> These a a0 Source # (<*>) :: These a (a0 -> b) -> These a a0 -> These a b Source # liftA2 :: (a0 -> b -> c) -> These a a0 -> These a b -> These a c Source # (*>) :: These a a0 -> These a b -> These a b Source # (<*) :: These a a0 -> These a b -> These a a0 Source #
(Functor m, Monad m) => Applicative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods pure :: a -> MaybeT m a Source # (<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b Source # liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c Source # (*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b Source # (<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a Source #
Functor backend => Applicative (Wizard backend) |

Instance details

Defined in System.Console.Wizard.Internal

Methods

pure :: a -> Wizard backend a Source #

(<*>) :: Wizard backend (a -> b) -> Wizard backend a -> Wizard backend b Source #

liftA2 :: (a -> b -> c) -> Wizard backend a -> Wizard backend b -> Wizard backend c Source #

(*>) :: Wizard backend a -> Wizard backend b -> Wizard backend b Source #

(<*) :: Wizard backend a -> Wizard backend b -> Wizard backend a Source #

Monoid a => Applicative ((,) a)

For tuples, the `Monoid` constraint on `a` determines how the first values merge. For example, `String`s concatenate:

    ("hello ", (+15)) <*> ("world!", 2002)
    ("hello world!",2017)

Since: base-2.1

Instance details Defined in GHC.Base Methods pure :: a0 -> (a, a0) Source # (<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) Source # liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) Source # (*>) :: (a, a0) -> (a, b) -> (a, b) Source # (<*) :: (a, a0) -> (a, b) -> (a, a0) Source #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> Kleisli m a a0 Source # (<*>) :: Kleisli m a (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b Source # liftA2 :: (a0 -> b -> c) -> Kleisli m a a0 -> Kleisli m a b -> Kleisli m a c Source # (*>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source # (<*) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a a0 Source #
Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a Source # (<*>) :: Const m (a -> b) -> Const m a -> Const m b Source # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source # (*>) :: Const m a -> Const m b -> Const m b Source # (<*) :: Const m a -> Const m b -> Const m a Source #
Applicative f => Applicative (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Alt f a Source # (<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b Source # liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c Source # (*>) :: Alt f a -> Alt f b -> Alt f b Source # (<*) :: Alt f a -> Alt f b -> Alt f a Source #
(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) | Since: base-4.17.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Generically1 f a Source #

(<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b Source #

liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c Source #

(*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b Source #

(<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a Source #

Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Rec1 f a Source # (<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b Source # liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c Source # (*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source # (<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a Source #
Biapplicative p => Applicative (Join p) |
Instance details Defined in Data.Bifunctor.Join Methods pure :: a -> Join p a Source # (<*>) :: Join p (a -> b) -> Join p a -> Join p b Source # liftA2 :: (a -> b -> c) -> Join p a -> Join p b -> Join p c Source # (*>) :: Join p a -> Join p b -> Join p b Source # (<*) :: Join p a -> Join p b -> Join p a Source #
Monad m => Applicative (ZipSink i m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods pure :: a -> ZipSink i m a Source # (<*>) :: ZipSink i m (a -> b) -> ZipSink i m a -> ZipSink i m b Source # liftA2 :: (a -> b -> c) -> ZipSink i m a -> ZipSink i m b -> ZipSink i m c Source # (*>) :: ZipSink i m a -> ZipSink i m b -> ZipSink i m b Source # (<*) :: ZipSink i m a -> ZipSink i m b -> ZipSink i m a Source #
(Applicative f, Monad f) => Applicative (WhenMissing f x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))`. Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMissing f x a Source #

(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c Source #

(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source #

(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a Source #

(Functor f, Functor a, Monad a) => Applicative (FreeT f a) |
Instance details Defined in Control.Monad.Free Methods pure :: a0 -> FreeT f a a0 Source # (<*>) :: FreeT f a (a0 -> b) -> FreeT f a a0 -> FreeT f a b Source # liftA2 :: (a0 -> b -> c) -> FreeT f a a0 -> FreeT f a b -> FreeT f a c Source # (*>) :: FreeT f a a0 -> FreeT f a b -> FreeT f a b Source # (<*) :: FreeT f a a0 -> FreeT f a b -> FreeT f a a0 Source #
Applicative (Bazaar a b) |
Instance details Defined in Lens.Micro Methods pure :: a0 -> Bazaar a b a0 Source # (<*>) :: Bazaar a b (a0 -> b0) -> Bazaar a b a0 -> Bazaar a b b0 Source # liftA2 :: (a0 -> b0 -> c) -> Bazaar a b a0 -> Bazaar a b b0 -> Bazaar a b c Source # (*>) :: Bazaar a b a0 -> Bazaar a b b0 -> Bazaar a b b0 Source # (<*) :: Bazaar a b a0 -> Bazaar a b b0 -> Bazaar a b a0 Source #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Lens.Micro Methods pure :: a -> StateT s m a Source # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source # (*>) :: StateT s m a -> StateT s m b -> StateT s m b Source # (<*) :: StateT s m a -> StateT s m b -> StateT s m a Source #
Applicative (Tagged s) |
Instance details Defined in Data.Tagged Methods pure :: a -> Tagged s a Source # (<*>) :: Tagged s (a -> b) -> Tagged s a -> Tagged s b Source # liftA2 :: (a -> b -> c) -> Tagged s a -> Tagged s b -> Tagged s c Source # (*>) :: Tagged s a -> Tagged s b -> Tagged s b Source # (<*) :: Tagged s a -> Tagged s b -> Tagged s a Source #
(Functor m, Monad m) => Applicative (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods pure :: a -> ErrorT e m a Source # (<*>) :: ErrorT e m (a -> b) -> ErrorT e m a -> ErrorT e m b Source # liftA2 :: (a -> b -> c) -> ErrorT e m a -> ErrorT e m b -> ErrorT e m c Source # (*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b Source # (<*) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m a Source #
(Functor m, Monad m) => Applicative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods pure :: a -> ExceptT e m a Source # (<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b Source # liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c Source # (*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b Source # (<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a Source #
Applicative m => Applicative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods pure :: a -> ReaderT r m a Source # (<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b Source # liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c Source # (*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b Source # (<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a Source #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods pure :: a -> StateT s m a Source # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source # (*>) :: StateT s m a -> StateT s m b -> StateT s m b Source # (<*) :: StateT s m a -> StateT s m b -> StateT s m a Source #
(Monoid a, Monoid b) => Applicative ((,,) a b) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, b, a0) Source # (<*>) :: (a, b, a0 -> b0) -> (a, b, a0) -> (a, b, b0) Source # liftA2 :: (a0 -> b0 -> c) -> (a, b, a0) -> (a, b, b0) -> (a, b, c) Source # (*>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) Source # (<*) :: (a, b, a0) -> (a, b, b0) -> (a, b, a0) Source #
(Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :*: g) a Source # (<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b Source # liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c Source # (*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source # (<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a Source #
Monoid c => Applicative (K1 i c :: Type -> Type) | Since: base-4.12.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> K1 i c a Source # (<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b Source # liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 Source # (*>) :: K1 i c a -> K1 i c b -> K1 i c b Source # (<*) :: K1 i c a -> K1 i c b -> K1 i c a Source #
Applicative (ConduitT i o m) |

Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

pure :: a -> ConduitT i o m a Source #

(<*>) :: ConduitT i o m (a -> b) -> ConduitT i o m a -> ConduitT i o m b Source #

liftA2 :: (a -> b -> c) -> ConduitT i o m a -> ConduitT i o m b -> ConduitT i o m c Source #

(*>) :: ConduitT i o m a -> ConduitT i o m b -> ConduitT i o m b Source #

(<*) :: ConduitT i o m a -> ConduitT i o m b -> ConduitT i o m a Source #

Monad m => Applicative (ZipConduit i o m) |

Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

pure :: a -> ZipConduit i o m a Source #

(<*>) :: ZipConduit i o m (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b Source #

liftA2 :: (a -> b -> c) -> ZipConduit i o m a -> ZipConduit i o m b -> ZipConduit i o m c Source #

(*>) :: ZipConduit i o m a -> ZipConduit i o m b -> ZipConduit i o m b Source #

(<*) :: ZipConduit i o m a -> ZipConduit i o m b -> ZipConduit i o m a Source #

(Monad f, Applicative f) => Applicative (WhenMatched f x y) | Equivalent to `ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMatched f x y a Source #

(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c Source #

(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source #

(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a Source #

(Applicative f, Monad f) => Applicative (WhenMissing f k x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))` . Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMissing f k x a Source #

(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c Source #

(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source #

(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a Source #

Stream s => Applicative (ParsecT e s m) | `pure` returns a parser that succeeds without consuming input.

Instance details

Defined in Text.Megaparsec.Internal

Methods

pure :: a -> ParsecT e s m a Source #

(<*>) :: ParsecT e s m (a -> b) -> ParsecT e s m a -> ParsecT e s m b Source #

liftA2 :: (a -> b -> c) -> ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m c Source #

(*>) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m b Source #

(<*) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m a Source #

(Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, b, c, a0) Source # (<*>) :: (a, b, c, a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) Source # liftA2 :: (a0 -> b0 -> c0) -> (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, c0) Source # (*>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source # (<*) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, a0) Source #
Applicative ((->) r) | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> r -> a Source # (<*>) :: (r -> (a -> b)) -> (r -> a) -> r -> b Source # liftA2 :: (a -> b -> c) -> (r -> a) -> (r -> b) -> r -> c Source # (*>) :: (r -> a) -> (r -> b) -> r -> b Source # (<*) :: (r -> a) -> (r -> b) -> r -> a Source #
(Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a Source # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source # (*>) :: Compose f g a -> Compose f g b -> Compose f g b Source # (<*) :: Compose f g a -> Compose f g b -> Compose f g a Source #
(Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :.: g) a Source # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b Source # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a Source #
Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> M1 i c f a Source # (<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b Source # liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 Source # (*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source # (<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a Source #
(Monad f, Applicative f) => Applicative (WhenMatched f k x y) | Equivalent to `ReaderT k (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMatched f k x y a Source #

(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c Source #

(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source #

(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a Source #

Monad m => Applicative (Pipe l i o u m) |

Instance details

Defined in Data.Conduit.Internal.Pipe

Methods

pure :: a -> Pipe l i o u m a Source #

(<*>) :: Pipe l i o u m (a -> b) -> Pipe l i o u m a -> Pipe l i o u m b Source #

liftA2 :: (a -> b -> c) -> Pipe l i o u m a -> Pipe l i o u m b -> Pipe l i o u m c Source #

(*>) :: Pipe l i o u m a -> Pipe l i o u m b -> Pipe l i o u m b Source #

(<*) :: Pipe l i o u m a -> Pipe l i o u m b -> Pipe l i o u m a Source #

class Functor (f :: Type -> Type) where Source #

A type `f` is a Functor if it provides a function `fmap` which, given any types `a` and `b` lets you apply any function from `(a -> b)` to turn an `f a` into an `f b`, preserving the structure of `f`. Furthermore `f` needs to adhere to the following:

Identity
  ``fmap` `id` == `id``
Composition
  ``fmap` (f . g) == `fmap` f . `fmap` g`

Note, that the second law follows from the free theorem of the type `fmap` and the first law, so you need only check that the former condition holds. See https://www.schoolofhaskell.com/user/edwardk/snippets/fmap or https://github.com/quchen/articles/blob/master/second_functor_law.md for an explanation.

Minimal complete definition

fmap

Methods

fmap :: (a -> b) -> f a -> f b Source #

`fmap` is used to apply a function of type `(a -> b)` to a value of type `f a`, where f is a functor, to produce a value of type `f b`. Note that for any type constructor with more than one parameter (e.g., `Either`), only the last type parameter can be modified with `fmap` (e.g., `b` in `Either a b`).

Some type constructors with two parameters or more have a ``Bifunctor`` instance that allows both the last and the penultimate parameters to be mapped over.

#### Examples

Expand

Convert from a ``Maybe` Int` to a `Maybe String` using `show`:

    >>> fmap show Nothing
    Nothing
    >>> fmap show (Just 3)
    Just "3"

Convert from an ``Either` Int Int` to an `Either Int String` using `show`:

    >>> fmap show (Left 17)
    Left 17
    >>> fmap show (Right 17)
    Right "17"

Double each element of a list:

    >>> fmap (*2) [1,2,3]
    [2,4,6]

Apply `even` to the second element of a pair:

    >>> fmap even (2,2)
    (2,True)

It may seem surprising that the function is only applied to the last element of the tuple compared to the list example above which applies it to every element in the list. To understand, remember that tuples are type constructors with multiple type parameters: a tuple of 3 elements `(a,b,c)` can also be written `(,,) a b c` and its `Functor` instance is defined for `Functor ((,,) a b)` (i.e., only the third parameter is free to be mapped over with `fmap`).

It explains why `fmap` can be used with tuples containing values of different types as in the following example:

    >>> fmap even ("hello", 1.0, 4)
    ("hello",1.0,True)

(<$) :: a -> f b -> f a infixl 4 Source #

Replace all locations in the input with the same value. The default definition is ``fmap` . `const``, but this may be overridden with a more efficient version.

#### Instances

Instances details

Functor Only |
Instance details Defined in Data.Tuple.Only Methods fmap :: (a -> b) -> Only a -> Only b Source # (<$) :: a -> Only b -> Only a Source #
Functor KeyMap |
Instance details Defined in Data.Aeson.KeyMap Methods fmap :: (a -> b) -> KeyMap a -> KeyMap b Source # (<$) :: a -> KeyMap b -> KeyMap a Source #
Functor FromJSONKeyFunction | Only law abiding up to interpretation
Instance details Defined in Data.Aeson.Types.FromJSON Methods fmap :: (a -> b) -> FromJSONKeyFunction a -> FromJSONKeyFunction b Source # (<$) :: a -> FromJSONKeyFunction b -> FromJSONKeyFunction a Source #
Functor IResult |
Instance details Defined in Data.Aeson.Types.Internal Methods fmap :: (a -> b) -> IResult a -> IResult b Source # (<$) :: a -> IResult b -> IResult a Source #
Functor Parser |
Instance details Defined in Data.Aeson.Types.Internal Methods fmap :: (a -> b) -> Parser a -> Parser b Source # (<$) :: a -> Parser b -> Parser a Source #
Functor Result |
Instance details Defined in Data.Aeson.Types.Internal Methods fmap :: (a -> b) -> Result a -> Result b Source # (<$) :: a -> Result b -> Result a Source #
Functor ZipList | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b Source # (<$) :: a -> ZipList b -> ZipList a Source #
Functor Handler | Since: base-4.6.0.0
Instance details Defined in Control.Exception Methods fmap :: (a -> b) -> Handler a -> Handler b Source # (<$) :: a -> Handler b -> Handler a Source #
Functor Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b Source # (<$) :: a -> Identity b -> Identity a Source #
Functor Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods fmap :: (a -> b) -> Down a -> Down b Source # (<$) :: a -> Down b -> Down a Source #
Functor First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> First a -> First b Source # (<$) :: a -> First b -> First a Source #
Functor Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Last a -> Last b Source # (<$) :: a -> Last b -> Last a Source #
Functor Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Max a -> Max b Source # (<$) :: a -> Max b -> Max a Source #
Functor Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Min a -> Min b Source # (<$) :: a -> Min b -> Min a Source #
Functor Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Dual a -> Dual b Source # (<$) :: a -> Dual b -> Dual a Source #
Functor Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Product a -> Product b Source # (<$) :: a -> Product b -> Product a Source #
Functor Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Sum a -> Sum b Source # (<$) :: a -> Sum b -> Sum a Source #
Functor STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods fmap :: (a -> b) -> STM a -> STM b Source # (<$) :: a -> STM b -> STM a Source #
Functor Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Par1 a -> Par1 b Source # (<$) :: a -> Par1 b -> Par1 a Source #
Functor P | Since: base-4.8.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> P a -> P b Source # (<$) :: a -> P b -> P a Source #
Functor ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> ReadP a -> ReadP b Source # (<$) :: a -> ReadP b -> ReadP a Source #
Functor ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fmap :: (a -> b) -> ReadPrec a -> ReadPrec b Source # (<$) :: a -> ReadPrec b -> ReadPrec a Source #
Functor Put |
Instance details Defined in Data.ByteString.Builder.Internal Methods fmap :: (a -> b) -> Put a -> Put b Source # (<$) :: a -> Put b -> Put a Source #
Functor Capture |
Instance details Defined in System.Console.CmdArgs.Annotate Methods fmap :: (a -> b) -> Capture a -> Capture b Source # (<$) :: a -> Capture b -> Capture a Source #
Functor Group |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods fmap :: (a -> b) -> Group a -> Group b Source # (<$) :: a -> Group b -> Group a Source #
Functor CmdArgs |
Instance details Defined in System.Console.CmdArgs.Implicit.Type Methods fmap :: (a -> b) -> CmdArgs a -> CmdArgs b Source # (<$) :: a -> CmdArgs b -> CmdArgs a Source #
Functor RGB |
Instance details Defined in Data.Colour.RGB Methods fmap :: (a -> b) -> RGB a -> RGB b Source # (<$) :: a -> RGB b -> RGB a Source #
Functor Flush |
Instance details Defined in Data.Conduit.Internal.Conduit Methods fmap :: (a -> b) -> Flush a -> Flush b Source # (<$) :: a -> Flush b -> Flush a Source #
Functor SCC | Since: containers-0.5.4
Instance details Defined in Data.Graph Methods fmap :: (a -> b) -> SCC a -> SCC b Source # (<$) :: a -> SCC b -> SCC a Source #
Functor IntMap |
Instance details Defined in Data.IntMap.Internal Methods fmap :: (a -> b) -> IntMap a -> IntMap b Source # (<$) :: a -> IntMap b -> IntMap a Source #
Functor Digit |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> Digit a -> Digit b Source # (<$) :: a -> Digit b -> Digit a Source #
Functor Elem |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> Elem a -> Elem b Source # (<$) :: a -> Elem b -> Elem a Source #
Functor FingerTree |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> FingerTree a -> FingerTree b Source # (<$) :: a -> FingerTree b -> FingerTree a Source #
Functor Node |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> Node a -> Node b Source # (<$) :: a -> Node b -> Node a Source #
Functor Seq |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> Seq a -> Seq b Source # (<$) :: a -> Seq b -> Seq a Source #
Functor ViewL |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> ViewL a -> ViewL b Source # (<$) :: a -> ViewL b -> ViewL a Source #
Functor ViewR |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> ViewR a -> ViewR b Source # (<$) :: a -> ViewR b -> ViewR a Source #
Functor Tree |
Instance details Defined in Data.Tree Methods fmap :: (a -> b) -> Tree a -> Tree b Source # (<$) :: a -> Tree b -> Tree a Source #
Functor DNonEmpty |
Instance details Defined in Data.DList.DNonEmpty.Internal Methods fmap :: (a -> b) -> DNonEmpty a -> DNonEmpty b Source # (<$) :: a -> DNonEmpty b -> DNonEmpty a Source #
Functor DList |
Instance details Defined in Data.DList.Internal Methods fmap :: (a -> b) -> DList a -> DList b Source # (<$) :: a -> DList b -> DList a Source #
Functor Doc |
Instance details Defined in Text.DocLayout Methods fmap :: (a -> b) -> Doc a -> Doc b Source # (<$) :: a -> Doc b -> Doc a Source #
Functor IO | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b Source # (<$) :: a -> IO b -> IO a Source #
Functor Root |
Instance details Defined in Numeric.RootFinding Methods fmap :: (a -> b) -> Root a -> Root b Source # (<$) :: a -> Root b -> Root a Source #
Functor ErrorFancy |
Instance details Defined in Text.Megaparsec.Error Methods fmap :: (a -> b) -> ErrorFancy a -> ErrorFancy b Source # (<$) :: a -> ErrorFancy b -> ErrorFancy a Source #
Functor ErrorItem |
Instance details Defined in Text.Megaparsec.Error Methods fmap :: (a -> b) -> ErrorItem a -> ErrorItem b Source # (<$) :: a -> ErrorItem b -> ErrorItem a Source #
Functor AnnotDetails |
Instance details Defined in Text.PrettyPrint.Annotated.HughesPJ Methods fmap :: (a -> b) -> AnnotDetails a -> AnnotDetails b Source # (<$) :: a -> AnnotDetails b -> AnnotDetails a Source #
Functor Doc |
Instance details Defined in Text.PrettyPrint.Annotated.HughesPJ Methods fmap :: (a -> b) -> Doc a -> Doc b Source # (<$) :: a -> Doc b -> Doc a Source #
Functor Span |
Instance details Defined in Text.PrettyPrint.Annotated.HughesPJ Methods fmap :: (a -> b) -> Span a -> Span b Source # (<$) :: a -> Span b -> Span a Source #
Functor Doc |
Instance details Defined in Prettyprinter.Internal Methods fmap :: (a -> b) -> Doc a -> Doc b Source # (<$) :: a -> Doc b -> Doc a Source #
Functor FlattenResult |
Instance details Defined in Prettyprinter.Internal Methods fmap :: (a -> b) -> FlattenResult a -> FlattenResult b Source # (<$) :: a -> FlattenResult b -> FlattenResult a Source #
Functor SimpleDocStream |
Instance details Defined in Prettyprinter.Internal Methods fmap :: (a -> b) -> SimpleDocStream a -> SimpleDocStream b Source # (<$) :: a -> SimpleDocStream b -> SimpleDocStream a Source #
Functor Array |
Instance details Defined in Data.Primitive.Array Methods fmap :: (a -> b) -> Array a -> Array b Source # (<$) :: a -> Array b -> Array a Source #
Functor SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods fmap :: (a -> b) -> SmallArray a -> SmallArray b Source # (<$) :: a -> SmallArray b -> SmallArray a Source #
Functor Maybe |
Instance details Defined in Data.Strict.Maybe Methods fmap :: (a -> b) -> Maybe a -> Maybe b Source # (<$) :: a -> Maybe b -> Maybe a Source #
Functor Header |
Instance details Defined in Text.Tabular Methods fmap :: (a -> b) -> Header a -> Header b Source # (<$) :: a -> Header b -> Header a Source #
Functor Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods fmap :: (a -> b) -> Q a -> Q b Source # (<$) :: a -> Q b -> Q a Source #
Functor TyVarBndr |
Instance details Defined in Language.Haskell.TH.Syntax Methods fmap :: (a -> b) -> TyVarBndr a -> TyVarBndr b Source # (<$) :: a -> TyVarBndr b -> TyVarBndr a Source #
Functor Window |
Instance details Defined in System.Console.Terminal.Common Methods fmap :: (a -> b) -> Window a -> Window b Source # (<$) :: a -> Window b -> Window a Source #
Functor Capability |
Instance details Defined in System.Console.Terminfo.Base Methods fmap :: (a -> b) -> Capability a -> Capability b Source # (<$) :: a -> Capability b -> Capability a Source #
Functor Vector |
Instance details Defined in Data.Vector Methods fmap :: (a -> b) -> Vector a -> Vector b Source # (<$) :: a -> Vector b -> Vector a Source #
Functor Haskeline |
Instance details Defined in System.Console.Wizard.Haskeline Methods fmap :: (a -> b) -> Haskeline a -> Haskeline b Source # (<$) :: a -> Haskeline b -> Haskeline a Source #
Functor WithSettings |
Instance details Defined in System.Console.Wizard.Haskeline Methods fmap :: (a -> b) -> WithSettings a -> WithSettings b Source # (<$) :: a -> WithSettings b -> WithSettings a Source #
Functor ArbitraryIO |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> ArbitraryIO a -> ArbitraryIO b Source # (<$) :: a -> ArbitraryIO b -> ArbitraryIO a Source #
Functor Character |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> Character a -> Character b Source # (<$) :: a -> Character b -> Character a Source #
Functor Line |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> Line a -> Line b Source # (<$) :: a -> Line b -> Line a Source #
Functor LinePrewritten |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> LinePrewritten a -> LinePrewritten b Source # (<$) :: a -> LinePrewritten b -> LinePrewritten a Source #
Functor Output |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> Output a -> Output b Source # (<$) :: a -> Output b -> Output a Source #
Functor OutputLn |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> OutputLn a -> OutputLn b Source # (<$) :: a -> OutputLn b -> OutputLn a Source #
Functor Password |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> Password a -> Password b Source # (<$) :: a -> Password b -> Password a Source #
Functor NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> NonEmpty a -> NonEmpty b Source # (<$) :: a -> NonEmpty b -> NonEmpty a Source #
Functor Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b Source # (<$) :: a -> Maybe b -> Maybe a Source #
Functor Solo | Since: base-4.15
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Solo a -> Solo b Source # (<$) :: a -> Solo b -> Solo a Source #
Functor [] | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> [a] -> [b] Source # (<$) :: a -> [b] -> [a] Source #
Functor (IResult i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods fmap :: (a -> b) -> IResult i a -> IResult i b Source # (<$) :: a -> IResult i b -> IResult i a Source #
Functor (Parser i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods fmap :: (a -> b) -> Parser i a -> Parser i b Source # (<$) :: a -> Parser i b -> Parser i a Source #
Monad m => Functor (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a Source #
Arrow a => Functor (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 Source #
Functor (Either a) | Since: base-3.0
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b Source # (<$) :: a0 -> Either a b -> Either a a0 Source #
Functor (StateL s) | Since: base-4.0
Instance details Defined in Data.Functor.Utils Methods fmap :: (a -> b) -> StateL s a -> StateL s b Source # (<$) :: a -> StateL s b -> StateL s a Source #
Functor (StateR s) | Since: base-4.0
Instance details Defined in Data.Functor.Utils Methods fmap :: (a -> b) -> StateR s a -> StateR s b Source # (<$) :: a -> StateR s b -> StateR s a Source #
Functor (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a0 -> b) -> Arg a a0 -> Arg a b Source # (<$) :: a0 -> Arg a b -> Arg a a0 Source #
Functor (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> U1 a -> U1 b Source # (<$) :: a -> U1 b -> U1 a Source #
Functor (V1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> V1 a -> V1 b Source # (<$) :: a -> V1 b -> V1 a Source #
Functor (ST s) | Since: base-2.1
Instance details Defined in GHC.ST Methods fmap :: (a -> b) -> ST s a -> ST s b Source # (<$) :: a -> ST s b -> ST s a Source #
Monad m => Functor (ZipSource m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods fmap :: (a -> b) -> ZipSource m a -> ZipSource m b Source # (<$) :: a -> ZipSource m b -> ZipSource m a Source #
Functor (SetM s) |
Instance details Defined in Data.Graph Methods fmap :: (a -> b) -> SetM s a -> SetM s b Source # (<$) :: a -> SetM s b -> SetM s a Source #
Functor (Map k) |
Instance details Defined in Data.Map.Internal Methods fmap :: (a -> b) -> Map k a -> Map k b Source # (<$) :: a -> Map k b -> Map k a Source #
Functor f => Functor (Free f) |
Instance details Defined in Control.Monad.Free Methods fmap :: (a -> b) -> Free f a -> Free f b Source # (<$) :: a -> Free f b -> Free f a Source #
Monad m => Functor (Handler m) |
Instance details Defined in Control.Monad.Catch Methods fmap :: (a -> b) -> Handler m a -> Handler m b Source # (<$) :: a -> Handler m b -> Handler m a Source #
Functor m => Functor (InputT m) |
Instance details Defined in System.Console.Haskeline.InputT Methods fmap :: (a -> b) -> InputT m a -> InputT m b Source # (<$) :: a -> InputT m b -> InputT m a Source #
Functor (CompoundPeriodicReport a) |
Instance details Defined in Hledger.Reports.ReportTypes Methods fmap :: (a0 -> b) -> CompoundPeriodicReport a a0 -> CompoundPeriodicReport a b Source # (<$) :: a0 -> CompoundPeriodicReport a b -> CompoundPeriodicReport a a0 Source #
Functor (PeriodicReport a) |
Instance details Defined in Hledger.Reports.ReportTypes Methods fmap :: (a0 -> b) -> PeriodicReport a a0 -> PeriodicReport a b Source # (<$) :: a0 -> PeriodicReport a b -> PeriodicReport a a0 Source #
Functor (PeriodicReportRow a) |
Instance details Defined in Hledger.Reports.ReportTypes Methods fmap :: (a0 -> b) -> PeriodicReportRow a a0 -> PeriodicReportRow a b Source # (<$) :: a0 -> PeriodicReportRow a b -> PeriodicReportRow a a0 Source #
Functor m => Functor (HtmlT m) | Just re-uses Monad.
Instance details Defined in Lucid.Base Methods fmap :: (a -> b) -> HtmlT m a -> HtmlT m b Source # (<$) :: a -> HtmlT m b -> HtmlT m a Source #
Functor f => Functor (WrappedPoly f) |
Instance details Defined in Data.MonoTraversable Methods fmap :: (a -> b) -> WrappedPoly f a -> WrappedPoly f b Source # (<$) :: a -> WrappedPoly f b -> WrappedPoly f a Source #
Functor m => Functor (ResourceT m) |
Instance details Defined in Control.Monad.Trans.Resource.Internal Methods fmap :: (a -> b) -> ResourceT m a -> ResourceT m b Source # (<$) :: a -> ResourceT m b -> ResourceT m a Source #
Functor (Either a) |
Instance details Defined in Data.Strict.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b Source # (<$) :: a0 -> Either a b -> Either a a0 Source #
Functor (These a) |
Instance details Defined in Data.Strict.These Methods fmap :: (a0 -> b) -> These a a0 -> These a b Source # (<$) :: a0 -> These a b -> These a a0 Source #
Functor (Pair e) |
Instance details Defined in Data.Strict.Tuple Methods fmap :: (a -> b) -> Pair e a -> Pair e b Source # (<$) :: a -> Pair e b -> Pair e a Source #
Functor m => Functor (QuoteToQuasi m) |
Instance details Defined in Language.Haskell.TH.Syntax.Compat Methods fmap :: (a -> b) -> QuoteToQuasi m a -> QuoteToQuasi m b Source # (<$) :: a -> QuoteToQuasi m b -> QuoteToQuasi m a Source #
Functor (These a) |
Instance details Defined in Data.These Methods fmap :: (a0 -> b) -> These a a0 -> These a b Source # (<$) :: a0 -> These a b -> These a a0 Source #
Functor m => Functor (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods fmap :: (a -> b) -> MaybeT m a -> MaybeT m b Source # (<$) :: a -> MaybeT m b -> MaybeT m a Source #
Functor (HashMap k) |
Instance details Defined in Data.HashMap.Internal Methods fmap :: (a -> b) -> HashMap k a -> HashMap k b Source # (<$) :: a -> HashMap k b -> HashMap k a Source #
Functor backend => Functor (Wizard backend) |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> Wizard backend a -> Wizard backend b Source # (<$) :: a -> Wizard backend b -> Wizard backend a Source #
Functor ((,) a) | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b) -> (a, a0) -> (a, b) Source # (<$) :: a0 -> (a, b) -> (a, a0) Source #
Arrow a => Functor (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #
Functor m => Functor (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in Control.Arrow Methods fmap :: (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b Source # (<$) :: a0 -> Kleisli m a b -> Kleisli m a a0 Source #
Functor (Const m :: Type -> Type) | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b Source # (<$) :: a -> Const m b -> Const m a Source #
Functor f => Functor (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Alt f a -> Alt f b Source # (<$) :: a -> Alt f b -> Alt f a Source #
(Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Generically1 f a -> Generically1 f b Source # (<$) :: a -> Generically1 f b -> Generically1 f a Source #
Functor f => Functor (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Rec1 f a -> Rec1 f b Source # (<$) :: a -> Rec1 f b -> Rec1 f a Source #
Functor (URec (Ptr ()) :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b Source # (<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a Source #
Functor (URec Char :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b Source # (<$) :: a -> URec Char b -> URec Char a Source #
Functor (URec Double :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Double a -> URec Double b Source # (<$) :: a -> URec Double b -> URec Double a Source #
Functor (URec Float :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Float a -> URec Float b Source # (<$) :: a -> URec Float b -> URec Float a Source #
Functor (URec Int :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Int a -> URec Int b Source # (<$) :: a -> URec Int b -> URec Int a Source #
Functor (URec Word :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b Source # (<$) :: a -> URec Word b -> URec Word a Source #
Bifunctor p => Functor (Join p) |
Instance details Defined in Data.Bifunctor.Join Methods fmap :: (a -> b) -> Join p a -> Join p b Source # (<$) :: a -> Join p b -> Join p a Source #
Monad m => Functor (ZipSink i m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods fmap :: (a -> b) -> ZipSink i m a -> ZipSink i m b Source # (<$) :: a -> ZipSink i m b -> ZipSink i m a Source #
(Applicative f, Monad f) => Functor (WhenMissing f x) | Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods fmap :: (a -> b) -> WhenMissing f x a -> WhenMissing f x b Source # (<$) :: a -> WhenMissing f x b -> WhenMissing f x a Source #
(Functor f, Functor m) => Functor (FreeT f m) |
Instance details Defined in Control.Monad.Free Methods fmap :: (a -> b) -> FreeT f m a -> FreeT f m b Source # (<$) :: a -> FreeT f m b -> FreeT f m a Source #
Functor (Bazaar a b) |
Instance details Defined in Lens.Micro Methods fmap :: (a0 -> b0) -> Bazaar a b a0 -> Bazaar a b b0 Source # (<$) :: a0 -> Bazaar a b b0 -> Bazaar a b a0 Source #
Functor m => Functor (StateT s m) |
Instance details Defined in Lens.Micro Methods fmap :: (a -> b) -> StateT s m a -> StateT s m b Source # (<$) :: a -> StateT s m b -> StateT s m a Source #
Functor (Tagged s) |
Instance details Defined in Data.Tagged Methods fmap :: (a -> b) -> Tagged s a -> Tagged s b Source # (<$) :: a -> Tagged s b -> Tagged s a Source #
(Functor f, Functor g) => Functor (These1 f g) |
Instance details Defined in Data.Functor.These Methods fmap :: (a -> b) -> These1 f g a -> These1 f g b Source # (<$) :: a -> These1 f g b -> These1 f g a Source #
Functor m => Functor (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods fmap :: (a -> b) -> ErrorT e m a -> ErrorT e m b Source # (<$) :: a -> ErrorT e m b -> ErrorT e m a Source #
Functor m => Functor (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods fmap :: (a -> b) -> ExceptT e m a -> ExceptT e m b Source # (<$) :: a -> ExceptT e m b -> ExceptT e m a Source #
Functor m => Functor (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods fmap :: (a -> b) -> ReaderT r m a -> ReaderT r m b Source # (<$) :: a -> ReaderT r m b -> ReaderT r m a Source #
Functor m => Functor (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods fmap :: (a -> b) -> StateT s m a -> StateT s m b Source # (<$) :: a -> StateT s m b -> StateT s m a Source #
(Functor f, Functor g) => Functor (f :+: g) |
Instance details Defined in System.Console.Wizard.Internal Methods fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b Source # (<$) :: a -> (f :+: g) b -> (f :+: g) a Source #
Functor ((,,) a b) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, a0) -> (a, b, b0) Source # (<$) :: a0 -> (a, b, b0) -> (a, b, a0) Source #
(Functor f, Functor g) => Functor (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b Source # (<$) :: a -> (f :*: g) b -> (f :*: g) a Source #
(Functor f, Functor g) => Functor (f :+: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b Source # (<$) :: a -> (f :+: g) b -> (f :+: g) a Source #
Functor (K1 i c :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> K1 i c a -> K1 i c b Source # (<$) :: a -> K1 i c b -> K1 i c a Source #
Functor (ConduitT i o m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods fmap :: (a -> b) -> ConduitT i o m a -> ConduitT i o m b Source # (<$) :: a -> ConduitT i o m b -> ConduitT i o m a Source #
Functor (ZipConduit i o m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods fmap :: (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b Source # (<$) :: a -> ZipConduit i o m b -> ZipConduit i o m a Source #
Functor f => Functor (WhenMatched f x y) | Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods fmap :: (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b Source # (<$) :: a -> WhenMatched f x y b -> WhenMatched f x y a Source #
(Applicative f, Monad f) => Functor (WhenMissing f k x) | Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods fmap :: (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b Source # (<$) :: a -> WhenMissing f k x b -> WhenMissing f k x a Source #
Functor (ParsecT e s m) |
Instance details Defined in Text.Megaparsec.Internal Methods fmap :: (a -> b) -> ParsecT e s m a -> ParsecT e s m b Source # (<$) :: a -> ParsecT e s m b -> ParsecT e s m a Source #
Functor ((,,,) a b c) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) Source # (<$) :: a0 -> (a, b, c, b0) -> (a, b, c, a0) Source #
Functor ((->) r) | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> (r -> a) -> r -> b Source # (<$) :: a -> (r -> b) -> r -> a Source #
(Functor f, Functor g) => Functor (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fmap :: (a -> b) -> Compose f g a -> Compose f g b Source # (<$) :: a -> Compose f g b -> Compose f g a Source #
(Functor f, Functor g) => Functor (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b Source # (<$) :: a -> (f :.: g) b -> (f :.: g) a Source #
Functor f => Functor (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> M1 i c f a -> M1 i c f b Source # (<$) :: a -> M1 i c f b -> M1 i c f a Source #
Functor (Clown f a :: Type -> Type) |
Instance details Defined in Data.Bifunctor.Clown Methods fmap :: (a0 -> b) -> Clown f a a0 -> Clown f a b Source # (<$) :: a0 -> Clown f a b -> Clown f a a0 Source #
Bifunctor p => Functor (Flip p a) |
Instance details Defined in Data.Bifunctor.Flip Methods fmap :: (a0 -> b) -> Flip p a a0 -> Flip p a b Source # (<$) :: a0 -> Flip p a b -> Flip p a a0 Source #
Functor g => Functor (Joker g a) |
Instance details Defined in Data.Bifunctor.Joker Methods fmap :: (a0 -> b) -> Joker g a a0 -> Joker g a b Source # (<$) :: a0 -> Joker g a b -> Joker g a a0 Source #
Bifunctor p => Functor (WrappedBifunctor p a) |
Instance details Defined in Data.Bifunctor.Wrapped Methods fmap :: (a0 -> b) -> WrappedBifunctor p a a0 -> WrappedBifunctor p a b Source # (<$) :: a0 -> WrappedBifunctor p a b -> WrappedBifunctor p a a0 Source #
Functor f => Functor (WhenMatched f k x y) | Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods fmap :: (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b Source # (<$) :: a -> WhenMatched f k x y b -> WhenMatched f k x y a Source #
(Functor (f a), Functor (g a)) => Functor (Product f g a) |
Instance details Defined in Data.Bifunctor.Product Methods fmap :: (a0 -> b) -> Product f g a a0 -> Product f g a b Source # (<$) :: a0 -> Product f g a b -> Product f g a a0 Source #
(Functor (f a), Functor (g a)) => Functor (Sum f g a) |
Instance details Defined in Data.Bifunctor.Sum Methods fmap :: (a0 -> b) -> Sum f g a a0 -> Sum f g a b Source # (<$) :: a0 -> Sum f g a b -> Sum f g a a0 Source #
Monad m => Functor (Pipe l i o u m) |
Instance details Defined in Data.Conduit.Internal.Pipe Methods fmap :: (a -> b) -> Pipe l i o u m a -> Pipe l i o u m b Source # (<$) :: a -> Pipe l i o u m b -> Pipe l i o u m a Source #
(Functor f, Bifunctor p) => Functor (Tannen f p a) |
Instance details Defined in Data.Bifunctor.Tannen Methods fmap :: (a0 -> b) -> Tannen f p a a0 -> Tannen f p a b Source # (<$) :: a0 -> Tannen f p a b -> Tannen f p a a0 Source #
(Bifunctor p, Functor g) => Functor (Biff p f g a) |
Instance details Defined in Data.Bifunctor.Biff Methods fmap :: (a0 -> b) -> Biff p f g a a0 -> Biff p f g a b Source # (<$) :: a0 -> Biff p f g a b -> Biff p f g a a0 Source #

class Applicative m => Monad (m :: Type -> Type) where Source #

The `Monad` class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's `do` expressions provide a convenient syntax for writing monadic expressions.

Instances of `Monad` should satisfy the following:

Left identity
  ``return` a `>>=` k = k a`
Right identity
  `m `>>=` `return` = m`
Associativity
  `m `>>=` (\x -> k x `>>=` h) = (m `>>=` k) `>>=` h`

Furthermore, the `Monad` and `Applicative` operations should relate as follows:

-     pure = return

-     m1 <*> m2 = m1 >>= (\x1 -> m2 >>= (\x2 -> return (x1 x2)))

The above laws imply:

-     fmap f xs  =  xs >>= return . f

-     (>>) = (*>)

and that `pure` and (`<*>`) satisfy the applicative functor laws.

The instances of `Monad` for lists, `Maybe` and `IO` defined in the Prelude satisfy these laws.

Minimal complete definition

(>>=)

Methods

(>>=) :: m a -> (a -> m b) -> m b infixl 1 Source #

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

'`as `>>=` bs`' can be understood as the `do` expression

    do a <- as
       bs a

(>>) :: m a -> m b -> m b infixl 1 Source #

Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

'`as `>>` bs`' can be understood as the `do` expression

    do as
       bs

return :: a -> m a Source #

Inject a value into the monadic type.

#### Instances

Instances details

Monad IResult |
Instance details Defined in Data.Aeson.Types.Internal Methods (>>=) :: IResult a -> (a -> IResult b) -> IResult b Source # (>>) :: IResult a -> IResult b -> IResult b Source # return :: a -> IResult a Source #
Monad Parser |
Instance details Defined in Data.Aeson.Types.Internal Methods (>>=) :: Parser a -> (a -> Parser b) -> Parser b Source # (>>) :: Parser a -> Parser b -> Parser b Source # return :: a -> Parser a Source #
Monad Result |
Instance details Defined in Data.Aeson.Types.Internal Methods (>>=) :: Result a -> (a -> Result b) -> Result b Source # (>>) :: Result a -> Result b -> Result b Source # return :: a -> Result a Source #
Monad Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b Source # (>>) :: Identity a -> Identity b -> Identity b Source # return :: a -> Identity a Source #
Monad Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (>>=) :: Down a -> (a -> Down b) -> Down b Source # (>>) :: Down a -> Down b -> Down b Source # return :: a -> Down a Source #
Monad First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: First a -> (a -> First b) -> First b Source # (>>) :: First a -> First b -> First b Source # return :: a -> First a Source #
Monad Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Last a -> (a -> Last b) -> Last b Source # (>>) :: Last a -> Last b -> Last b Source # return :: a -> Last a Source #
Monad Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Max a -> (a -> Max b) -> Max b Source # (>>) :: Max a -> Max b -> Max b Source # return :: a -> Max a Source #
Monad Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Min a -> (a -> Min b) -> Min b Source # (>>) :: Min a -> Min b -> Min b Source # return :: a -> Min a Source #
Monad Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Dual a -> (a -> Dual b) -> Dual b Source # (>>) :: Dual a -> Dual b -> Dual b Source # return :: a -> Dual a Source #
Monad Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Product a -> (a -> Product b) -> Product b Source # (>>) :: Product a -> Product b -> Product b Source # return :: a -> Product a Source #
Monad Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Sum a -> (a -> Sum b) -> Sum b Source # (>>) :: Sum a -> Sum b -> Sum b Source # return :: a -> Sum a Source #
Monad STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods (>>=) :: STM a -> (a -> STM b) -> STM b Source # (>>) :: STM a -> STM b -> STM b Source # return :: a -> STM a Source #
Monad Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b Source # (>>) :: Par1 a -> Par1 b -> Par1 b Source # return :: a -> Par1 a Source #
Monad P | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: P a -> (a -> P b) -> P b Source # (>>) :: P a -> P b -> P b Source # return :: a -> P a Source #
Monad ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b Source # (>>) :: ReadP a -> ReadP b -> ReadP b Source # return :: a -> ReadP a Source #
Monad ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods (>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b Source # (>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b Source # return :: a -> ReadPrec a Source #
Monad Put |
Instance details Defined in Data.ByteString.Builder.Internal Methods (>>=) :: Put a -> (a -> Put b) -> Put b Source # (>>) :: Put a -> Put b -> Put b Source # return :: a -> Put a Source #
Monad Seq |
Instance details Defined in Data.Sequence.Internal Methods (>>=) :: Seq a -> (a -> Seq b) -> Seq b Source # (>>) :: Seq a -> Seq b -> Seq b Source # return :: a -> Seq a Source #
Monad Tree |
Instance details Defined in Data.Tree Methods (>>=) :: Tree a -> (a -> Tree b) -> Tree b Source # (>>) :: Tree a -> Tree b -> Tree b Source # return :: a -> Tree a Source #
Monad DNonEmpty |
Instance details Defined in Data.DList.DNonEmpty.Internal Methods (>>=) :: DNonEmpty a -> (a -> DNonEmpty b) -> DNonEmpty b Source # (>>) :: DNonEmpty a -> DNonEmpty b -> DNonEmpty b Source # return :: a -> DNonEmpty a Source #
Monad DList |
Instance details Defined in Data.DList.Internal Methods (>>=) :: DList a -> (a -> DList b) -> DList b Source # (>>) :: DList a -> DList b -> DList b Source # return :: a -> DList a Source #
Monad IO | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b Source # (>>) :: IO a -> IO b -> IO b Source # return :: a -> IO a Source #
Monad Root |
Instance details Defined in Numeric.RootFinding Methods (>>=) :: Root a -> (a -> Root b) -> Root b Source # (>>) :: Root a -> Root b -> Root b Source # return :: a -> Root a Source #
Monad Array |
Instance details Defined in Data.Primitive.Array Methods (>>=) :: Array a -> (a -> Array b) -> Array b Source # (>>) :: Array a -> Array b -> Array b Source # return :: a -> Array a Source #
Monad SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods (>>=) :: SmallArray a -> (a -> SmallArray b) -> SmallArray b Source # (>>) :: SmallArray a -> SmallArray b -> SmallArray b Source # return :: a -> SmallArray a Source #
Monad Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods (>>=) :: Q a -> (a -> Q b) -> Q b Source # (>>) :: Q a -> Q b -> Q b Source # return :: a -> Q a Source #
Monad Capability |
Instance details Defined in System.Console.Terminfo.Base Methods (>>=) :: Capability a -> (a -> Capability b) -> Capability b Source # (>>) :: Capability a -> Capability b -> Capability b Source # return :: a -> Capability a Source #
Monad Vector |
Instance details Defined in Data.Vector Methods (>>=) :: Vector a -> (a -> Vector b) -> Vector b Source # (>>) :: Vector a -> Vector b -> Vector b Source # return :: a -> Vector a Source #
Monad NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b Source # (>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source # return :: a -> NonEmpty a Source #
Monad Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b Source # (>>) :: Maybe a -> Maybe b -> Maybe b Source # return :: a -> Maybe a Source #
Monad Solo | Since: base-4.15
Instance details Defined in GHC.Base Methods (>>=) :: Solo a -> (a -> Solo b) -> Solo b Source # (>>) :: Solo a -> Solo b -> Solo b Source # return :: a -> Solo a Source #
Monad [] | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: [a] -> (a -> [b]) -> [b] Source # (>>) :: [a] -> [b] -> [b] Source # return :: a -> [a] Source #
Monad (Parser i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods (>>=) :: Parser i a -> (a -> Parser i b) -> Parser i b Source # (>>) :: Parser i a -> Parser i b -> Parser i b Source # return :: a -> Parser i a Source #
Monad m => Monad (WrappedMonad m) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b Source # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source # return :: a -> WrappedMonad m a Source #
ArrowApply a => Monad (ArrowMonad a) | Since: base-2.1
Instance details Defined in Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b Source # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source # return :: a0 -> ArrowMonad a a0 Source #
Monad (Either e) | Since: base-4.4.0.0
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b Source # (>>) :: Either e a -> Either e b -> Either e b Source # return :: a -> Either e a Source #
Monad (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: U1 a -> (a -> U1 b) -> U1 b Source # (>>) :: U1 a -> U1 b -> U1 b Source # return :: a -> U1 a Source #
Monad (ST s) | Since: base-2.1
Instance details Defined in GHC.ST Methods (>>=) :: ST s a -> (a -> ST s b) -> ST s b Source # (>>) :: ST s a -> ST s b -> ST s b Source # return :: a -> ST s a Source #
Monad (SetM s) |
Instance details Defined in Data.Graph Methods (>>=) :: SetM s a -> (a -> SetM s b) -> SetM s b Source # (>>) :: SetM s a -> SetM s b -> SetM s b Source # return :: a -> SetM s a Source #
Functor f => Monad (Free f) |
Instance details Defined in Control.Monad.Free Methods (>>=) :: Free f a -> (a -> Free f b) -> Free f b Source # (>>) :: Free f a -> Free f b -> Free f b Source # return :: a -> Free f a Source #
Monad m => Monad (InputT m) |
Instance details Defined in System.Console.Haskeline.InputT Methods (>>=) :: InputT m a -> (a -> InputT m b) -> InputT m b Source # (>>) :: InputT m a -> InputT m b -> InputT m b Source # return :: a -> InputT m a Source #
Monad m => Monad (HtmlT m) | Basically acts like Writer.
Instance details Defined in Lucid.Base Methods (>>=) :: HtmlT m a -> (a -> HtmlT m b) -> HtmlT m b Source # (>>) :: HtmlT m a -> HtmlT m b -> HtmlT m b Source # return :: a -> HtmlT m a Source #
Monad f => Monad (WrappedPoly f) |
Instance details Defined in Data.MonoTraversable Methods (>>=) :: WrappedPoly f a -> (a -> WrappedPoly f b) -> WrappedPoly f b Source # (>>) :: WrappedPoly f a -> WrappedPoly f b -> WrappedPoly f b Source # return :: a -> WrappedPoly f a Source #
Monad m => Monad (ResourceT m) |
Instance details Defined in Control.Monad.Trans.Resource.Internal Methods (>>=) :: ResourceT m a -> (a -> ResourceT m b) -> ResourceT m b Source # (>>) :: ResourceT m a -> ResourceT m b -> ResourceT m b Source # return :: a -> ResourceT m a Source #
Semigroup a => Monad (These a) |
Instance details Defined in Data.Strict.These Methods (>>=) :: These a a0 -> (a0 -> These a b) -> These a b Source # (>>) :: These a a0 -> These a b -> These a b Source # return :: a0 -> These a a0 Source #
Monad m => Monad (QuoteToQuasi m) |
Instance details Defined in Language.Haskell.TH.Syntax.Compat Methods (>>=) :: QuoteToQuasi m a -> (a -> QuoteToQuasi m b) -> QuoteToQuasi m b Source # (>>) :: QuoteToQuasi m a -> QuoteToQuasi m b -> QuoteToQuasi m b Source # return :: a -> QuoteToQuasi m a Source #
Semigroup a => Monad (These a) |
Instance details Defined in Data.These Methods (>>=) :: These a a0 -> (a0 -> These a b) -> These a b Source # (>>) :: These a a0 -> These a b -> These a b Source # return :: a0 -> These a a0 Source #
Monad m => Monad (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods (>>=) :: MaybeT m a -> (a -> MaybeT m b) -> MaybeT m b Source # (>>) :: MaybeT m a -> MaybeT m b -> MaybeT m b Source # return :: a -> MaybeT m a Source #
Functor backend => Monad (Wizard backend) |
Instance details Defined in System.Console.Wizard.Internal Methods (>>=) :: Wizard backend a -> (a -> Wizard backend b) -> Wizard backend b Source # (>>) :: Wizard backend a -> Wizard backend b -> Wizard backend b Source # return :: a -> Wizard backend a Source #
Monoid a => Monad ((,) a) | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) Source # (>>) :: (a, a0) -> (a, b) -> (a, b) Source # return :: a0 -> (a, a0) Source #
Monad m => Monad (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in Control.Arrow Methods (>>=) :: Kleisli m a a0 -> (a0 -> Kleisli m a b) -> Kleisli m a b Source # (>>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source # return :: a0 -> Kleisli m a a0 Source #
Monad f => Monad (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b Source # (>>) :: Alt f a -> Alt f b -> Alt f b Source # return :: a -> Alt f a Source #
Monad f => Monad (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b Source # (>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source # return :: a -> Rec1 f a Source #
(Applicative f, Monad f) => Monad (WhenMissing f x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))`. Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods (>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b Source # (>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source # return :: a -> WhenMissing f x a Source #
(Functor f, Monad m) => Monad (FreeT f m) |
Instance details Defined in Control.Monad.Free Methods (>>=) :: FreeT f m a -> (a -> FreeT f m b) -> FreeT f m b Source # (>>) :: FreeT f m a -> FreeT f m b -> FreeT f m b Source # return :: a -> FreeT f m a Source #
Monad m => Monad (StateT s m) |
Instance details Defined in Lens.Micro Methods (>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b Source # (>>) :: StateT s m a -> StateT s m b -> StateT s m b Source # return :: a -> StateT s m a Source #
Monad (Tagged s) |
Instance details Defined in Data.Tagged Methods (>>=) :: Tagged s a -> (a -> Tagged s b) -> Tagged s b Source # (>>) :: Tagged s a -> Tagged s b -> Tagged s b Source # return :: a -> Tagged s a Source #
(Monad m, Error e) => Monad (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods (>>=) :: ErrorT e m a -> (a -> ErrorT e m b) -> ErrorT e m b Source # (>>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b Source # return :: a -> ErrorT e m a Source #
Monad m => Monad (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods (>>=) :: ExceptT e m a -> (a -> ExceptT e m b) -> ExceptT e m b Source # (>>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b Source # return :: a -> ExceptT e m a Source #
Monad m => Monad (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods (>>=) :: ReaderT r m a -> (a -> ReaderT r m b) -> ReaderT r m b Source # (>>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b Source # return :: a -> ReaderT r m a Source #
Monad m => Monad (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods (>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b Source # (>>) :: StateT s m a -> StateT s m b -> StateT s m b Source # return :: a -> StateT s m a Source #
(Monoid a, Monoid b) => Monad ((,,) a b) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods (>>=) :: (a, b, a0) -> (a0 -> (a, b, b0)) -> (a, b, b0) Source # (>>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) Source # return :: a0 -> (a, b, a0) Source #
(Monad f, Monad g) => Monad (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b Source # (>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source # return :: a -> (f :*: g) a Source #
Monad (ConduitT i o m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods (>>=) :: ConduitT i o m a -> (a -> ConduitT i o m b) -> ConduitT i o m b Source # (>>) :: ConduitT i o m a -> ConduitT i o m b -> ConduitT i o m b Source # return :: a -> ConduitT i o m a Source #
(Monad f, Applicative f) => Monad (WhenMatched f x y) | Equivalent to `ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods (>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b Source # (>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source # return :: a -> WhenMatched f x y a Source #
(Applicative f, Monad f) => Monad (WhenMissing f k x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))` . Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods (>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b Source # (>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source # return :: a -> WhenMissing f k x a Source #
Stream s => Monad (ParsecT e s m) | `return` returns a parser that succeeds without consuming input.
Instance details Defined in Text.Megaparsec.Internal Methods (>>=) :: ParsecT e s m a -> (a -> ParsecT e s m b) -> ParsecT e s m b Source # (>>) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m b Source # return :: a -> ParsecT e s m a Source #
(Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods (>>=) :: (a, b, c, a0) -> (a0 -> (a, b, c, b0)) -> (a, b, c, b0) Source # (>>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source # return :: a0 -> (a, b, c, a0) Source #
Monad ((->) r) | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: (r -> a) -> (a -> r -> b) -> r -> b Source # (>>) :: (r -> a) -> (r -> b) -> r -> b Source # return :: a -> r -> a Source #
Monad f => Monad (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b Source # (>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source # return :: a -> M1 i c f a Source #
(Monad f, Applicative f) => Monad (WhenMatched f k x y) | Equivalent to `ReaderT k (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods (>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b Source # (>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source # return :: a -> WhenMatched f k x y a Source #
Monad m => Monad (Pipe l i o u m) |
Instance details Defined in Data.Conduit.Internal.Pipe Methods (>>=) :: Pipe l i o u m a -> (a -> Pipe l i o u m b) -> Pipe l i o u m b Source # (>>) :: Pipe l i o u m a -> Pipe l i o u m b -> Pipe l i o u m b Source # return :: a -> Pipe l i o u m a Source #

class Monad m => MonadFail (m :: Type -> Type) where Source #

When a value is bound in `do`-notation, the pattern on the left hand side of `<-` might not match. In this case, this class provides a function to recover.

A `Monad` without a `MonadFail` instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (`~pat`).

Instances of `MonadFail` should satisfy the following law: `fail s` should be a left zero for `>>=`,

    fail s >>= f  =  fail s

If your `Monad` is also `MonadPlus`, a popular definition is

    fail _ = mzero

Since: base-4.9.0.0

Methods

fail :: String -> m a Source #

#### Instances

Instances details

MonadFail IResult |
Instance details Defined in Data.Aeson.Types.Internal Methods fail :: String -> IResult a Source #
MonadFail Parser |
Instance details Defined in Data.Aeson.Types.Internal Methods fail :: String -> Parser a Source #
MonadFail Result |
Instance details Defined in Data.Aeson.Types.Internal Methods fail :: String -> Result a Source #
MonadFail P | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> P a Source #
MonadFail ReadP | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> ReadP a Source #
MonadFail ReadPrec | Since: base-4.9.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fail :: String -> ReadPrec a Source #
MonadFail DList |
Instance details Defined in Data.DList.Internal Methods fail :: String -> DList a Source #
MonadFail IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> IO a Source #
MonadFail Array |
Instance details Defined in Data.Primitive.Array Methods fail :: String -> Array a Source #
MonadFail SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods fail :: String -> SmallArray a Source #
MonadFail Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods fail :: String -> Q a Source #
MonadFail Vector |
Instance details Defined in Data.Vector Methods fail :: String -> Vector a Source #
MonadFail Maybe | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> Maybe a Source #
MonadFail [] | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> [a] Source #
MonadFail (Parser i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods fail :: String -> Parser i a Source #
MonadFail m => MonadFail (InputT m) |
Instance details Defined in System.Console.Haskeline.InputT Methods fail :: String -> InputT m a Source #
MonadFail m => MonadFail (ResourceT m) |
Instance details Defined in Control.Monad.Trans.Resource.Internal Methods fail :: String -> ResourceT m a Source #
Monad m => MonadFail (QuoteToQuasi m) |
Instance details Defined in Language.Haskell.TH.Syntax.Compat Methods fail :: String -> QuoteToQuasi m a Source #
Monad m => MonadFail (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods fail :: String -> MaybeT m a Source #
MonadFail m => MonadFail (StateT s m) |
Instance details Defined in Lens.Micro Methods fail :: String -> StateT s m a Source #
(Monad m, Error e) => MonadFail (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods fail :: String -> ErrorT e m a Source #
MonadFail m => MonadFail (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods fail :: String -> ExceptT e m a Source #
MonadFail m => MonadFail (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods fail :: String -> ReaderT r m a Source #
MonadFail m => MonadFail (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods fail :: String -> StateT s m a Source #
MonadFail m => MonadFail (ConduitT i o m) |
Instance details Defined in Data.Conduit.Internal.Conduit Methods fail :: String -> ConduitT i o m a Source #
Stream s => MonadFail (ParsecT e s m) |
Instance details Defined in Text.Megaparsec.Internal Methods fail :: String -> ParsecT e s m a Source #

data Handle Source #

Haskell defines operations to read and write characters from and to files, represented by values of type `Handle`. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:

- whether it manages input or output or both;
- whether it is open, closed or semi-closed;
- whether the object is seekable;
- whether buffering is disabled, or enabled on a line or block basis;
- a buffer (whose length may be zero).

Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the `Show` and `Eq` classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to `==` only to itself; no attempt is made to compare the internal state of different handles for equality.

#### Instances

Instances details

Show Handle | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Handle -> ShowS Source # show :: Handle -> String Source # showList :: [Handle] -> ShowS Source #
Eq Handle | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Handle -> Handle -> Bool Source # (/=) :: Handle -> Handle -> Bool Source #

class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where Source #

Monads that also support choice and failure.

Minimal complete definition

Nothing

Methods

mzero :: m a Source #

The identity of `mplus`. It should also satisfy the equations

    mzero >>= f  =  mzero
    v >> mzero   =  mzero

The default definition is

    mzero = empty

mplus :: m a -> m a -> m a Source #

An associative operation. The default definition is

    mplus = (<|>)

#### Instances

Instances details

MonadPlus IResult |
Instance details Defined in Data.Aeson.Types.Internal Methods mzero :: IResult a Source # mplus :: IResult a -> IResult a -> IResult a Source #
MonadPlus Parser |
Instance details Defined in Data.Aeson.Types.Internal Methods mzero :: Parser a Source # mplus :: Parser a -> Parser a -> Parser a Source #
MonadPlus Result |
Instance details Defined in Data.Aeson.Types.Internal Methods mzero :: Result a Source # mplus :: Result a -> Result a -> Result a Source #
MonadPlus STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods mzero :: STM a Source # mplus :: STM a -> STM a -> STM a Source #
MonadPlus P | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: P a Source # mplus :: P a -> P a -> P a Source #
MonadPlus ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: ReadP a Source # mplus :: ReadP a -> ReadP a -> ReadP a Source #
MonadPlus ReadPrec | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods mzero :: ReadPrec a Source # mplus :: ReadPrec a -> ReadPrec a -> ReadPrec a Source #
MonadPlus Seq |
Instance details Defined in Data.Sequence.Internal Methods mzero :: Seq a Source # mplus :: Seq a -> Seq a -> Seq a Source #
MonadPlus DList |
Instance details Defined in Data.DList.Internal Methods mzero :: DList a Source # mplus :: DList a -> DList a -> DList a Source #
MonadPlus IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mzero :: IO a Source # mplus :: IO a -> IO a -> IO a Source #
MonadPlus Root |
Instance details Defined in Numeric.RootFinding Methods mzero :: Root a Source # mplus :: Root a -> Root a -> Root a Source #
MonadPlus Array |
Instance details Defined in Data.Primitive.Array Methods mzero :: Array a Source # mplus :: Array a -> Array a -> Array a Source #
MonadPlus SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods mzero :: SmallArray a Source # mplus :: SmallArray a -> SmallArray a -> SmallArray a Source #
MonadPlus Capability |
Instance details Defined in System.Console.Terminfo.Base Methods mzero :: Capability a Source # mplus :: Capability a -> Capability a -> Capability a Source #
MonadPlus Vector |
Instance details Defined in Data.Vector Methods mzero :: Vector a Source # mplus :: Vector a -> Vector a -> Vector a Source #
MonadPlus Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: Maybe a Source # mplus :: Maybe a -> Maybe a -> Maybe a Source #
MonadPlus [] | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: [a] Source # mplus :: [a] -> [a] -> [a] Source #
MonadPlus (Parser i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods mzero :: Parser i a Source # mplus :: Parser i a -> Parser i a -> Parser i a Source #
(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods mzero :: ArrowMonad a a0 Source # mplus :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 Source #
MonadPlus (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: U1 a Source # mplus :: U1 a -> U1 a -> U1 a Source #
MonadPlus m => MonadPlus (ResourceT m) |
Instance details Defined in Control.Monad.Trans.Resource.Internal Methods mzero :: ResourceT m a Source # mplus :: ResourceT m a -> ResourceT m a -> ResourceT m a Source #
Monad m => MonadPlus (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods mzero :: MaybeT m a Source # mplus :: MaybeT m a -> MaybeT m a -> MaybeT m a Source #
Functor backend => MonadPlus (Wizard backend) |
Instance details Defined in System.Console.Wizard.Internal Methods mzero :: Wizard backend a Source # mplus :: Wizard backend a -> Wizard backend a -> Wizard backend a Source #
MonadPlus m => MonadPlus (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in Control.Arrow Methods mzero :: Kleisli m a a0 Source # mplus :: Kleisli m a a0 -> Kleisli m a a0 -> Kleisli m a a0 Source #
MonadPlus f => MonadPlus (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods mzero :: Alt f a Source # mplus :: Alt f a -> Alt f a -> Alt f a Source #
MonadPlus f => MonadPlus (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: Rec1 f a Source # mplus :: Rec1 f a -> Rec1 f a -> Rec1 f a Source #
(Functor f, Monad m, MonadPlus m) => MonadPlus (FreeT f m) |
Instance details Defined in Control.Monad.Free Methods mzero :: FreeT f m a Source # mplus :: FreeT f m a -> FreeT f m a -> FreeT f m a Source #
(Monad m, Error e) => MonadPlus (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods mzero :: ErrorT e m a Source # mplus :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a Source #
(Monad m, Monoid e) => MonadPlus (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods mzero :: ExceptT e m a Source # mplus :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #
MonadPlus m => MonadPlus (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods mzero :: ReaderT r m a Source # mplus :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a Source #
MonadPlus m => MonadPlus (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods mzero :: StateT s m a Source # mplus :: StateT s m a -> StateT s m a -> StateT s m a Source #
(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: (f :*: g) a Source # mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a Source #

(Ord e, Stream s) => MonadPlus (ParsecT e s m)

`mzero` is a parser that fails without consuming input.

Note: strictly speaking, this instance is unlawful. The right identity law does not hold, e.g. in general this is not true:

    v >> mzero = mero

However the following holds:

    try v >> mzero = mzero

Instance details Defined in Text.Megaparsec.Internal Methods mzero :: ParsecT e s m a Source # mplus :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a Source #
MonadPlus f => MonadPlus (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: M1 i c f a Source # mplus :: M1 i c f a -> M1 i c f a -> M1 i c f a Source #

data MVar a Source #

An `MVar` (pronounced "em-var") is a synchronising variable, used for communication between concurrent threads. It can be thought of as a box, which may be empty or full.

#### Instances

Instances details

NFData1 MVar | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> MVar a -> () Source #
NFData (MVar a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0
Instance details Defined in Control.DeepSeq Methods rnf :: MVar a -> () Source #
Eq (MVar a) | Since: base-4.1.0.0
Instance details Defined in GHC.MVar Methods (==) :: MVar a -> MVar a -> Bool Source # (/=) :: MVar a -> MVar a -> Bool Source #

data TextEncoding Source #

A `TextEncoding` is a specification of a conversion scheme between sequences of bytes and sequences of Unicode characters.

For example, UTF-8 is an encoding of Unicode characters into a sequence of bytes. The `TextEncoding` for UTF-8 is `utf8`.

#### Instances

Instances details

Show TextEncoding | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Encoding.Types Methods showsPrec :: Int -> TextEncoding -> ShowS Source # show :: TextEncoding -> String Source # showList :: [TextEncoding] -> ShowS Source #

type IOError = IOException Source #

The Haskell 2010 type for exceptions in the `IO` monad. Any I/O operation may raise an `IOException` instead of returning a result. For a more general type of exception, including also those that arise in pure code, see `Exception`.

In Haskell 2010, this is an opaque type.

data Chan a Source #

`Chan` is an abstract type representing an unbounded FIFO channel.

#### Instances

Instances details

Eq (Chan a) | Since: base-4.4.0.0
Instance details Defined in Control.Concurrent.Chan Methods (==) :: Chan a -> Chan a -> Bool Source # (/=) :: Chan a -> Chan a -> Bool Source #

type HasCallStack = ?callStack :: CallStack Source #

Request a CallStack.

NOTE: The implicit parameter `?callStack :: CallStack` is an implementation detail and should not be considered part of the `CallStack` API, we may decide to change the implementation in the future.

Since: base-4.9.0.0

class Applicative f => Alternative (f :: Type -> Type) where Source #

A monoid on applicative functors.

If defined, `some` and `many` should be the least solutions of the equations:

-     some v = (:) <$> v <*> many v

-     many v = some v <|> pure []

Minimal complete definition

empty, (<|>)

Methods

empty :: f a Source #

The identity of `<|>`

(<|>) :: f a -> f a -> f a infixl 3 Source #

An associative binary operation

some :: f a -> f [a] Source #

One or more.

many :: f a -> f [a] Source #

Zero or more.

#### Instances

Instances details

Alternative IResult |
Instance details Defined in Data.Aeson.Types.Internal Methods empty :: IResult a Source # (<|>) :: IResult a -> IResult a -> IResult a Source # some :: IResult a -> IResult [a] Source # many :: IResult a -> IResult [a] Source #
Alternative Parser |
Instance details Defined in Data.Aeson.Types.Internal Methods empty :: Parser a Source # (<|>) :: Parser a -> Parser a -> Parser a Source # some :: Parser a -> Parser [a] Source # many :: Parser a -> Parser [a] Source #
Alternative Result |
Instance details Defined in Data.Aeson.Types.Internal Methods empty :: Result a Source # (<|>) :: Result a -> Result a -> Result a Source # some :: Result a -> Result [a] Source # many :: Result a -> Result [a] Source #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in Control.Applicative Methods empty :: ZipList a Source # (<|>) :: ZipList a -> ZipList a -> ZipList a Source # some :: ZipList a -> ZipList [a] Source # many :: ZipList a -> ZipList [a] Source #
Alternative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods empty :: STM a Source # (<|>) :: STM a -> STM a -> STM a Source # some :: STM a -> STM [a] Source # many :: STM a -> STM [a] Source #
Alternative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: P a Source # (<|>) :: P a -> P a -> P a Source # some :: P a -> P [a] Source # many :: P a -> P [a] Source #
Alternative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: ReadP a Source # (<|>) :: ReadP a -> ReadP a -> ReadP a Source # some :: ReadP a -> ReadP [a] Source # many :: ReadP a -> ReadP [a] Source #
Alternative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods empty :: ReadPrec a Source # (<|>) :: ReadPrec a -> ReadPrec a -> ReadPrec a Source # some :: ReadPrec a -> ReadPrec [a] Source # many :: ReadPrec a -> ReadPrec [a] Source #
Alternative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods empty :: Seq a Source # (<|>) :: Seq a -> Seq a -> Seq a Source # some :: Seq a -> Seq [a] Source # many :: Seq a -> Seq [a] Source #
Alternative DList |
Instance details Defined in Data.DList.Internal Methods empty :: DList a Source # (<|>) :: DList a -> DList a -> DList a Source # some :: DList a -> DList [a] Source # many :: DList a -> DList [a] Source #
Alternative IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods empty :: IO a Source # (<|>) :: IO a -> IO a -> IO a Source # some :: IO a -> IO [a] Source # many :: IO a -> IO [a] Source #
Alternative Root |
Instance details Defined in Numeric.RootFinding Methods empty :: Root a Source # (<|>) :: Root a -> Root a -> Root a Source # some :: Root a -> Root [a] Source # many :: Root a -> Root [a] Source #
Alternative Array |
Instance details Defined in Data.Primitive.Array Methods empty :: Array a Source # (<|>) :: Array a -> Array a -> Array a Source # some :: Array a -> Array [a] Source # many :: Array a -> Array [a] Source #
Alternative SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods empty :: SmallArray a Source # (<|>) :: SmallArray a -> SmallArray a -> SmallArray a Source # some :: SmallArray a -> SmallArray [a] Source # many :: SmallArray a -> SmallArray [a] Source #
Alternative Capability |
Instance details Defined in System.Console.Terminfo.Base Methods empty :: Capability a Source # (<|>) :: Capability a -> Capability a -> Capability a Source # some :: Capability a -> Capability [a] Source # many :: Capability a -> Capability [a] Source #
Alternative Vector |
Instance details Defined in Data.Vector Methods empty :: Vector a Source # (<|>) :: Vector a -> Vector a -> Vector a Source # some :: Vector a -> Vector [a] Source # many :: Vector a -> Vector [a] Source #
Alternative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: Maybe a Source # (<|>) :: Maybe a -> Maybe a -> Maybe a Source # some :: Maybe a -> Maybe [a] Source # many :: Maybe a -> Maybe [a] Source #
Alternative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: [a] Source # (<|>) :: [a] -> [a] -> [a] Source # some :: [a] -> [[a]] Source # many :: [a] -> [[a]] Source #
Alternative (Parser i) |
Instance details Defined in Data.Attoparsec.Internal.Types Methods empty :: Parser i a Source # (<|>) :: Parser i a -> Parser i a -> Parser i a Source # some :: Parser i a -> Parser i [a] Source # many :: Parser i a -> Parser i [a] Source #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a Source # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a Source # some :: WrappedMonad m a -> WrappedMonad m [a] Source # many :: WrappedMonad m a -> WrappedMonad m [a] Source #
ArrowPlus a => Alternative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods empty :: ArrowMonad a a0 Source # (<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 Source # some :: ArrowMonad a a0 -> ArrowMonad a [a0] Source # many :: ArrowMonad a a0 -> ArrowMonad a [a0] Source #
Alternative (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: U1 a Source # (<|>) :: U1 a -> U1 a -> U1 a Source # some :: U1 a -> U1 [a] Source # many :: U1 a -> U1 [a] Source #
Alternative m => Alternative (ResourceT m) |
Instance details Defined in Control.Monad.Trans.Resource.Internal Methods empty :: ResourceT m a Source # (<|>) :: ResourceT m a -> ResourceT m a -> ResourceT m a Source # some :: ResourceT m a -> ResourceT m [a] Source # many :: ResourceT m a -> ResourceT m [a] Source #
(Functor m, Monad m) => Alternative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods empty :: MaybeT m a Source # (<|>) :: MaybeT m a -> MaybeT m a -> MaybeT m a Source # some :: MaybeT m a -> MaybeT m [a] Source # many :: MaybeT m a -> MaybeT m [a] Source #
Functor backend => Alternative (Wizard backend) |
Instance details Defined in System.Console.Wizard.Internal Methods empty :: Wizard backend a Source # (<|>) :: Wizard backend a -> Wizard backend a -> Wizard backend a Source # some :: Wizard backend a -> Wizard backend [a] Source # many :: Wizard backend a -> Wizard backend [a] Source #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 Source # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 Source # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source #
Alternative m => Alternative (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in Control.Arrow Methods empty :: Kleisli m a a0 Source # (<|>) :: Kleisli m a a0 -> Kleisli m a a0 -> Kleisli m a a0 Source # some :: Kleisli m a a0 -> Kleisli m a [a0] Source # many :: Kleisli m a a0 -> Kleisli m a [a0] Source #
Alternative f => Alternative (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods empty :: Alt f a Source # (<|>) :: Alt f a -> Alt f a -> Alt f a Source # some :: Alt f a -> Alt f [a] Source # many :: Alt f a -> Alt f [a] Source #
(Generic1 f, Alternative (Rep1 f)) => Alternative (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in GHC.Generics Methods empty :: Generically1 f a Source # (<|>) :: Generically1 f a -> Generically1 f a -> Generically1 f a Source # some :: Generically1 f a -> Generically1 f [a] Source # many :: Generically1 f a -> Generically1 f [a] Source #
Alternative f => Alternative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: Rec1 f a Source # (<|>) :: Rec1 f a -> Rec1 f a -> Rec1 f a Source # some :: Rec1 f a -> Rec1 f [a] Source # many :: Rec1 f a -> Rec1 f [a] Source #
(Functor f, Functor m, Monad m, MonadPlus m) => Alternative (FreeT f m) |
Instance details Defined in Control.Monad.Free Methods empty :: FreeT f m a Source # (<|>) :: FreeT f m a -> FreeT f m a -> FreeT f m a Source # some :: FreeT f m a -> FreeT f m [a] Source # many :: FreeT f m a -> FreeT f m [a] Source #
(Functor m, Monad m, Error e) => Alternative (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods empty :: ErrorT e m a Source # (<|>) :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a Source # some :: ErrorT e m a -> ErrorT e m [a] Source # many :: ErrorT e m a -> ErrorT e m [a] Source #
(Functor m, Monad m, Monoid e) => Alternative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods empty :: ExceptT e m a Source # (<|>) :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source # some :: ExceptT e m a -> ExceptT e m [a] Source # many :: ExceptT e m a -> ExceptT e m [a] Source #
Alternative m => Alternative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods empty :: ReaderT r m a Source # (<|>) :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a Source # some :: ReaderT r m a -> ReaderT r m [a] Source # many :: ReaderT r m a -> ReaderT r m [a] Source #
(Functor m, MonadPlus m) => Alternative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods empty :: StateT s m a Source # (<|>) :: StateT s m a -> StateT s m a -> StateT s m a Source # some :: StateT s m a -> StateT s m [a] Source # many :: StateT s m a -> StateT s m [a] Source #
(Alternative f, Alternative g) => Alternative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: (f :*: g) a Source # (<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a Source # some :: (f :*: g) a -> (f :*: g) [a] Source # many :: (f :*: g) a -> (f :*: g) [a] Source #
(Ord e, Stream s) => Alternative (ParsecT e s m) | `empty` is a parser that fails without consuming input.
Instance details Defined in Text.Megaparsec.Internal Methods empty :: ParsecT e s m a Source # (<|>) :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a Source # some :: ParsecT e s m a -> ParsecT e s m [a] Source # many :: ParsecT e s m a -> ParsecT e s m [a] Source #
(Alternative f, Applicative g) => Alternative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods empty :: Compose f g a Source # (<|>) :: Compose f g a -> Compose f g a -> Compose f g a Source # some :: Compose f g a -> Compose f g [a] Source # many :: Compose f g a -> Compose f g [a] Source #
(Alternative f, Applicative g) => Alternative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: (f :.: g) a Source # (<|>) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a Source # some :: (f :.: g) a -> (f :.: g) [a] Source # many :: (f :.: g) a -> (f :.: g) [a] Source #
Alternative f => Alternative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: M1 i c f a Source # (<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a Source # some :: M1 i c f a -> M1 i c f [a] Source # many :: M1 i c f a -> M1 i c f [a] Source #

data GeneralCategory Source #

Unicode General Categories (column 2 of the UnicodeData table) in the order they are listed in the Unicode standard (the Unicode Character Database, in particular).

#### Examples

Expand

Basic usage:

    >>> :t OtherLetter
    OtherLetter :: GeneralCategory

`Eq` instance:

    >>> UppercaseLetter == UppercaseLetter
    True
    >>> UppercaseLetter == LowercaseLetter
    False

`Ord` instance:

    >>> NonSpacingMark <= MathSymbol
    True

`Enum` instance:

    >>> enumFromTo ModifierLetter SpacingCombiningMark
    [ModifierLetter,OtherLetter,NonSpacingMark,SpacingCombiningMark]

`Read` instance:

    >>> read "DashPunctuation" :: GeneralCategory
    DashPunctuation
    >>> read "17" :: GeneralCategory
    *** Exception: Prelude.read: no parse

`Show` instance:

    >>> show EnclosingMark
    "EnclosingMark"

`Bounded` instance:

    >>> minBound :: GeneralCategory
    UppercaseLetter
    >>> maxBound :: GeneralCategory
    NotAssigned

`Ix` instance:

    >>> import Data.Ix ( index )
    >>> index (OtherLetter,Control) FinalQuote
    12
    >>> index (OtherLetter,Control) Format
    *** Exception: Error in array index

Constructors

UppercaseLetter | Lu: Letter, Uppercase
LowercaseLetter | Ll: Letter, Lowercase
TitlecaseLetter | Lt: Letter, Titlecase
ModifierLetter | Lm: Letter, Modifier
OtherLetter | Lo: Letter, Other
NonSpacingMark | Mn: Mark, Non-Spacing
SpacingCombiningMark | Mc: Mark, Spacing Combining
EnclosingMark | Me: Mark, Enclosing
DecimalNumber | Nd: Number, Decimal
LetterNumber | Nl: Number, Letter
OtherNumber | No: Number, Other
ConnectorPunctuation | Pc: Punctuation, Connector
DashPunctuation | Pd: Punctuation, Dash
OpenPunctuation | Ps: Punctuation, Open
ClosePunctuation | Pe: Punctuation, Close
InitialQuote | Pi: Punctuation, Initial quote
FinalQuote | Pf: Punctuation, Final quote
OtherPunctuation | Po: Punctuation, Other
MathSymbol | Sm: Symbol, Math
CurrencySymbol | Sc: Symbol, Currency
ModifierSymbol | Sk: Symbol, Modifier
OtherSymbol | So: Symbol, Other
Space | Zs: Separator, Space
LineSeparator | Zl: Separator, Line
ParagraphSeparator | Zp: Separator, Paragraph
Control | Cc: Other, Control
Format | Cf: Other, Format
Surrogate | Cs: Other, Surrogate
PrivateUse | Co: Other, Private Use
NotAssigned | Cn: Other, Not Assigned

#### Instances

Instances details

Bounded GeneralCategory | Since: base-2.1
Instance details Defined in GHC.Unicode Methods minBound :: GeneralCategory Source # maxBound :: GeneralCategory Source #
Enum GeneralCategory | Since: base-2.1

Instance details

Defined in GHC.Unicode

Methods

succ :: GeneralCategory -> GeneralCategory Source #

pred :: GeneralCategory -> GeneralCategory Source #

toEnum :: Int -> GeneralCategory Source #

fromEnum :: GeneralCategory -> Int Source #

enumFrom :: GeneralCategory -> [GeneralCategory] Source #

enumFromThen :: GeneralCategory -> GeneralCategory -> [GeneralCategory] Source #

enumFromTo :: GeneralCategory -> GeneralCategory -> [GeneralCategory] Source #

enumFromThenTo :: GeneralCategory -> GeneralCategory -> GeneralCategory -> [GeneralCategory] Source #

Generic GeneralCategory |
Instance details Defined in GHC.Generics Associated Types type Rep GeneralCategory :: Type -> Type Source # Methods from :: GeneralCategory -> Rep GeneralCategory x Source # to :: Rep GeneralCategory x -> GeneralCategory Source #
Ix GeneralCategory | Since: base-2.1

Instance details

Defined in GHC.Unicode

Methods

range :: (GeneralCategory, GeneralCategory) -> [GeneralCategory] Source #

index :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int Source #

unsafeIndex :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Int Source #

inRange :: (GeneralCategory, GeneralCategory) -> GeneralCategory -> Bool Source #

rangeSize :: (GeneralCategory, GeneralCategory) -> Int Source #

unsafeRangeSize :: (GeneralCategory, GeneralCategory) -> Int Source #

Read GeneralCategory | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS GeneralCategory Source # readList :: ReadS [GeneralCategory] Source # readPrec :: ReadPrec GeneralCategory Source # readListPrec :: ReadPrec [GeneralCategory] Source #
Show GeneralCategory | Since: base-2.1
Instance details Defined in GHC.Unicode Methods showsPrec :: Int -> GeneralCategory -> ShowS Source # show :: GeneralCategory -> String Source # showList :: [GeneralCategory] -> ShowS Source #
Eq GeneralCategory | Since: base-2.1
Instance details Defined in GHC.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool Source # (/=) :: GeneralCategory -> GeneralCategory -> Bool Source #
Ord GeneralCategory | Since: base-2.1

Instance details

Defined in GHC.Unicode

Methods

compare :: GeneralCategory -> GeneralCategory -> Ordering Source #

(<) :: GeneralCategory -> GeneralCategory -> Bool Source #

(<=) :: GeneralCategory -> GeneralCategory -> Bool Source #

(>) :: GeneralCategory -> GeneralCategory -> Bool Source #

(>=) :: GeneralCategory -> GeneralCategory -> Bool Source #

max :: GeneralCategory -> GeneralCategory -> GeneralCategory Source #

min :: GeneralCategory -> GeneralCategory -> GeneralCategory Source #

type Rep GeneralCategory | Since: base-4.15.0.0

Instance details

Defined in GHC.Generics

type Rep GeneralCategory = D1 ('MetaData "GeneralCategory" "GHC.Unicode" "base" 'False) ((((C1 ('MetaCons "UppercaseLetter" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LowercaseLetter" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TitlecaseLetter" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ModifierLetter" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OtherLetter" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "NonSpacingMark" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SpacingCombiningMark" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "EnclosingMark" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DecimalNumber" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LetterNumber" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OtherNumber" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ConnectorPunctuation" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DashPunctuation" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "OpenPunctuation" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ClosePunctuation" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "InitialQuote" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FinalQuote" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OtherPunctuation" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MathSymbol" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CurrencySymbol" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ModifierSymbol" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OtherSymbol" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Space" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LineSeparator" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ParagraphSeparator" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Control" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Format" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Surrogate" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PrivateUse" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotAssigned" 'PrefixI 'False) (U1 :: Type -> Type))))))

data ThreadId Source #

A `ThreadId` is an abstract type representing a handle to a thread. `ThreadId` is an instance of `Eq`, `Ord` and `Show`, where the `Ord` instance implements an arbitrary total ordering over `ThreadId`s. The `Show` instance lets you convert an arbitrary-valued `ThreadId` to string form; showing a `ThreadId` value is occasionally useful when debugging or diagnosing the behaviour of a concurrent program.

Note: in GHC, if you have a `ThreadId`, you essentially have a pointer to the thread itself. This means the thread itself can't be garbage collected until you drop the `ThreadId`. This misfeature will hopefully be corrected at a later date.

#### Instances

Instances details

Show ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadId -> ShowS Source # show :: ThreadId -> String Source # showList :: [ThreadId] -> ShowS Source #
NFData ThreadId | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: ThreadId -> () Source #
Eq ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadId -> ThreadId -> Bool Source # (/=) :: ThreadId -> ThreadId -> Bool Source #
Ord ThreadId | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadId -> ThreadId -> Ordering Source # (<) :: ThreadId -> ThreadId -> Bool Source # (<=) :: ThreadId -> ThreadId -> Bool Source # (>) :: ThreadId -> ThreadId -> Bool Source # (>=) :: ThreadId -> ThreadId -> Bool Source # max :: ThreadId -> ThreadId -> ThreadId Source # min :: ThreadId -> ThreadId -> ThreadId Source #
Hashable ThreadId |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> ThreadId -> Int Source # hash :: ThreadId -> Int Source #

newtype Down a Source #

The `Down` type allows you to reverse sort order conveniently. A value of type ``Down` a` contains a value of type `a` (represented as ``Down` a`).

If `a` has an ``Ord`` instance associated with it then comparing two values thus wrapped will give you the opposite of their normal sort order. This is particularly useful when sorting in generalised list comprehensions, as in: `then sortWith by `Down` x`.

    >>> compare True False
    GT

    >>> compare (Down True) (Down False)
    LT

If `a` has a ``Bounded`` instance then the wrapped instance also respects the reversed ordering by exchanging the values of ``minBound`` and ``maxBound``.

    >>> minBound :: Int
    -9223372036854775808

    >>> minBound :: Down Int
    Down 9223372036854775807

All other instances of ``Down` a` behave as they do for `a`.

Since: base-4.6.0.0

Constructors

Down |

Fields

- getDown :: a

  Since: base-4.14.0.0

#### Instances

Instances details

Foldable Down | Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Down m -> m Source #

foldMap :: Monoid m => (a -> m) -> Down a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Down a -> m Source #

foldr :: (a -> b -> b) -> b -> Down a -> b Source #

foldr' :: (a -> b -> b) -> b -> Down a -> b Source #

foldl :: (b -> a -> b) -> b -> Down a -> b Source #

foldl' :: (b -> a -> b) -> b -> Down a -> b Source #

foldr1 :: (a -> a -> a) -> Down a -> a Source #

foldl1 :: (a -> a -> a) -> Down a -> a Source #

toList :: Down a -> [a] Source #

null :: Down a -> Bool Source #

length :: Down a -> Int Source #

elem :: Eq a => a -> Down a -> Bool Source #

maximum :: Ord a => Down a -> a Source #

minimum :: Ord a => Down a -> a Source #

sum :: Num a => Down a -> a Source #

product :: Num a => Down a -> a Source #

Eq1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Down a -> Down b -> Bool Source #
Ord1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Down a -> Down b -> Ordering Source #
Read1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Down a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Down a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Down a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Down a] Source #
Show1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Down a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Down a] -> ShowS Source #
Traversable Down | Since: base-4.12.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Down a -> f (Down b) Source # sequenceA :: Applicative f => Down (f a) -> f (Down a) Source # mapM :: Monad m => (a -> m b) -> Down a -> m (Down b) Source # sequence :: Monad m => Down (m a) -> m (Down a) Source #
Applicative Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods pure :: a -> Down a Source # (<*>) :: Down (a -> b) -> Down a -> Down b Source # liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source # (*>) :: Down a -> Down b -> Down b Source # (<*) :: Down a -> Down b -> Down a Source #
Functor Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods fmap :: (a -> b) -> Down a -> Down b Source # (<$) :: a -> Down b -> Down a Source #
Monad Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (>>=) :: Down a -> (a -> Down b) -> Down b Source # (>>) :: Down a -> Down b -> Down b Source # return :: a -> Down a Source #
NFData1 Down | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> Down a -> () Source #
Generic1 Down |
Instance details Defined in GHC.Generics Associated Types type Rep1 Down :: k -> Type Source # Methods from1 :: forall (a :: k). Down a -> Rep1 Down a Source # to1 :: forall (a :: k). Rep1 Down a -> Down a Source #
Unbox a => Vector Vector (Down a) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: Mutable Vector s (Down a) -> ST s (Vector (Down a))

basicUnsafeThaw :: Vector (Down a) -> ST s (Mutable Vector s (Down a))

basicLength :: Vector (Down a) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (Down a) -> Vector (Down a)

basicUnsafeIndexM :: Vector (Down a) -> Int -> Box (Down a)

basicUnsafeCopy :: Mutable Vector s (Down a) -> Vector (Down a) -> ST s ()

elemseq :: Vector (Down a) -> Down a -> b -> b

Unbox a => MVector MVector (Down a) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (Down a) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (Down a) -> MVector s (Down a)

basicOverlaps :: MVector s (Down a) -> MVector s (Down a) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (Down a))

basicInitialize :: MVector s (Down a) -> ST s ()

basicUnsafeReplicate :: Int -> Down a -> ST s (MVector s (Down a))

basicUnsafeRead :: MVector s (Down a) -> Int -> ST s (Down a)

basicUnsafeWrite :: MVector s (Down a) -> Int -> Down a -> ST s ()

basicClear :: MVector s (Down a) -> ST s ()

basicSet :: MVector s (Down a) -> Down a -> ST s ()

basicUnsafeCopy :: MVector s (Down a) -> MVector s (Down a) -> ST s ()

basicUnsafeMove :: MVector s (Down a) -> MVector s (Down a) -> ST s ()

basicUnsafeGrow :: MVector s (Down a) -> Int -> ST s (MVector s (Down a))

Data a => Data (Down a) | Since: base-4.12.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Down a -> c (Down a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Down a) Source #

toConstr :: Down a -> Constr Source #

dataTypeOf :: Down a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Down a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Down a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Down a -> Down a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Down a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Down a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Down a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Down a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) Source #

Storable a => Storable (Down a) | Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Methods

sizeOf :: Down a -> Int Source #

alignment :: Down a -> Int Source #

peekElemOff :: Ptr (Down a) -> Int -> IO (Down a) Source #

pokeElemOff :: Ptr (Down a) -> Int -> Down a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Down a) Source #

pokeByteOff :: Ptr b -> Int -> Down a -> IO () Source #

peek :: Ptr (Down a) -> IO (Down a) Source #

poke :: Ptr (Down a) -> Down a -> IO () Source #

Monoid a => Monoid (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods mempty :: Down a Source # mappend :: Down a -> Down a -> Down a Source # mconcat :: [Down a] -> Down a Source #
Semigroup a => Semigroup (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (<>) :: Down a -> Down a -> Down a Source # sconcat :: NonEmpty (Down a) -> Down a Source # stimes :: Integral b => b -> Down a -> Down a Source #
Bits a => Bits (Down a) | Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Methods

(.&.) :: Down a -> Down a -> Down a Source #

(.|.) :: Down a -> Down a -> Down a Source #

xor :: Down a -> Down a -> Down a Source #

complement :: Down a -> Down a Source #

shift :: Down a -> Int -> Down a Source #

rotate :: Down a -> Int -> Down a Source #

zeroBits :: Down a Source #

bit :: Int -> Down a Source #

setBit :: Down a -> Int -> Down a Source #

clearBit :: Down a -> Int -> Down a Source #

complementBit :: Down a -> Int -> Down a Source #

testBit :: Down a -> Int -> Bool Source #

bitSizeMaybe :: Down a -> Maybe Int Source #

bitSize :: Down a -> Int Source #

isSigned :: Down a -> Bool Source #

shiftL :: Down a -> Int -> Down a Source #

unsafeShiftL :: Down a -> Int -> Down a Source #

shiftR :: Down a -> Int -> Down a Source #

unsafeShiftR :: Down a -> Int -> Down a Source #

rotateL :: Down a -> Int -> Down a Source #

rotateR :: Down a -> Int -> Down a Source #

popCount :: Down a -> Int Source #

FiniteBits a => FiniteBits (Down a) | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods finiteBitSize :: Down a -> Int Source # countLeadingZeros :: Down a -> Int Source # countTrailingZeros :: Down a -> Int Source #
Bounded a => Bounded (Down a) | Swaps ``minBound`` and ``maxBound`` of the underlying type. Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods minBound :: Down a Source # maxBound :: Down a Source #
Floating a => Floating (Down a) | Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Methods

pi :: Down a Source #

exp :: Down a -> Down a Source #

log :: Down a -> Down a Source #

sqrt :: Down a -> Down a Source #

(**) :: Down a -> Down a -> Down a Source #

logBase :: Down a -> Down a -> Down a Source #

sin :: Down a -> Down a Source #

cos :: Down a -> Down a Source #

tan :: Down a -> Down a Source #

asin :: Down a -> Down a Source #

acos :: Down a -> Down a Source #

atan :: Down a -> Down a Source #

sinh :: Down a -> Down a Source #

cosh :: Down a -> Down a Source #

tanh :: Down a -> Down a Source #

asinh :: Down a -> Down a Source #

acosh :: Down a -> Down a Source #

atanh :: Down a -> Down a Source #

log1p :: Down a -> Down a Source #

expm1 :: Down a -> Down a Source #

log1pexp :: Down a -> Down a Source #

log1mexp :: Down a -> Down a Source #

RealFloat a => RealFloat (Down a) | Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Methods

floatRadix :: Down a -> Integer Source #

floatDigits :: Down a -> Int Source #

floatRange :: Down a -> (Int, Int) Source #

decodeFloat :: Down a -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Down a Source #

exponent :: Down a -> Int Source #

significand :: Down a -> Down a Source #

scaleFloat :: Int -> Down a -> Down a Source #

isNaN :: Down a -> Bool Source #

isInfinite :: Down a -> Bool Source #

isDenormalized :: Down a -> Bool Source #

isNegativeZero :: Down a -> Bool Source #

isIEEE :: Down a -> Bool Source #

atan2 :: Down a -> Down a -> Down a Source #

Generic (Down a) |
Instance details Defined in GHC.Generics Associated Types type Rep (Down a) :: Type -> Type Source # Methods from :: Down a -> Rep (Down a) x Source # to :: Rep (Down a) x -> Down a Source #
Ix a => Ix (Down a) | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods range :: (Down a, Down a) -> [Down a] Source # index :: (Down a, Down a) -> Down a -> Int Source # unsafeIndex :: (Down a, Down a) -> Down a -> Int Source # inRange :: (Down a, Down a) -> Down a -> Bool Source # rangeSize :: (Down a, Down a) -> Int Source # unsafeRangeSize :: (Down a, Down a) -> Int Source #
Num a => Num (Down a) | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (+) :: Down a -> Down a -> Down a Source # (-) :: Down a -> Down a -> Down a Source # (*) :: Down a -> Down a -> Down a Source # negate :: Down a -> Down a Source # abs :: Down a -> Down a Source # signum :: Down a -> Down a Source # fromInteger :: Integer -> Down a Source #
Read a => Read (Down a) | This instance would be equivalent to the derived instances of the `Down` newtype if the `getDown` field were removed Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods readsPrec :: Int -> ReadS (Down a) Source # readList :: ReadS [Down a] Source # readPrec :: ReadPrec (Down a) Source # readListPrec :: ReadPrec [Down a] Source #
Fractional a => Fractional (Down a) | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods (/) :: Down a -> Down a -> Down a Source # recip :: Down a -> Down a Source # fromRational :: Rational -> Down a Source #
Real a => Real (Down a) | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods toRational :: Down a -> Rational Source #
RealFrac a => RealFrac (Down a) | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods properFraction :: Integral b => Down a -> (b, Down a) Source # truncate :: Integral b => Down a -> b Source # round :: Integral b => Down a -> b Source # ceiling :: Integral b => Down a -> b Source # floor :: Integral b => Down a -> b Source #
Show a => Show (Down a) | This instance would be equivalent to the derived instances of the `Down` newtype if the `getDown` field were removed Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods showsPrec :: Int -> Down a -> ShowS Source # show :: Down a -> String Source # showList :: [Down a] -> ShowS Source #
NFData a => NFData (Down a) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: Down a -> () Source #
Eq a => Eq (Down a) | Since: base-4.6.0.0
Instance details Defined in Data.Ord Methods (==) :: Down a -> Down a -> Bool Source # (/=) :: Down a -> Down a -> Bool Source #
Ord a => Ord (Down a) | Since: base-4.6.0.0
Instance details Defined in Data.Ord Methods compare :: Down a -> Down a -> Ordering Source # (<) :: Down a -> Down a -> Bool Source # (<=) :: Down a -> Down a -> Bool Source # (>) :: Down a -> Down a -> Bool Source # (>=) :: Down a -> Down a -> Bool Source # max :: Down a -> Down a -> Down a Source # min :: Down a -> Down a -> Down a Source #
Unbox a => Unbox (Down a) |
Instance details Defined in Data.Vector.Unboxed.Base
type Rep1 Down | Since: base-4.12.0.0
Instance details Defined in GHC.Generics type Rep1 Down = D1 ('MetaData "Down" "Data.Ord" "base" 'True) (C1 ('MetaCons "Down" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDown") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
newtype MVector s (Down a) |
Instance details Defined in Data.Vector.Unboxed.Base newtype MVector s (Down a) = MV_Down (MVector s a)
type Rep (Down a) | Since: base-4.12.0.0
Instance details Defined in GHC.Generics type Rep (Down a) = D1 ('MetaData "Down" "Data.Ord" "base" 'True) (C1 ('MetaCons "Down" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDown") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
newtype Vector (Down a) |
Instance details Defined in Data.Vector.Unboxed.Base newtype Vector (Down a) = V_Down (Vector a)

type FilePath = String Source #

File and directory names are values of type `String`, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

data SeekMode Source #

A mode that determines the effect of `hSeek` `hdl mode i`.

Constructors

AbsoluteSeek | the position of `hdl` is set to `i`.
RelativeSeek | the position of `hdl` is set to offset `i` from the current position.
SeekFromEnd | the position of `hdl` is set to offset `i` from the end of the file.

#### Instances

Instances details

Enum SeekMode | Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Device

Methods

succ :: SeekMode -> SeekMode Source #

pred :: SeekMode -> SeekMode Source #

toEnum :: Int -> SeekMode Source #

fromEnum :: SeekMode -> Int Source #

enumFrom :: SeekMode -> [SeekMode] Source #

enumFromThen :: SeekMode -> SeekMode -> [SeekMode] Source #

enumFromTo :: SeekMode -> SeekMode -> [SeekMode] Source #

enumFromThenTo :: SeekMode -> SeekMode -> SeekMode -> [SeekMode] Source #

Ix SeekMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Device Methods range :: (SeekMode, SeekMode) -> [SeekMode] Source # index :: (SeekMode, SeekMode) -> SeekMode -> Int Source # unsafeIndex :: (SeekMode, SeekMode) -> SeekMode -> Int Source # inRange :: (SeekMode, SeekMode) -> SeekMode -> Bool Source # rangeSize :: (SeekMode, SeekMode) -> Int Source # unsafeRangeSize :: (SeekMode, SeekMode) -> Int Source #
Read SeekMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Device Methods readsPrec :: Int -> ReadS SeekMode Source # readList :: ReadS [SeekMode] Source # readPrec :: ReadPrec SeekMode Source # readListPrec :: ReadPrec [SeekMode] Source #
Show SeekMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Device Methods showsPrec :: Int -> SeekMode -> ShowS Source # show :: SeekMode -> String Source # showList :: [SeekMode] -> ShowS Source #
Eq SeekMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Device Methods (==) :: SeekMode -> SeekMode -> Bool Source # (/=) :: SeekMode -> SeekMode -> Bool Source #
Ord SeekMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Device Methods compare :: SeekMode -> SeekMode -> Ordering Source # (<) :: SeekMode -> SeekMode -> Bool Source # (<=) :: SeekMode -> SeekMode -> Bool Source # (>) :: SeekMode -> SeekMode -> Bool Source # (>=) :: SeekMode -> SeekMode -> Bool Source # max :: SeekMode -> SeekMode -> SeekMode Source # min :: SeekMode -> SeekMode -> SeekMode Source #

data NewlineMode Source #

Specifies the translation, if any, of newline characters between internal Strings and the external file or stream. Haskell Strings are assumed to represent newlines with the `'\n'` character; the newline mode specifies how to translate `'\n'` on output, and what to translate into `'\n'` on input.

Constructors

NewlineMode |

Fields

- inputNL :: Newline

  the representation of newlines on input

- outputNL :: Newline

  the representation of newlines on output

#### Instances

Instances details

Read NewlineMode | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS NewlineMode Source # readList :: ReadS [NewlineMode] Source # readPrec :: ReadPrec NewlineMode Source # readListPrec :: ReadPrec [NewlineMode] Source #
Show NewlineMode | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> NewlineMode -> ShowS Source # show :: NewlineMode -> String Source # showList :: [NewlineMode] -> ShowS Source #
Eq NewlineMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: NewlineMode -> NewlineMode -> Bool Source # (/=) :: NewlineMode -> NewlineMode -> Bool Source #
Ord NewlineMode | Since: base-4.3.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

compare :: NewlineMode -> NewlineMode -> Ordering Source #

(<) :: NewlineMode -> NewlineMode -> Bool Source #

(<=) :: NewlineMode -> NewlineMode -> Bool Source #

(>) :: NewlineMode -> NewlineMode -> Bool Source #

(>=) :: NewlineMode -> NewlineMode -> Bool Source #

max :: NewlineMode -> NewlineMode -> NewlineMode Source #

min :: NewlineMode -> NewlineMode -> NewlineMode Source #

data Newline Source #

The representation of a newline in the external file or stream.

Constructors

LF

    '\n'

CRLF

    '\r\n'

#### Instances

Instances details

Read Newline | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS Newline Source # readList :: ReadS [Newline] Source # readPrec :: ReadPrec Newline Source # readListPrec :: ReadPrec [Newline] Source #
Show Newline | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Newline -> ShowS Source # show :: Newline -> String Source # showList :: [Newline] -> ShowS Source #
Eq Newline | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Newline -> Newline -> Bool Source # (/=) :: Newline -> Newline -> Bool Source #
Ord Newline | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Handle.Types Methods compare :: Newline -> Newline -> Ordering Source # (<) :: Newline -> Newline -> Bool Source # (<=) :: Newline -> Newline -> Bool Source # (>) :: Newline -> Newline -> Bool Source # (>=) :: Newline -> Newline -> Bool Source # max :: Newline -> Newline -> Newline Source # min :: Newline -> Newline -> Newline Source #

data BufferMode Source #

Three kinds of buffering are supported: line-buffering, block-buffering or no-buffering. These modes have the following effects. For output, items are written out, or flushed, from the internal buffer according to the buffer mode:

- line-buffering: the entire output buffer is flushed whenever a newline is output, the buffer overflows, a `hFlush` is issued, or the handle is closed.
- block-buffering: the entire buffer is written out whenever it overflows, a `hFlush` is issued, or the handle is closed.
- no-buffering: output is written immediately, and never stored in the buffer.

An implementation is free to flush the buffer more frequently, but not less frequently, than specified above. The output buffer is emptied as soon as it has been written out.

Similarly, input occurs according to the buffer mode for the handle:

- line-buffering: when the buffer for the handle is not empty, the next item is obtained from the buffer; otherwise, when the buffer is empty, characters up to and including the next newline character are read into the buffer. No characters are available until the newline character is available or the buffer is full.
- block-buffering: when the buffer for the handle becomes empty, the next block of data is read into the buffer.
- no-buffering: the next input item is read and returned. The `hLookAhead` operation implies that even a no-buffered handle may require a one-character buffer.

The default buffering mode when a handle is opened is implementation-dependent and may depend on the file system object which is attached to that handle. For most implementations, physical files will normally be block-buffered and terminals will normally be line-buffered.

Constructors

NoBuffering | buffering is disabled if possible.
LineBuffering | line-buffering should be enabled if possible.
BlockBuffering (Maybe Int) | block-buffering should be enabled if possible. The size of the buffer is `n` items if the argument is `Just` `n` and is otherwise implementation-dependent.

#### Instances

Instances details

Read BufferMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS BufferMode Source # readList :: ReadS [BufferMode] Source # readPrec :: ReadPrec BufferMode Source # readListPrec :: ReadPrec [BufferMode] Source #
Show BufferMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> BufferMode -> ShowS Source # show :: BufferMode -> String Source # showList :: [BufferMode] -> ShowS Source #
Eq BufferMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: BufferMode -> BufferMode -> Bool Source # (/=) :: BufferMode -> BufferMode -> Bool Source #
Ord BufferMode | Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

compare :: BufferMode -> BufferMode -> Ordering Source #

(<) :: BufferMode -> BufferMode -> Bool Source #

(<=) :: BufferMode -> BufferMode -> Bool Source #

(>) :: BufferMode -> BufferMode -> Bool Source #

(>=) :: BufferMode -> BufferMode -> Bool Source #

max :: BufferMode -> BufferMode -> BufferMode Source #

min :: BufferMode -> BufferMode -> BufferMode Source #

data IOErrorType Source #

An abstract type that contains a value for each variant of `IOException`.

#### Instances

Instances details

Show IOErrorType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS Source # show :: IOErrorType -> String Source # showList :: [IOErrorType] -> ShowS Source #
Eq IOErrorType | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOErrorType -> IOErrorType -> Bool Source # (/=) :: IOErrorType -> IOErrorType -> Bool Source #

data ExitCode Source #

Defines the exit codes that a program can return.

Constructors

ExitSuccess | indicates successful termination;
ExitFailure Int | indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).

#### Instances

Instances details

Exception ExitCode | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods toException :: ExitCode -> SomeException Source # fromException :: SomeException -> Maybe ExitCode Source # displayException :: ExitCode -> String Source #
Generic ExitCode |
Instance details Defined in GHC.IO.Exception Associated Types type Rep ExitCode :: Type -> Type Source # Methods from :: ExitCode -> Rep ExitCode x Source # to :: Rep ExitCode x -> ExitCode Source #
Read ExitCode |
Instance details Defined in GHC.IO.Exception Methods readsPrec :: Int -> ReadS ExitCode Source # readList :: ReadS [ExitCode] Source # readPrec :: ReadPrec ExitCode Source # readListPrec :: ReadPrec [ExitCode] Source #
Show ExitCode |
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ExitCode -> ShowS Source # show :: ExitCode -> String Source # showList :: [ExitCode] -> ShowS Source #
NFData ExitCode | Since: deepseq-1.4.2.0
Instance details Defined in Control.DeepSeq Methods rnf :: ExitCode -> () Source #
Eq ExitCode |
Instance details Defined in GHC.IO.Exception Methods (==) :: ExitCode -> ExitCode -> Bool Source # (/=) :: ExitCode -> ExitCode -> Bool Source #
Ord ExitCode |
Instance details Defined in GHC.IO.Exception Methods compare :: ExitCode -> ExitCode -> Ordering Source # (<) :: ExitCode -> ExitCode -> Bool Source # (<=) :: ExitCode -> ExitCode -> Bool Source # (>) :: ExitCode -> ExitCode -> Bool Source # (>=) :: ExitCode -> ExitCode -> Bool Source # max :: ExitCode -> ExitCode -> ExitCode Source # min :: ExitCode -> ExitCode -> ExitCode Source #
type Rep ExitCode |
Instance details Defined in GHC.IO.Exception type Rep ExitCode = D1 ('MetaData "ExitCode" "GHC.IO.Exception" "base" 'False) (C1 ('MetaCons "ExitSuccess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExitFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data IOMode Source #

See `openFile`

Constructors

ReadMode |
WriteMode |
AppendMode |
ReadWriteMode |

#### Instances

Instances details

Enum IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods succ :: IOMode -> IOMode Source # pred :: IOMode -> IOMode Source # toEnum :: Int -> IOMode Source # fromEnum :: IOMode -> Int Source # enumFrom :: IOMode -> [IOMode] Source # enumFromThen :: IOMode -> IOMode -> [IOMode] Source # enumFromTo :: IOMode -> IOMode -> [IOMode] Source # enumFromThenTo :: IOMode -> IOMode -> IOMode -> [IOMode] Source #
Ix IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods range :: (IOMode, IOMode) -> [IOMode] Source # index :: (IOMode, IOMode) -> IOMode -> Int Source # unsafeIndex :: (IOMode, IOMode) -> IOMode -> Int Source # inRange :: (IOMode, IOMode) -> IOMode -> Bool Source # rangeSize :: (IOMode, IOMode) -> Int Source # unsafeRangeSize :: (IOMode, IOMode) -> Int Source #
Read IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods readsPrec :: Int -> ReadS IOMode Source # readList :: ReadS [IOMode] Source # readPrec :: ReadPrec IOMode Source # readListPrec :: ReadPrec [IOMode] Source #
Show IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods showsPrec :: Int -> IOMode -> ShowS Source # show :: IOMode -> String Source # showList :: [IOMode] -> ShowS Source #
Eq IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods (==) :: IOMode -> IOMode -> Bool Source # (/=) :: IOMode -> IOMode -> Bool Source #
Ord IOMode | Since: base-4.2.0.0
Instance details Defined in GHC.IO.IOMode Methods compare :: IOMode -> IOMode -> Ordering Source # (<) :: IOMode -> IOMode -> Bool Source # (<=) :: IOMode -> IOMode -> Bool Source # (>) :: IOMode -> IOMode -> Bool Source # (>=) :: IOMode -> IOMode -> Bool Source # max :: IOMode -> IOMode -> IOMode Source # min :: IOMode -> IOMode -> IOMode Source #

data HandlePosn Source #

#### Instances

Instances details

Show HandlePosn | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle Methods showsPrec :: Int -> HandlePosn -> ShowS Source # show :: HandlePosn -> String Source # showList :: [HandlePosn] -> ShowS Source #
Eq HandlePosn | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle Methods (==) :: HandlePosn -> HandlePosn -> Bool Source # (/=) :: HandlePosn -> HandlePosn -> Bool Source #

newtype Const a (b :: k) Source #

The `Const` functor.

Constructors

Const |

Fields

- getConst :: a

#### Instances

Instances details

Generic1 (Const a :: k -> Type) |
Instance details Defined in Data.Functor.Const Associated Types type Rep1 (Const a) :: k -> Type Source # Methods from1 :: forall (a0 :: k0). Const a a0 -> Rep1 (Const a) a0 Source # to1 :: forall (a0 :: k0). Rep1 (Const a) a0 -> Const a a0 Source #
Unbox a => Vector Vector (Const a b) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: Mutable Vector s (Const a b) -> ST s (Vector (Const a b))

basicUnsafeThaw :: Vector (Const a b) -> ST s (Mutable Vector s (Const a b))

basicLength :: Vector (Const a b) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (Const a b) -> Vector (Const a b)

basicUnsafeIndexM :: Vector (Const a b) -> Int -> Box (Const a b)

basicUnsafeCopy :: Mutable Vector s (Const a b) -> Vector (Const a b) -> ST s ()

elemseq :: Vector (Const a b) -> Const a b -> b0 -> b0

Unbox a => MVector MVector (Const a b) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (Const a b) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (Const a b) -> MVector s (Const a b)

basicOverlaps :: MVector s (Const a b) -> MVector s (Const a b) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (Const a b))

basicInitialize :: MVector s (Const a b) -> ST s ()

basicUnsafeReplicate :: Int -> Const a b -> ST s (MVector s (Const a b))

basicUnsafeRead :: MVector s (Const a b) -> Int -> ST s (Const a b)

basicUnsafeWrite :: MVector s (Const a b) -> Int -> Const a b -> ST s ()

basicClear :: MVector s (Const a b) -> ST s ()

basicSet :: MVector s (Const a b) -> Const a b -> ST s ()

basicUnsafeCopy :: MVector s (Const a b) -> MVector s (Const a b) -> ST s ()

basicUnsafeMove :: MVector s (Const a b) -> MVector s (Const a b) -> ST s ()

basicUnsafeGrow :: MVector s (Const a b) -> Int -> ST s (MVector s (Const a b))

FromJSON2 (Const :: Type -> Type -> Type) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods liftParseJSON2 :: (Value -> Parser a) -> (Value -> Parser [a]) -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser (Const a b) Source # liftParseJSONList2 :: (Value -> Parser a) -> (Value -> Parser [a]) -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser [Const a b] Source #
ToJSON2 (Const :: Type -> Type -> Type) |

Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Const a b -> Value Source #

liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Const a b] -> Value Source #

liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Const a b -> Encoding Source #

liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Const a b] -> Encoding Source #

Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d Source # first :: (a -> b) -> Const a c -> Const b c Source # second :: (b -> c) -> Const a b -> Const a c Source #
Eq2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const a c -> Const b d -> Bool Source #
Ord2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const a c -> Const b d -> Ordering Source #
Read2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const a b) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] Source #

Show2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const a b -> ShowS Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const a b] -> ShowS Source #
NFData2 (Const :: Type -> Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf2 :: (a -> ()) -> (b -> ()) -> Const a b -> () Source #
Hashable2 (Const :: Type -> Type -> Type) |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt2 :: (Int -> a -> Int) -> (Int -> b -> Int) -> Int -> Const a b -> Int Source #
FromJSON a => FromJSON1 (Const a :: Type -> Type) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods liftParseJSON :: (Value -> Parser a0) -> (Value -> Parser [a0]) -> Value -> Parser (Const a a0) Source # liftParseJSONList :: (Value -> Parser a0) -> (Value -> Parser [a0]) -> Value -> Parser [Const a a0] Source #
ToJSON a => ToJSON1 (Const a :: Type -> Type) |

Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a0 -> Value) -> ([a0] -> Value) -> Const a a0 -> Value Source #

liftToJSONList :: (a0 -> Value) -> ([a0] -> Value) -> [Const a a0] -> Value Source #

liftToEncoding :: (a0 -> Encoding) -> ([a0] -> Encoding) -> Const a a0 -> Encoding Source #

liftToEncodingList :: (a0 -> Encoding) -> ([a0] -> Encoding) -> [Const a a0] -> Encoding Source #

Foldable (Const m :: Type -> Type) | Since: base-4.7.0.0

Instance details

Defined in Data.Functor.Const

Methods

fold :: Monoid m0 => Const m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> Const m a -> b Source #

foldr' :: (a -> b -> b) -> b -> Const m a -> b Source #

foldl :: (b -> a -> b) -> b -> Const m a -> b Source #

foldl' :: (b -> a -> b) -> b -> Const m a -> b Source #

foldr1 :: (a -> a -> a) -> Const m a -> a Source #

foldl1 :: (a -> a -> a) -> Const m a -> a Source #

toList :: Const m a -> [a] Source #

null :: Const m a -> Bool Source #

length :: Const m a -> Int Source #

elem :: Eq a => a -> Const m a -> Bool Source #

maximum :: Ord a => Const m a -> a Source #

minimum :: Ord a => Const m a -> a Source #

sum :: Num a => Const m a -> a Source #

product :: Num a => Const m a -> a Source #

Eq a => Eq1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Const a a0 -> Const a b -> Bool Source #
Ord a => Ord1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Const a a0 -> Const a b -> Ordering Source #
Read a => Read1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] Source #
Show a => Show1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Const a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS Source #
Traversable (Const m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) Source # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) Source # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) Source # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) Source #
Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a Source # (<*>) :: Const m (a -> b) -> Const m a -> Const m b Source # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source # (*>) :: Const m a -> Const m b -> Const m b Source # (<*) :: Const m a -> Const m b -> Const m a Source #
Functor (Const m :: Type -> Type) | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b Source # (<$) :: a -> Const m b -> Const m a Source #
NFData a => NFData1 (Const a :: Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a0 -> ()) -> Const a a0 -> () Source #
Hashable a => Hashable1 (Const a :: Type -> Type) |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt :: (Int -> a0 -> Int) -> Int -> Const a a0 -> Int Source #
Reportable (Const r :: Type -> Type) e |
Instance details Defined in Hledger.Reports.ReportOptions Methods report :: a -> Const r (Either e a) -> Const r a
FromJSON a => FromJSON (Const a b) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser (Const a b) Source # parseJSONList :: Value -> Parser [Const a b] Source #
(FromJSON a, FromJSONKey a) => FromJSONKey (Const a b) |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction (Const a b) Source # fromJSONKeyList :: FromJSONKeyFunction [Const a b] Source #
ToJSON a => ToJSON (Const a b) |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Const a b -> Value Source # toEncoding :: Const a b -> Encoding Source # toJSONList :: [Const a b] -> Value Source # toEncodingList :: [Const a b] -> Encoding Source #
(ToJSON a, ToJSONKey a) => ToJSONKey (Const a b) |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction (Const a b) Source # toJSONKeyList :: ToJSONKeyFunction [Const a b] Source #
(Typeable k, Data a, Typeable b) => Data (Const a b) | Since: base-4.10.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Const a b -> c (Const a b) Source #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Const a b) Source #

toConstr :: Const a b -> Constr Source #

dataTypeOf :: Const a b -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Const a b)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Const a b)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Const a b -> Const a b Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Const a b -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Const a b -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) Source #

IsString a => IsString (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Const a b Source #
Storable a => Storable (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

sizeOf :: Const a b -> Int Source #

alignment :: Const a b -> Int Source #

peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) Source #

pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () Source #

peekByteOff :: Ptr b0 -> Int -> IO (Const a b) Source #

pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () Source #

peek :: Ptr (Const a b) -> IO (Const a b) Source #

poke :: Ptr (Const a b) -> Const a b -> IO () Source #

Monoid a => Monoid (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b Source # mappend :: Const a b -> Const a b -> Const a b Source # mconcat :: [Const a b] -> Const a b Source #
Semigroup a => Semigroup (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b Source # sconcat :: NonEmpty (Const a b) -> Const a b Source # stimes :: Integral b0 => b0 -> Const a b -> Const a b Source #
Bits a => Bits (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(.&.) :: Const a b -> Const a b -> Const a b Source #

(.|.) :: Const a b -> Const a b -> Const a b Source #

xor :: Const a b -> Const a b -> Const a b Source #

complement :: Const a b -> Const a b Source #

shift :: Const a b -> Int -> Const a b Source #

rotate :: Const a b -> Int -> Const a b Source #

zeroBits :: Const a b Source #

bit :: Int -> Const a b Source #

setBit :: Const a b -> Int -> Const a b Source #

clearBit :: Const a b -> Int -> Const a b Source #

complementBit :: Const a b -> Int -> Const a b Source #

testBit :: Const a b -> Int -> Bool Source #

bitSizeMaybe :: Const a b -> Maybe Int Source #

bitSize :: Const a b -> Int Source #

isSigned :: Const a b -> Bool Source #

shiftL :: Const a b -> Int -> Const a b Source #

unsafeShiftL :: Const a b -> Int -> Const a b Source #

shiftR :: Const a b -> Int -> Const a b Source #

unsafeShiftR :: Const a b -> Int -> Const a b Source #

rotateL :: Const a b -> Int -> Const a b Source #

rotateR :: Const a b -> Int -> Const a b Source #

popCount :: Const a b -> Int Source #

FiniteBits a => FiniteBits (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int Source # countLeadingZeros :: Const a b -> Int Source # countTrailingZeros :: Const a b -> Int Source #
Bounded a => Bounded (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods minBound :: Const a b Source # maxBound :: Const a b Source #
Enum a => Enum (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

succ :: Const a b -> Const a b Source #

pred :: Const a b -> Const a b Source #

toEnum :: Int -> Const a b Source #

fromEnum :: Const a b -> Int Source #

enumFrom :: Const a b -> [Const a b] Source #

enumFromThen :: Const a b -> Const a b -> [Const a b] Source #

enumFromTo :: Const a b -> Const a b -> [Const a b] Source #

enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] Source #

Floating a => Floating (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

pi :: Const a b Source #

exp :: Const a b -> Const a b Source #

log :: Const a b -> Const a b Source #

sqrt :: Const a b -> Const a b Source #

(**) :: Const a b -> Const a b -> Const a b Source #

logBase :: Const a b -> Const a b -> Const a b Source #

sin :: Const a b -> Const a b Source #

cos :: Const a b -> Const a b Source #

tan :: Const a b -> Const a b Source #

asin :: Const a b -> Const a b Source #

acos :: Const a b -> Const a b Source #

atan :: Const a b -> Const a b Source #

sinh :: Const a b -> Const a b Source #

cosh :: Const a b -> Const a b Source #

tanh :: Const a b -> Const a b Source #

asinh :: Const a b -> Const a b Source #

acosh :: Const a b -> Const a b Source #

atanh :: Const a b -> Const a b Source #

log1p :: Const a b -> Const a b Source #

expm1 :: Const a b -> Const a b Source #

log1pexp :: Const a b -> Const a b Source #

log1mexp :: Const a b -> Const a b Source #

RealFloat a => RealFloat (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

floatRadix :: Const a b -> Integer Source #

floatDigits :: Const a b -> Int Source #

floatRange :: Const a b -> (Int, Int) Source #

decodeFloat :: Const a b -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Const a b Source #

exponent :: Const a b -> Int Source #

significand :: Const a b -> Const a b Source #

scaleFloat :: Int -> Const a b -> Const a b Source #

isNaN :: Const a b -> Bool Source #

isInfinite :: Const a b -> Bool Source #

isDenormalized :: Const a b -> Bool Source #

isNegativeZero :: Const a b -> Bool Source #

isIEEE :: Const a b -> Bool Source #

atan2 :: Const a b -> Const a b -> Const a b Source #

Generic (Const a b) |
Instance details Defined in Data.Functor.Const Associated Types type Rep (Const a b) :: Type -> Type Source # Methods from :: Const a b -> Rep (Const a b) x Source # to :: Rep (Const a b) x -> Const a b Source #
Ix a => Ix (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

range :: (Const a b, Const a b) -> [Const a b] Source #

index :: (Const a b, Const a b) -> Const a b -> Int Source #

unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int Source #

inRange :: (Const a b, Const a b) -> Const a b -> Bool Source #

rangeSize :: (Const a b, Const a b) -> Int Source #

unsafeRangeSize :: (Const a b, Const a b) -> Int Source #

Num a => Num (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b Source # (-) :: Const a b -> Const a b -> Const a b Source # (*) :: Const a b -> Const a b -> Const a b Source # negate :: Const a b -> Const a b Source # abs :: Const a b -> Const a b Source # signum :: Const a b -> Const a b Source # fromInteger :: Integer -> Const a b Source #
Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `getConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) Source # readList :: ReadS [Const a b] Source # readPrec :: ReadPrec (Const a b) Source # readListPrec :: ReadPrec [Const a b] Source #
Fractional a => Fractional (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b Source # recip :: Const a b -> Const a b Source # fromRational :: Rational -> Const a b Source #
Integral a => Integral (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

quot :: Const a b -> Const a b -> Const a b Source #

rem :: Const a b -> Const a b -> Const a b Source #

div :: Const a b -> Const a b -> Const a b Source #

mod :: Const a b -> Const a b -> Const a b Source #

quotRem :: Const a b -> Const a b -> (Const a b, Const a b) Source #

divMod :: Const a b -> Const a b -> (Const a b, Const a b) Source #

toInteger :: Const a b -> Integer Source #

Real a => Real (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational Source #
RealFrac a => RealFrac (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) Source # truncate :: Integral b0 => Const a b -> b0 Source # round :: Integral b0 => Const a b -> b0 Source # ceiling :: Integral b0 => Const a b -> b0 Source # floor :: Integral b0 => Const a b -> b0 Source #
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `getConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS Source # show :: Const a b -> String Source # showList :: [Const a b] -> ShowS Source #
NFData a => NFData (Const a b) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: Const a b -> () Source #
Eq a => Eq (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool Source # (/=) :: Const a b -> Const a b -> Bool Source #
Ord a => Ord (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

compare :: Const a b -> Const a b -> Ordering Source #

(<) :: Const a b -> Const a b -> Bool Source #

(<=) :: Const a b -> Const a b -> Bool Source #

(>) :: Const a b -> Const a b -> Bool Source #

(>=) :: Const a b -> Const a b -> Bool Source #

max :: Const a b -> Const a b -> Const a b Source #

min :: Const a b -> Const a b -> Const a b Source #

Hashable a => Hashable (Const a b) |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Const a b -> Int Source # hash :: Const a b -> Int Source #
MonoFoldable (Const m a) |

Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m0 => (Element (Const m a) -> m0) -> Const m a -> m0

ofoldr :: (Element (Const m a) -> b -> b) -> b -> Const m a -> b

ofoldl' :: (a0 -> Element (Const m a) -> a0) -> a0 -> Const m a -> a0

otoList :: Const m a -> [Element (Const m a)]

oall :: (Element (Const m a) -> Bool) -> Const m a -> Bool

oany :: (Element (Const m a) -> Bool) -> Const m a -> Bool

onull :: Const m a -> Bool

olength :: Const m a -> Int

olength64 :: Const m a -> Int64

ocompareLength :: Integral i => Const m a -> i -> Ordering

otraverse_ :: Applicative f => (Element (Const m a) -> f b) -> Const m a -> f ()

ofor_ :: Applicative f => Const m a -> (Element (Const m a) -> f b) -> f ()

omapM_ :: Applicative m0 => (Element (Const m a) -> m0 ()) -> Const m a -> m0 ()

oforM_ :: Applicative m0 => Const m a -> (Element (Const m a) -> m0 ()) -> m0 ()

ofoldlM :: Monad m0 => (a0 -> Element (Const m a) -> m0 a0) -> a0 -> Const m a -> m0 a0

ofoldMap1Ex :: Semigroup m0 => (Element (Const m a) -> m0) -> Const m a -> m0

ofoldr1Ex :: (Element (Const m a) -> Element (Const m a) -> Element (Const m a)) -> Const m a -> Element (Const m a)

ofoldl1Ex' :: (Element (Const m a) -> Element (Const m a) -> Element (Const m a)) -> Const m a -> Element (Const m a)

headEx :: Const m a -> Element (Const m a)

lastEx :: Const m a -> Element (Const m a)

unsafeHead :: Const m a -> Element (Const m a)

unsafeLast :: Const m a -> Element (Const m a)

maximumByEx :: (Element (Const m a) -> Element (Const m a) -> Ordering) -> Const m a -> Element (Const m a)

minimumByEx :: (Element (Const m a) -> Element (Const m a) -> Ordering) -> Const m a -> Element (Const m a)

oelem :: Element (Const m a) -> Const m a -> Bool

onotElem :: Element (Const m a) -> Const m a -> Bool

MonoFunctor (Const m a) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (Const m a) -> Element (Const m a)) -> Const m a -> Const m a
Monoid m => MonoPointed (Const m a) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (Const m a) -> Const m a
MonoTraversable (Const m a) |
Instance details Defined in Data.MonoTraversable Methods otraverse :: Applicative f => (Element (Const m a) -> f (Element (Const m a))) -> Const m a -> f (Const m a) omapM :: Applicative m0 => (Element (Const m a) -> m0 (Element (Const m a))) -> Const m a -> m0 (Const m a)
Pretty a => Pretty (Const a b) |
Instance details Defined in Prettyprinter.Internal Methods pretty :: Const a b -> Doc ann prettyList :: [Const a b] -> Doc ann
Unbox a => Unbox (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base
type Rep1 (Const a :: k -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const type Rep1 (Const a :: k -> Type) = D1 ('MetaData "Const" "Data.Functor.Const" "base" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
newtype MVector s (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base newtype MVector s (Const a b) = MV_Const (MVector s a)
type Rep (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const type Rep (Const a b) = D1 ('MetaData "Const" "Data.Functor.Const" "base" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Element (Const m a) |
Instance details Defined in Data.MonoTraversable type Element (Const m a) = a
newtype Vector (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base newtype Vector (Const a b) = V_Const (Vector a)

newtype ZipList a Source #

Lists, but with an `Applicative` functor based on zipping.

Constructors

ZipList |

Fields

- getZipList :: [a]

#### Instances

Instances details

Foldable ZipList | Since: base-4.9.0.0

Instance details

Defined in Control.Applicative

Methods

fold :: Monoid m => ZipList m -> m Source #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m Source #

foldMap' :: Monoid m => (a -> m) -> ZipList a -> m Source #

foldr :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldl :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldr1 :: (a -> a -> a) -> ZipList a -> a Source #

foldl1 :: (a -> a -> a) -> ZipList a -> a Source #

toList :: ZipList a -> [a] Source #

null :: ZipList a -> Bool Source #

length :: ZipList a -> Int Source #

elem :: Eq a => a -> ZipList a -> Bool Source #

maximum :: Ord a => ZipList a -> a Source #

minimum :: Ord a => ZipList a -> a Source #

sum :: Num a => ZipList a -> a Source #

product :: Num a => ZipList a -> a Source #

Traversable ZipList | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) Source # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) Source # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) Source # sequence :: Monad m => ZipList (m a) -> m (ZipList a) Source #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in Control.Applicative Methods empty :: ZipList a Source # (<|>) :: ZipList a -> ZipList a -> ZipList a Source # some :: ZipList a -> ZipList [a] Source # many :: ZipList a -> ZipList [a] Source #

Applicative ZipList

    f <$> ZipList xs1 <*> ... <*> ZipList xsN
        = ZipList (zipWithN f xs1 ... xsN)

where `zipWithN` refers to the `zipWith` function of the appropriate arity (`zipWith`, `zipWith3`, `zipWith4`, ...). For example:

    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: base-2.1

Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a Source # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source # (*>) :: ZipList a -> ZipList b -> ZipList b Source # (<*) :: ZipList a -> ZipList b -> ZipList a Source #
Functor ZipList | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b Source # (<$) :: a -> ZipList b -> ZipList a Source #
NFData1 ZipList | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> ZipList a -> () Source #
Generic1 ZipList |
Instance details Defined in Control.Applicative Associated Types type Rep1 ZipList :: k -> Type Source # Methods from1 :: forall (a :: k). ZipList a -> Rep1 ZipList a Source # to1 :: forall (a :: k). Rep1 ZipList a -> ZipList a Source #
Data a => Data (ZipList a) | Since: base-4.14.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ZipList a -> c (ZipList a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ZipList a) Source #

toConstr :: ZipList a -> Constr Source #

dataTypeOf :: ZipList a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ZipList a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ZipList a)) Source #

gmapT :: (forall b. Data b => b -> b) -> ZipList a -> ZipList a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ZipList a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ZipList a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ZipList a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ZipList a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ZipList a -> m (ZipList a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ZipList a -> m (ZipList a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ZipList a -> m (ZipList a) Source #

Generic (ZipList a) |
Instance details Defined in Control.Applicative Associated Types type Rep (ZipList a) :: Type -> Type Source # Methods from :: ZipList a -> Rep (ZipList a) x Source # to :: Rep (ZipList a) x -> ZipList a Source #
IsList (ZipList a) | Since: base-4.15.0.0
Instance details Defined in GHC.IsList Associated Types type Item (ZipList a) Source # Methods fromList :: [Item (ZipList a)] -> ZipList a Source # fromListN :: Int -> [Item (ZipList a)] -> ZipList a Source # toList :: ZipList a -> [Item (ZipList a)] Source #
Read a => Read (ZipList a) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative Methods readsPrec :: Int -> ReadS (ZipList a) Source # readList :: ReadS [ZipList a] Source # readPrec :: ReadPrec (ZipList a) Source # readListPrec :: ReadPrec [ZipList a] Source #
Show a => Show (ZipList a) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative Methods showsPrec :: Int -> ZipList a -> ShowS Source # show :: ZipList a -> String Source # showList :: [ZipList a] -> ShowS Source #
NFData a => NFData (ZipList a) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: ZipList a -> () Source #
Eq a => Eq (ZipList a) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative Methods (==) :: ZipList a -> ZipList a -> Bool Source # (/=) :: ZipList a -> ZipList a -> Bool Source #
Ord a => Ord (ZipList a) | Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Methods

compare :: ZipList a -> ZipList a -> Ordering Source #

(<) :: ZipList a -> ZipList a -> Bool Source #

(<=) :: ZipList a -> ZipList a -> Bool Source #

(>) :: ZipList a -> ZipList a -> Bool Source #

(>=) :: ZipList a -> ZipList a -> Bool Source #

max :: ZipList a -> ZipList a -> ZipList a Source #

min :: ZipList a -> ZipList a -> ZipList a Source #

MonoFunctor (ZipList a) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (ZipList a) -> Element (ZipList a)) -> ZipList a -> ZipList a
MonoPointed (ZipList a) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (ZipList a) -> ZipList a
type Rep1 ZipList | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 ZipList = D1 ('MetaData "ZipList" "Control.Applicative" "base" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))
type Rep (ZipList a) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep (ZipList a) = D1 ('MetaData "ZipList" "Control.Applicative" "base" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))
type Item (ZipList a) |
Instance details Defined in GHC.IsList type Item (ZipList a) = a
type Element (ZipList a) |
Instance details Defined in Data.MonoTraversable type Element (ZipList a) = a

newtype WrappedArrow (a :: Type -> Type -> Type) b c Source #

Constructors

WrapArrow |

Fields

- unwrapArrow :: a b c

#### Instances

Instances details

Generic1 (WrappedArrow a b :: Type -> Type) |
Instance details Defined in Control.Applicative Associated Types type Rep1 (WrappedArrow a b) :: k -> Type Source # Methods from1 :: forall (a0 :: k). WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 Source # to1 :: forall (a0 :: k). Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 Source #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 Source # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 Source # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

Arrow a => Functor (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #
(Typeable a, Typeable b, Typeable c, Data (a b c)) => Data (WrappedArrow a b c) | Since: base-4.14.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b0. Data d => c0 (d -> b0) -> d -> c0 b0) -> (forall g. g -> c0 g) -> WrappedArrow a b c -> c0 (WrappedArrow a b c) Source #

gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (WrappedArrow a b c) Source #

toConstr :: WrappedArrow a b c -> Constr Source #

dataTypeOf :: WrappedArrow a b c -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (WrappedArrow a b c)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (WrappedArrow a b c)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> WrappedArrow a b c -> WrappedArrow a b c Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedArrow a b c -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedArrow a b c -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WrappedArrow a b c -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedArrow a b c -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WrappedArrow a b c -> m (WrappedArrow a b c) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WrappedArrow a b c -> m (WrappedArrow a b c) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WrappedArrow a b c -> m (WrappedArrow a b c) Source #

Generic (WrappedArrow a b c) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedArrow a b c) :: Type -> Type Source # Methods from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x Source # to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c Source #
Arrow a => MonoFunctor (WrappedArrow a b c) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (WrappedArrow a b c) -> Element (WrappedArrow a b c)) -> WrappedArrow a b c -> WrappedArrow a b c
Arrow a => MonoPointed (WrappedArrow a b c) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (WrappedArrow a b c) -> WrappedArrow a b c
type Rep1 (WrappedArrow a b :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 (WrappedArrow a b :: Type -> Type) = D1 ('MetaData "WrappedArrow" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapArrow" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (a b))))
type Rep (WrappedArrow a b c) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep (WrappedArrow a b c) = D1 ('MetaData "WrappedArrow" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapArrow" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (a b c))))
type Element (WrappedArrow a b c) |
Instance details Defined in Data.MonoTraversable type Element (WrappedArrow a b c) = c

newtype WrappedMonad (m :: Type -> Type) a Source #

Constructors

WrapMonad |

Fields

- unwrapMonad :: m a

#### Instances

Instances details

Generic1 (WrappedMonad m :: Type -> Type) |
Instance details Defined in Control.Applicative Associated Types type Rep1 (WrappedMonad m) :: k -> Type Source # Methods from1 :: forall (a :: k). WrappedMonad m a -> Rep1 (WrappedMonad m) a Source # to1 :: forall (a :: k). Rep1 (WrappedMonad m) a -> WrappedMonad m a Source #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a Source # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a Source # some :: WrappedMonad m a -> WrappedMonad m [a] Source # many :: WrappedMonad m a -> WrappedMonad m [a] Source #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a Source #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source #

Monad m => Functor (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a Source #
Monad m => Monad (WrappedMonad m) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b Source # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source # return :: a -> WrappedMonad m a Source #
(Typeable m, Typeable a, Data (m a)) => Data (WrappedMonad m a) | Since: base-4.14.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WrappedMonad m a -> c (WrappedMonad m a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WrappedMonad m a) Source #

toConstr :: WrappedMonad m a -> Constr Source #

dataTypeOf :: WrappedMonad m a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WrappedMonad m a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WrappedMonad m a)) Source #

gmapT :: (forall b. Data b => b -> b) -> WrappedMonad m a -> WrappedMonad m a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonad m a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonad m a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WrappedMonad m a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedMonad m a -> u Source #

gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> WrappedMonad m a -> m0 (WrappedMonad m a) Source #

gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonad m a -> m0 (WrappedMonad m a) Source #

gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonad m a -> m0 (WrappedMonad m a) Source #

Generic (WrappedMonad m a) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedMonad m a) :: Type -> Type Source # Methods from :: WrappedMonad m a -> Rep (WrappedMonad m a) x Source # to :: Rep (WrappedMonad m a) x -> WrappedMonad m a Source #
Monad m => MonoFunctor (WrappedMonad m a) |
Instance details Defined in Data.MonoTraversable Methods omap :: (Element (WrappedMonad m a) -> Element (WrappedMonad m a)) -> WrappedMonad m a -> WrappedMonad m a
Monad m => MonoPointed (WrappedMonad m a) |
Instance details Defined in Data.MonoTraversable Methods opoint :: Element (WrappedMonad m a) -> WrappedMonad m a
type Rep1 (WrappedMonad m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 (WrappedMonad m :: Type -> Type) = D1 ('MetaData "WrappedMonad" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapMonad" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapMonad") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 m)))
type Rep (WrappedMonad m a) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep (WrappedMonad m a) = D1 ('MetaData "WrappedMonad" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapMonad" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapMonad") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (m a))))
type Element (WrappedMonad m a) |
Instance details Defined in Data.MonoTraversable type Element (WrappedMonad m a) = a

type ModifierParser = String -> FormatParse Source #

Type of a function that will parse modifier characters from the format string.

Since: base-4.7.0.0

type FieldFormatter = FieldFormat -> ShowS Source #

This is the type of a field formatter reified over its argument.

Since: base-4.7.0.0

data FormatParse Source #

The "format parser" walks over argument-type-specific modifier characters to find the primary format character. This is the type of its result.

Since: base-4.7.0.0

Constructors

FormatParse |

Fields

- fpModifiers :: String

  Any modifiers found.

- fpChar :: Char

  Primary format character.

- fpRest :: String

  Rest of the format string.

data FieldFormat Source #

Description of field formatting for `formatArg`. See UNIX `printf(3)` for a description of how field formatting works.

Since: base-4.7.0.0

Constructors

FieldFormat |

Fields

- fmtWidth :: Maybe Int

  Total width of the field.

- fmtPrecision :: Maybe Int

  Secondary field width specifier.

- fmtAdjust :: Maybe FormatAdjustment

  Kind of filling or padding to be done.

- fmtSign :: Maybe FormatSign

  Whether to insist on a plus sign for positive numbers.

- fmtAlternate :: Bool

  Indicates an "alternate format". See `printf(3)` for the details, which vary by argument spec.

- fmtModifiers :: String

  Characters that appeared immediately to the left of `fmtChar` in the format and were accepted by the type's `parseFormat`. Normally the empty string.

- fmtChar :: Char

  The format character `printf` was invoked with. `formatArg` should fail unless this character matches the type. It is normal to handle many different format characters for a single type.

data FormatSign Source #

How to handle the sign of a numeric field. These are mutually exclusive, with `SignPlus` taking precedence.

Since: base-4.7.0.0

Constructors

SignPlus |
SignSpace |

data FormatAdjustment Source #

Whether to left-adjust or zero-pad a field. These are mutually exclusive, with `LeftAdjust` taking precedence.

Since: base-4.7.0.0

Constructors

LeftAdjust |
ZeroPad |

class IsChar c where Source #

This class, with only the one instance, is used as a workaround for the fact that `String`, as a concrete type, is not allowable as a typeclass instance. `IsChar` is exported for backward-compatibility.

Methods

toChar :: c -> Char Source #

Since: base-4.7.0.0

fromChar :: Char -> c Source #

Since: base-4.7.0.0

#### Instances

Instances details

IsChar Char | Since: base-2.1
Instance details Defined in Text.Printf Methods toChar :: Char -> Char Source # fromChar :: Char -> Char Source #

class PrintfArg a where Source #

Typeclass of `printf`-formattable values. The `formatArg` method takes a value and a field format descriptor and either fails due to a bad descriptor or produces a `ShowS` as the result. The default `parseFormat` expects no modifiers: this is the normal case. Minimal instance: `formatArg`.

Minimal complete definition

formatArg

Methods

formatArg :: a -> FieldFormatter Source #

Since: base-4.7.0.0

parseFormat :: a -> ModifierParser Source #

Since: base-4.7.0.0

#### Instances

Instances details

PrintfArg Int16 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int16 -> FieldFormatter Source # parseFormat :: Int16 -> ModifierParser Source #
PrintfArg Int32 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int32 -> FieldFormatter Source # parseFormat :: Int32 -> ModifierParser Source #
PrintfArg Int64 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int64 -> FieldFormatter Source # parseFormat :: Int64 -> ModifierParser Source #
PrintfArg Int8 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int8 -> FieldFormatter Source # parseFormat :: Int8 -> ModifierParser Source #
PrintfArg Word16 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word16 -> FieldFormatter Source # parseFormat :: Word16 -> ModifierParser Source #
PrintfArg Word32 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word32 -> FieldFormatter Source # parseFormat :: Word32 -> ModifierParser Source #
PrintfArg Word64 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word64 -> FieldFormatter Source # parseFormat :: Word64 -> ModifierParser Source #
PrintfArg Word8 | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word8 -> FieldFormatter Source # parseFormat :: Word8 -> ModifierParser Source #
PrintfArg ShortText |
Instance details Defined in Data.Text.Short.Internal Methods formatArg :: ShortText -> FieldFormatter Source # parseFormat :: ShortText -> ModifierParser Source #
PrintfArg Integer | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Integer -> FieldFormatter Source # parseFormat :: Integer -> ModifierParser Source #
PrintfArg Natural | Since: base-4.8.0.0
Instance details Defined in Text.Printf Methods formatArg :: Natural -> FieldFormatter Source # parseFormat :: Natural -> ModifierParser Source #
PrintfArg Char | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Char -> FieldFormatter Source # parseFormat :: Char -> ModifierParser Source #
PrintfArg Double | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Double -> FieldFormatter Source # parseFormat :: Double -> ModifierParser Source #
PrintfArg Float | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Float -> FieldFormatter Source # parseFormat :: Float -> ModifierParser Source #
PrintfArg Int | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int -> FieldFormatter Source # parseFormat :: Int -> ModifierParser Source #
PrintfArg Word | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word -> FieldFormatter Source # parseFormat :: Word -> ModifierParser Source #
IsChar c => PrintfArg [c] | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: [c] -> FieldFormatter Source # parseFormat :: [c] -> ModifierParser Source #

class HPrintfType t Source #

The `HPrintfType` class provides the variable argument magic for `hPrintf`. Its implementation is intentionally not visible from this module.

Minimal complete definition

hspr

#### Instances

Instances details

a ~ () => HPrintfType (IO a) | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods hspr :: Handle -> String -> [UPrintf] -> IO a
(PrintfArg a, HPrintfType r) => HPrintfType (a -> r) | Since: base-2.1
Instance details Defined in Text.Printf Methods hspr :: Handle -> String -> [UPrintf] -> a -> r

class PrintfType t Source #

The `PrintfType` class provides the variable argument magic for `printf`. Its implementation is intentionally not visible from this module. If you attempt to pass an argument of a type which is not an instance of this class to `printf` or `hPrintf`, then the compiler will report it as a missing instance of `PrintfArg`.

Minimal complete definition

spr

#### Instances

Instances details

a ~ () => PrintfType (IO a) | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods spr :: String -> [UPrintf] -> IO a
IsChar c => PrintfType [c] | Since: base-2.1
Instance details Defined in Text.Printf Methods spr :: String -> [UPrintf] -> [c]
(PrintfArg a, PrintfType r) => PrintfType (a -> r) | Since: base-2.1
Instance details Defined in Text.Printf Methods spr :: String -> [UPrintf] -> a -> r

data QSemN Source #

`QSemN` is a quantity semaphore in which the resource is acquired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked `waitQSemN` calls.

The pattern

      bracket_ (waitQSemN n) (signalQSemN n) (...)

is safe; it never loses any of the resource.

data QSem Source #

`QSem` is a quantity semaphore in which the resource is acquired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked `waitQSem` calls.

The pattern

      bracket_ waitQSem signalQSem (...)

is safe; it never loses a unit of the resource.

data Timeout Source #

Timeout to be applied to individual tests

Constructors

Timeout Integer String | `String` is the original representation of the timeout (such as `"0.5m"`), so that we can print it back. `Integer` is the number of microseconds.
NoTimeout |

#### Instances

Instances details

Show Timeout |
Instance details Defined in Test.Tasty.Options.Core Methods showsPrec :: Int -> Timeout -> ShowS Source # show :: Timeout -> String Source # showList :: [Timeout] -> ShowS Source #
IsOption Timeout |
Instance details Defined in Test.Tasty.Options.Core Methods defaultValue :: Timeout Source # parseValue :: String -> Maybe Timeout Source # optionName :: Tagged Timeout String Source # optionHelp :: Tagged Timeout String Source # showDefaultValue :: Timeout -> Maybe String Source # optionCLParser :: Parser Timeout Source #

data Arg a Source #

An unnamed argument. Anything not starting with `-` is considered an argument, apart from `"-"` which is considered to be the argument `"-"`, and any arguments following `"--"`. For example:

    programname arg1 -j - --foo arg3 -- -arg4 --arg5=1 arg6

Would have the arguments:

    ["arg1","-","arg3","-arg4","--arg5=1","arg6"]

Constructors

Arg |

Fields

- argValue :: Update a

  A way of processing the argument.

- argType :: FlagHelp

  The type of data for the argument, i.e. FILE/DIR/EXT

- argRequire :: Bool

  Is at least one of these arguments required, the command line will fail if none are set

#### Instances

Instances details

Remap Arg |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods remap :: (a -> b) -> (b -> (a, a -> b)) -> Arg a -> Arg b Source #

class Remap (m :: Type -> Type) where Source #

Like functor, but where the the argument isn't just covariant.

Methods

remap Source #

Arguments

:: (a -> b) | Embed a value
-> (b -> (a, a -> b)) | Extract the mode and give a way of re-embedding
-> m a |
-> m b |

Convert between two values.

#### Instances

Instances details

Remap Arg |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods remap :: (a -> b) -> (b -> (a, a -> b)) -> Arg a -> Arg b Source #
Remap Flag |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods remap :: (a -> b) -> (b -> (a, a -> b)) -> Flag a -> Flag b Source #
Remap Mode |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods remap :: (a -> b) -> (b -> (a, a -> b)) -> Mode a -> Mode b Source #

data Flag a Source #

A flag, consisting of a list of flag names and other information.

Constructors

Flag |

Fields

- flagNames :: [Name]

  The names for the flag.

- flagInfo :: FlagInfo

  Information about a flag's arguments.

- flagValue :: Update a

  The way of processing a flag.

- flagType :: FlagHelp

  The type of data for the flag argument, i.e. FILE/DIR/EXT

- flagHelp :: Help

  The help message associated with this flag.

#### Instances

Instances details

Remap Flag |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods remap :: (a -> b) -> (b -> (a, a -> b)) -> Flag a -> Flag b Source #

type Update a = String -> a -> Either String a Source #

A function to take a string, and a value, and either produce an error message (`Left`), or a modified value (`Right`).

data FlagInfo Source #

The `FlagInfo` type has the following meaning:

                 FlagReq     FlagOpt      FlagOptRare/FlagNone
    -xfoo        -x=foo      -x=foo       -x -foo
    -x foo       -x=foo      -x foo       -x foo
    -x=foo       -x=foo      -x=foo       -x=foo
    --xx foo     --xx=foo    --xx foo     --xx foo
    --xx=foo     --xx=foo    --xx=foo     --xx=foo

Constructors

FlagReq | Required argument
FlagOpt String | Optional argument
FlagOptRare String | Optional argument that requires an = before the value
FlagNone | No argument

#### Instances

Instances details

Show FlagInfo |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods showsPrec :: Int -> FlagInfo -> ShowS Source # show :: FlagInfo -> String Source # showList :: [FlagInfo] -> ShowS Source #
Eq FlagInfo |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods (==) :: FlagInfo -> FlagInfo -> Bool Source # (/=) :: FlagInfo -> FlagInfo -> Bool Source #
Ord FlagInfo |

Instance details

Defined in System.Console.CmdArgs.Explicit.Type

Methods

compare :: FlagInfo -> FlagInfo -> Ordering Source #

(<) :: FlagInfo -> FlagInfo -> Bool Source #

(<=) :: FlagInfo -> FlagInfo -> Bool Source #

(>) :: FlagInfo -> FlagInfo -> Bool Source #

(>=) :: FlagInfo -> FlagInfo -> Bool Source #

max :: FlagInfo -> FlagInfo -> FlagInfo Source #

min :: FlagInfo -> FlagInfo -> FlagInfo Source #

data Mode a Source #

A mode. Do not use the `Mode` constructor directly, instead use `mode` to construct the `Mode` and then record updates. Each mode has three main features:

- A list of submodes (`modeGroupModes`)
- A list of flags (`modeGroupFlags`)
- Optionally an unnamed argument (`modeArgs`)

To produce the help information for a mode, either use `helpText` or `show`.

Constructors

Mode |

Fields

- modeGroupModes :: Group (Mode a)

  The available sub-modes

- modeNames :: [Name]

  The names assigned to this mode (for the root mode, this name is used as the program name)

- modeValue :: a

  Value to start with

- modeCheck :: a -> Either String a

  Check the value reprsented by a mode is correct, after applying all flags

- modeReform :: a -> Maybe [String]

  Given a value, try to generate the input arguments.

- modeExpandAt :: Bool

  Expand `@` arguments with `expandArgsAt`, defaults to `True`, only applied if using an `IO` processing function. Only the root `Mode`s value will be used.

- modeHelp :: Help

  Help text

- modeHelpSuffix :: [String]

  A longer help suffix displayed after a mode

- modeArgs :: ([Arg a], Maybe (Arg a))

  The unnamed arguments, a series of arguments, followed optionally by one for all remaining slots

- modeGroupFlags :: Group (Flag a)

  Groups of flags

#### Instances

Instances details

Remap Mode |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods remap :: (a -> b) -> (b -> (a, a -> b)) -> Mode a -> Mode b Source #

data Group a Source #

A group of items (modes or flags). The items are treated as a list, but the group structure is used when displaying the help message.

Constructors

Group |

Fields

- groupUnnamed :: [a]

  Normal items.

- groupHidden :: [a]

  Items that are hidden (not displayed in the help message).

- groupNamed :: [(Help, [a])]

  Items that have been grouped, along with a description of each group.

#### Instances

Instances details

Functor Group |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods fmap :: (a -> b) -> Group a -> Group b Source # (<$) :: a -> Group b -> Group a Source #
Monoid (Group a) |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods mempty :: Group a Source # mappend :: Group a -> Group a -> Group a Source # mconcat :: [Group a] -> Group a Source #
Semigroup (Group a) |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods (<>) :: Group a -> Group a -> Group a Source # sconcat :: NonEmpty (Group a) -> Group a Source # stimes :: Integral b => b -> Group a -> Group a Source #
Show a => Show (Group a) |
Instance details Defined in System.Console.CmdArgs.Explicit.Type Methods showsPrec :: Int -> Group a -> ShowS Source # show :: Group a -> String Source # showList :: [Group a] -> ShowS Source #

type FlagHelp = String Source #

The type of a flag, i.e. `--foo=TYPE`.

type Help = String Source #

A help message that goes with either a flag or a mode.

data Complete Source #

How to complete a command line option. The `Show` instance is suitable for parsing from shell scripts.

Constructors

CompleteValue String | Complete to a particular value
CompleteFile String FilePath | Complete to a prefix, and a file
CompleteDir String FilePath | Complete to a prefix, and a directory

#### Instances

Instances details

Show Complete |
Instance details Defined in System.Console.CmdArgs.Explicit.Complete Methods showsPrec :: Int -> Complete -> ShowS Source # show :: Complete -> String Source # showList :: [Complete] -> ShowS Source #
Eq Complete |
Instance details Defined in System.Console.CmdArgs.Explicit.Complete Methods (==) :: Complete -> Complete -> Bool Source # (/=) :: Complete -> Complete -> Bool Source #
Ord Complete |

Instance details

Defined in System.Console.CmdArgs.Explicit.Complete

Methods

compare :: Complete -> Complete -> Ordering Source #

(<) :: Complete -> Complete -> Bool Source #

(<=) :: Complete -> Complete -> Bool Source #

(>) :: Complete -> Complete -> Bool Source #

(>=) :: Complete -> Complete -> Bool Source #

max :: Complete -> Complete -> Complete Source #

min :: Complete -> Complete -> Complete Source #

data HelpFormat Source #

Specify the format to output the help.

Constructors

HelpFormatDefault | Equivalent to `HelpFormatAll` if there is not too much text, otherwise `HelpFormatOne`.
HelpFormatOne | Display only the first mode.
HelpFormatAll | Display all modes.
HelpFormatBash | Bash completion information
HelpFormatZsh | Z shell completion information

#### Instances

Instances details

Bounded HelpFormat |
Instance details Defined in System.Console.CmdArgs.Explicit.Help Methods minBound :: HelpFormat Source # maxBound :: HelpFormat Source #
Enum HelpFormat |

Instance details

Defined in System.Console.CmdArgs.Explicit.Help

Methods

succ :: HelpFormat -> HelpFormat Source #

pred :: HelpFormat -> HelpFormat Source #

toEnum :: Int -> HelpFormat Source #

fromEnum :: HelpFormat -> Int Source #

enumFrom :: HelpFormat -> [HelpFormat] Source #

enumFromThen :: HelpFormat -> HelpFormat -> [HelpFormat] Source #

enumFromTo :: HelpFormat -> HelpFormat -> [HelpFormat] Source #

enumFromThenTo :: HelpFormat -> HelpFormat -> HelpFormat -> [HelpFormat] Source #

Read HelpFormat |
Instance details Defined in System.Console.CmdArgs.Explicit.Help Methods readsPrec :: Int -> ReadS HelpFormat Source # readList :: ReadS [HelpFormat] Source # readPrec :: ReadPrec HelpFormat Source # readListPrec :: ReadPrec [HelpFormat] Source #
Show HelpFormat |
Instance details Defined in System.Console.CmdArgs.Explicit.Help Methods showsPrec :: Int -> HelpFormat -> ShowS Source # show :: HelpFormat -> String Source # showList :: [HelpFormat] -> ShowS Source #
Default HelpFormat |
Instance details Defined in System.Console.CmdArgs.Explicit.Help Methods def :: HelpFormat Source #
Eq HelpFormat |
Instance details Defined in System.Console.CmdArgs.Explicit.Help Methods (==) :: HelpFormat -> HelpFormat -> Bool Source # (/=) :: HelpFormat -> HelpFormat -> Bool Source #
Ord HelpFormat |

Instance details

Defined in System.Console.CmdArgs.Explicit.Help

Methods

compare :: HelpFormat -> HelpFormat -> Ordering Source #

(<) :: HelpFormat -> HelpFormat -> Bool Source #

(<=) :: HelpFormat -> HelpFormat -> Bool Source #

(>) :: HelpFormat -> HelpFormat -> Bool Source #

(>=) :: HelpFormat -> HelpFormat -> Bool Source #

max :: HelpFormat -> HelpFormat -> HelpFormat Source #

min :: HelpFormat -> HelpFormat -> HelpFormat Source #

data Reader (m :: Type -> Type) Source #

A hledger journal reader is a triple of storage format name, a detector of that format, and a parser from that format to Journal. The type variable m appears here so that rParserr can hold a journal parser, which depends on it.

Constructors

Reader |

Fields

- rFormat :: StorageFormat
- rExtensions :: [String]
- rReadFn :: InputOpts -> FilePath -> Text -> ExceptT String IO Journal
- rParser :: MonadIO m => ErroringJournalParser m ParsedJournal

#### Instances

Instances details

Show (Reader m) |
Instance details Defined in Hledger.Read.Common Methods showsPrec :: Int -> Reader m -> ShowS Source # show :: Reader m -> String Source # showList :: [Reader m] -> ShowS Source #

data XdgDirectoryList Source #

Search paths for various application data, as specified by the XDG Base Directory Specification.

The list of paths is split using `searchPathSeparator`, which on Windows is a semicolon.

Note: On Windows, `XdgDataDirs` and `XdgConfigDirs` usually yield the same result.

Since: directory-1.3.2.0

Constructors

XdgDataDirs | For data files (e.g. images). It uses the `XDG_DATA_DIRS` environment variable. On non-Windows systems, the default is `/usr/local/share/` and `/usr/share/`. On Windows, the default is `%PROGRAMDATA%` or `%ALLUSERSPROFILE%` (e.g. `C:/ProgramData`).
XdgConfigDirs | For configuration files. It uses the `XDG_CONFIG_DIRS` environment variable. On non-Windows systems, the default is `/etc/xdg`. On Windows, the default is `%PROGRAMDATA%` or `%ALLUSERSPROFILE%` (e.g. `C:/ProgramData`).

#### Instances

Instances details

Bounded XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectoryList Source # maxBound :: XdgDirectoryList Source #
Enum XdgDirectoryList |

Instance details

Defined in System.Directory.Internal.Common

Methods

succ :: XdgDirectoryList -> XdgDirectoryList Source #

pred :: XdgDirectoryList -> XdgDirectoryList Source #

toEnum :: Int -> XdgDirectoryList Source #

fromEnum :: XdgDirectoryList -> Int Source #

enumFrom :: XdgDirectoryList -> [XdgDirectoryList] Source #

enumFromThen :: XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList] Source #

enumFromTo :: XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList] Source #

enumFromThenTo :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList -> [XdgDirectoryList] Source #

Read XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectoryList Source # readList :: ReadS [XdgDirectoryList] Source # readPrec :: ReadPrec XdgDirectoryList Source # readListPrec :: ReadPrec [XdgDirectoryList] Source #
Show XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectoryList -> ShowS Source # show :: XdgDirectoryList -> String Source # showList :: [XdgDirectoryList] -> ShowS Source #
Eq XdgDirectoryList |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source # (/=) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #
Ord XdgDirectoryList |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectoryList -> XdgDirectoryList -> Ordering Source #

(<) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

(<=) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

(>) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

(>=) :: XdgDirectoryList -> XdgDirectoryList -> Bool Source #

max :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList Source #

min :: XdgDirectoryList -> XdgDirectoryList -> XdgDirectoryList Source #

data XdgDirectory Source #

Special directories for storing user-specific application data, configuration, and cache files, as specified by the XDG Base Directory Specification.

Note: On Windows, `XdgData` and `XdgConfig` usually map to the same directory.

Since: directory-1.2.3.0

Constructors

XdgData | For data files (e.g. images). It uses the `XDG_DATA_HOME` environment variable. On non-Windows systems, the default is `~/.local/share`. On Windows, the default is `%APPDATA%` (e.g. `C:/Users/<user>/AppData/Roaming`). Can be considered as the user-specific equivalent of `/usr/share`.
XdgConfig | For configuration files. It uses the `XDG_CONFIG_HOME` environment variable. On non-Windows systems, the default is `~/.config`. On Windows, the default is `%APPDATA%` (e.g. `C:/Users/<user>/AppData/Roaming`). Can be considered as the user-specific equivalent of `/etc`.
XdgCache | For non-essential files (e.g. cache). It uses the `XDG_CACHE_HOME` environment variable. On non-Windows systems, the default is `~/.cache`. On Windows, the default is `%LOCALAPPDATA%` (e.g. `C:/Users/<user>/AppData/Local`). Can be considered as the user-specific equivalent of `/var/cache`.
XdgState | For data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in `XdgData`. It uses the `XDG_STATE_HOME` environment variable. On non-Windows sytems, the default is `~/.local/state`. On Windows, the default is `%LOCALAPPDATA%` (e.g. `C:/Users/<user>/AppData/Local`). Since: directory-1.3.7.0

#### Instances

Instances details

Bounded XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectory Source # maxBound :: XdgDirectory Source #
Enum XdgDirectory |

Instance details

Defined in System.Directory.Internal.Common

Methods

succ :: XdgDirectory -> XdgDirectory Source #

pred :: XdgDirectory -> XdgDirectory Source #

toEnum :: Int -> XdgDirectory Source #

fromEnum :: XdgDirectory -> Int Source #

enumFrom :: XdgDirectory -> [XdgDirectory] Source #

enumFromThen :: XdgDirectory -> XdgDirectory -> [XdgDirectory] Source #

enumFromTo :: XdgDirectory -> XdgDirectory -> [XdgDirectory] Source #

enumFromThenTo :: XdgDirectory -> XdgDirectory -> XdgDirectory -> [XdgDirectory] Source #

Read XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectory Source # readList :: ReadS [XdgDirectory] Source # readPrec :: ReadPrec XdgDirectory Source # readListPrec :: ReadPrec [XdgDirectory] Source #
Show XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectory -> ShowS Source # show :: XdgDirectory -> String Source # showList :: [XdgDirectory] -> ShowS Source #
Eq XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectory -> XdgDirectory -> Bool Source # (/=) :: XdgDirectory -> XdgDirectory -> Bool Source #
Ord XdgDirectory |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: XdgDirectory -> XdgDirectory -> Ordering Source #

(<) :: XdgDirectory -> XdgDirectory -> Bool Source #

(<=) :: XdgDirectory -> XdgDirectory -> Bool Source #

(>) :: XdgDirectory -> XdgDirectory -> Bool Source #

(>=) :: XdgDirectory -> XdgDirectory -> Bool Source #

max :: XdgDirectory -> XdgDirectory -> XdgDirectory Source #

min :: XdgDirectory -> XdgDirectory -> XdgDirectory Source #

data Permissions Source #

#### Instances

Instances details

Read Permissions |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS Permissions Source # readList :: ReadS [Permissions] Source # readPrec :: ReadPrec Permissions Source # readListPrec :: ReadPrec [Permissions] Source #
Show Permissions |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> Permissions -> ShowS Source # show :: Permissions -> String Source # showList :: [Permissions] -> ShowS Source #
Eq Permissions |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: Permissions -> Permissions -> Bool Source # (/=) :: Permissions -> Permissions -> Bool Source #
Ord Permissions |

Instance details

Defined in System.Directory.Internal.Common

Methods

compare :: Permissions -> Permissions -> Ordering Source #

(<) :: Permissions -> Permissions -> Bool Source #

(<=) :: Permissions -> Permissions -> Bool Source #

(>) :: Permissions -> Permissions -> Bool Source #

(>=) :: Permissions -> Permissions -> Bool Source #

max :: Permissions -> Permissions -> Permissions Source #

min :: Permissions -> Permissions -> Permissions Source #

data ProcessHandle Source #

A handle to a process, which can be used to wait for termination of the process using `waitForProcess`.

None of the process-creation functions in this library wait for termination: they all return a `ProcessHandle` which may be used to wait for the process later.

On Windows a second wait method can be used to block for event completion. This requires two handles. A process job handle and a events handle to monitor.

data StdStream Source #

Constructors

Inherit | Inherit Handle from parent
UseHandle Handle | Use the supplied Handle
CreatePipe | Create a new pipe. The returned `Handle` will use the default encoding and newline translation mode (just like `Handle`s created by `openFile`).

NoStream

Close the stream's file descriptor without passing a Handle. On POSIX systems this may lead to strange behavior in the child process because attempting to read or write after the file has been closed throws an error. This should only be used with child processes that don't use the file descriptor at all. If you wish to ignore the child process's output you should either create a pipe and drain it manually or pass a `Handle` that writes to `/dev/null`.

#### Instances

Instances details

Show StdStream |
Instance details Defined in System.Process.Common Methods showsPrec :: Int -> StdStream -> ShowS Source # show :: StdStream -> String Source # showList :: [StdStream] -> ShowS Source #
Eq StdStream |
Instance details Defined in System.Process.Common Methods (==) :: StdStream -> StdStream -> Bool Source # (/=) :: StdStream -> StdStream -> Bool Source #

data CmdSpec Source #

Constructors

ShellCommand String | A command line to execute using the shell

RawCommand FilePath [String]

The name of an executable with a list of arguments

The `FilePath` argument names the executable, and is interpreted according to the platform's standard policy for searching for executables. Specifically:

- on Unix systems the execvp(3) semantics is used, where if the executable filename does not contain a slash (`/`) then the `PATH` environment variable is searched for the executable.
- on Windows systems the Win32 `CreateProcess` semantics is used. Briefly: if the filename does not contain a path, then the directory containing the parent executable is searched, followed by the current directory, then some standard locations, and finally the current `PATH`. An `.exe` extension is added if the filename does not already have an extension. For full details see the documentation for the Windows `SearchPath` API.

#### Instances

Instances details

IsString CmdSpec | construct a `ShellCommand` from a string literal Since: process-1.2.1.0
Instance details Defined in System.Process.Common Methods fromString :: String -> CmdSpec Source #
Show CmdSpec |
Instance details Defined in System.Process.Common Methods showsPrec :: Int -> CmdSpec -> ShowS Source # show :: CmdSpec -> String Source # showList :: [CmdSpec] -> ShowS Source #
Eq CmdSpec |
Instance details Defined in System.Process.Common Methods (==) :: CmdSpec -> CmdSpec -> Bool Source # (/=) :: CmdSpec -> CmdSpec -> Bool Source #

data CreateProcess Source #

Constructors

CreateProcess |

Fields

- cmdspec :: CmdSpec

  Executable & arguments, or shell command. If `cwd` is `Nothing`, relative paths are resolved with respect to the current working directory. If `cwd` is provided, it is implementation-dependent whether relative paths are resolved with respect to `cwd` or the current working directory, so absolute paths should be used to ensure portability.

- cwd :: Maybe FilePath

  Optional path to the working directory for the new process

- env :: Maybe [(String, String)]

  Optional environment (otherwise inherit from the current process)

- std_in :: StdStream

  How to determine stdin

- std_out :: StdStream

  How to determine stdout

- std_err :: StdStream

  How to determine stderr

- close_fds :: Bool

  Close all file descriptors except stdin, stdout and stderr in the new process (on Windows, only works if std_in, std_out, and std_err are all Inherit). This implementation will call close on every fd from 3 to the maximum of open files, which can be slow for high maximum of open files.

- create_group :: Bool

  Create a new process group

- delegate_ctlc :: Bool

  Delegate control-C handling. Use this for interactive console processes to let them handle control-C themselves (see below for details).

  On Windows this has no effect.

  Since: process-1.2.0.0

- detach_console :: Bool

  Use the windows DETACHED_PROCESS flag when creating the process; does nothing on other platforms.

  Since: process-1.3.0.0

- create_new_console :: Bool

  Use the windows CREATE_NEW_CONSOLE flag when creating the process; does nothing on other platforms.

  Default: `False`

  Since: process-1.3.0.0

- new_session :: Bool

  Use posix setsid to start the new process in a new session; does nothing on other platforms.

  Since: process-1.3.0.0

- child_group :: Maybe GroupID

  Use posix setgid to set child process's group id; does nothing on other platforms.

  Default: `Nothing`

  Since: process-1.4.0.0

- child_user :: Maybe UserID

  Use posix setuid to set child process's user id; does nothing on other platforms.

  Default: `Nothing`

  Since: process-1.4.0.0

- use_process_jobs :: Bool

  On Windows systems this flag indicates that we should wait for the entire process tree to finish before unblocking. On POSIX systems this flag is ignored. See $exec-on-windows for details.

  Default: `False`

  Since: process-1.5.0.0

#### Instances

Instances details

Show CreateProcess |
Instance details Defined in System.Process.Common Methods showsPrec :: Int -> CreateProcess -> ShowS Source # show :: CreateProcess -> String Source # showList :: [CreateProcess] -> ShowS Source #
Eq CreateProcess |
Instance details Defined in System.Process.Common Methods (==) :: CreateProcess -> CreateProcess -> Bool Source # (/=) :: CreateProcess -> CreateProcess -> Bool Source #

type Pid = CPid Source #

The platform specific type for a process identifier.

This is always an integral type. Width and signedness are platform specific.

Since: process-1.6.3.0

data Layout Source #

Constructors

LayoutWide (Maybe Int) |
LayoutTall |
LayoutBare |
LayoutTidy |

#### Instances

Instances details

Show Layout |
Instance details Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> Layout -> ShowS Source # show :: Layout -> String Source # showList :: [Layout] -> ShowS Source #
Eq Layout |
Instance details Defined in Hledger.Reports.ReportOptions Methods (==) :: Layout -> Layout -> Bool Source # (/=) :: Layout -> Layout -> Bool Source #

data SourcePos Source #

The data type `SourcePos` represents source positions. It contains the name of the source file, a line number, and a column number. Source line and column positions change intensively during parsing, so we need to make them strict to avoid memory leaks.

Constructors

SourcePos |

Fields

- sourceName :: FilePath

  Name of source file

- sourceLine :: !Pos

  Line number

- sourceColumn :: !Pos

  Column number

#### Instances

Instances details

Data SourcePos |

Instance details

Defined in Text.Megaparsec.Pos

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos Source #

toConstr :: SourcePos -> Constr Source #

dataTypeOf :: SourcePos -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos) Source #

gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source #

Generic SourcePos |
Instance details Defined in Text.Megaparsec.Pos Associated Types type Rep SourcePos :: Type -> Type Source # Methods from :: SourcePos -> Rep SourcePos x Source # to :: Rep SourcePos x -> SourcePos Source #
Read SourcePos |
Instance details Defined in Text.Megaparsec.Pos Methods readsPrec :: Int -> ReadS SourcePos Source # readList :: ReadS [SourcePos] Source # readPrec :: ReadPrec SourcePos Source # readListPrec :: ReadPrec [SourcePos] Source #
Show SourcePos |
Instance details Defined in Text.Megaparsec.Pos Methods showsPrec :: Int -> SourcePos -> ShowS Source # show :: SourcePos -> String Source # showList :: [SourcePos] -> ShowS Source #
NFData SourcePos |
Instance details Defined in Text.Megaparsec.Pos Methods rnf :: SourcePos -> () Source #
Eq SourcePos |
Instance details Defined in Text.Megaparsec.Pos Methods (==) :: SourcePos -> SourcePos -> Bool Source # (/=) :: SourcePos -> SourcePos -> Bool Source #
Ord SourcePos |

Instance details

Defined in Text.Megaparsec.Pos

Methods

compare :: SourcePos -> SourcePos -> Ordering Source #

(<) :: SourcePos -> SourcePos -> Bool Source #

(<=) :: SourcePos -> SourcePos -> Bool Source #

(>) :: SourcePos -> SourcePos -> Bool Source #

(>=) :: SourcePos -> SourcePos -> Bool Source #

max :: SourcePos -> SourcePos -> SourcePos Source #

min :: SourcePos -> SourcePos -> SourcePos Source #

type Rep SourcePos |

Instance details

Defined in Text.Megaparsec.Pos

type Rep SourcePos = D1 ('MetaData "SourcePos" "Text.Megaparsec.Pos" "megaparsec-9.3.1-GP52uetH5lW5CfEYrDmfBz" 'False) (C1 ('MetaCons "SourcePos" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "sourceLine") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos) :*: S1 ('MetaSel ('Just "sourceColumn") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos))))

data TestTree Source #

The main data structure defining a test suite.

It consists of individual test cases and properties, organized in named groups which form a tree-like hierarchy.

There is no generic way to create a test case. Instead, every test provider (tasty-hunit, tasty-smallcheck etc.) provides a function to turn a test case into a `TestTree`.

Groups can be created using `testGroup`.

data DependencyType Source #

These are the two ways in which one test may depend on the others.

This is the same distinction as the hard vs soft dependencies in TestNG.

Since: tasty-1.2

Constructors

AllSucceed | The current test tree will be executed after its dependencies finish, and only if all of the dependencies succeed.
AllFinish | The current test tree will be executed after its dependencies finish, regardless of whether they succeed or not.

#### Instances

Instances details

Show DependencyType |
Instance details Defined in Test.Tasty.Core Methods showsPrec :: Int -> DependencyType -> ShowS Source # show :: DependencyType -> String Source # showList :: [DependencyType] -> ShowS Source #
Eq DependencyType |
Instance details Defined in Test.Tasty.Core Methods (==) :: DependencyType -> DependencyType -> Bool Source # (/=) :: DependencyType -> DependencyType -> Bool Source #

type TestName = String Source #

The name of a test or a group of tests

type RegexError = String Source #

An error message arising during a regular expression operation. Eg: trying to compile a malformed regular expression, or trying to apply a malformed replacement pattern.

type Replacement = String Source #

A replacement pattern. May include numeric backreferences (N).

data Regexp Source #

Regular expression. Extended regular expression-ish syntax ? But does not support eg (?i) syntax.

#### Instances

Instances details

ToJSON Regexp |
Instance details Defined in Hledger.Utils.Regex Methods toJSON :: Regexp -> Value Source # toEncoding :: Regexp -> Encoding Source # toJSONList :: [Regexp] -> Value Source # toEncodingList :: [Regexp] -> Encoding Source #
Read Regexp |
Instance details Defined in Hledger.Utils.Regex Methods readsPrec :: Int -> ReadS Regexp Source # readList :: ReadS [Regexp] Source # readPrec :: ReadPrec Regexp Source # readListPrec :: ReadPrec [Regexp] Source #
Show Regexp |
Instance details Defined in Hledger.Utils.Regex Methods showsPrec :: Int -> Regexp -> ShowS Source # show :: Regexp -> String Source # showList :: [Regexp] -> ShowS Source #
Eq Regexp |
Instance details Defined in Hledger.Utils.Regex Methods (==) :: Regexp -> Regexp -> Bool Source # (/=) :: Regexp -> Regexp -> Bool Source #
Ord Regexp |
Instance details Defined in Hledger.Utils.Regex Methods compare :: Regexp -> Regexp -> Ordering Source # (<) :: Regexp -> Regexp -> Bool Source # (<=) :: Regexp -> Regexp -> Bool Source # (>) :: Regexp -> Regexp -> Bool Source # (>=) :: Regexp -> Regexp -> Bool Source # max :: Regexp -> Regexp -> Regexp Source # min :: Regexp -> Regexp -> Regexp Source #
RegexLike Regexp String |
Instance details Defined in Hledger.Utils.Regex Methods matchOnce :: Regexp -> String -> Maybe MatchArray matchAll :: Regexp -> String -> [MatchArray] matchCount :: Regexp -> String -> Int matchTest :: Regexp -> String -> Bool matchAllText :: Regexp -> String -> [MatchText String] matchOnceText :: Regexp -> String -> Maybe (String, MatchText String, String)
RegexContext Regexp String String |
Instance details Defined in Hledger.Utils.Regex Methods match :: Regexp -> String -> String matchM :: MonadFail m => Regexp -> String -> m String

data Ledger Source #

A Ledger has the journal it derives from, and the accounts derived from that. Accounts are accessible both list-wise and tree-wise, since each one knows its parent and subs; the first account is the root of the tree and always exists.

Constructors

Ledger |

Fields

- ljournal :: Journal
- laccounts :: [Account]

#### Instances

Instances details

Generic Ledger |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Ledger :: Type -> Type Source # Methods from :: Ledger -> Rep Ledger x Source # to :: Rep Ledger x -> Ledger Source #
type Rep Ledger |

Instance details

Defined in Hledger.Data.Types

type Rep Ledger = D1 ('MetaData "Ledger" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Ledger" 'PrefixI 'True) (S1 ('MetaSel ('Just "ljournal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Journal) :*: S1 ('MetaSel ('Just "laccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Account])))

data NormalSign Source #

Whether an account's balance is normally a positive number (in accounting terms, a debit balance) or a negative number (credit balance). Assets and expenses are normally positive (debit), while liabilities, equity and income are normally negative (credit). https://en.wikipedia.org/wiki/Normal_balance

Constructors

NormallyPositive |
NormallyNegative |

#### Instances

Instances details

Show NormalSign |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> NormalSign -> ShowS Source # show :: NormalSign -> String Source # showList :: [NormalSign] -> ShowS Source #
Eq NormalSign |
Instance details Defined in Hledger.Data.Types Methods (==) :: NormalSign -> NormalSign -> Bool Source # (/=) :: NormalSign -> NormalSign -> Bool Source #

data Account Source #

An account, with its balances, parent/subaccount relationships, etc. Only the name is required; the other fields are added when needed.

Constructors

Account |

Fields

- aname :: AccountName

  this account's full name

- adeclarationinfo :: Maybe AccountDeclarationInfo

  optional extra info from account directives relationships in the tree

- asubs :: [Account]

  this account's sub-accounts

- aparent :: Maybe Account

  parent account

- aboring :: Bool

  used in the accounts report to label elidable parents balance information

- anumpostings :: Int

  the number of postings to this account

- aebalance :: MixedAmount

  this account's balance, excluding subaccounts

- aibalance :: MixedAmount

  this account's balance, including subaccounts

#### Instances

Instances details

Generic Account |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Account :: Type -> Type Source # Methods from :: Account -> Rep Account x Source # to :: Rep Account x -> Account Source #
type Rep Account |

Instance details

Defined in Hledger.Data.Types

type Rep Account = D1 ('MetaData "Account" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Account" 'PrefixI 'True) (((S1 ('MetaSel ('Just "aname") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "adeclarationinfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AccountDeclarationInfo))) :*: (S1 ('MetaSel ('Just "asubs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Account]) :*: S1 ('MetaSel ('Just "aparent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Account)))) :*: ((S1 ('MetaSel ('Just "aboring") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "anumpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "aebalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MixedAmount) :*: S1 ('MetaSel ('Just "aibalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MixedAmount)))))

data AccountDeclarationInfo Source #

Extra information about an account that can be derived from its account directive (and the other account directives).

Constructors

AccountDeclarationInfo |

Fields

- adicomment :: Text

  any comment lines following an account directive for this account

- aditags :: [Tag]

  tags extracted from the account comment, if any

- adideclarationorder :: Int

  the order in which this account was declared, relative to other account declarations, during parsing (1..)

- adisourcepos :: SourcePos

  source file and position

#### Instances

Instances details

Generic AccountDeclarationInfo |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AccountDeclarationInfo :: Type -> Type Source # Methods from :: AccountDeclarationInfo -> Rep AccountDeclarationInfo x Source # to :: Rep AccountDeclarationInfo x -> AccountDeclarationInfo Source #
Show AccountDeclarationInfo |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountDeclarationInfo -> ShowS Source # show :: AccountDeclarationInfo -> String Source # showList :: [AccountDeclarationInfo] -> ShowS Source #
Eq AccountDeclarationInfo |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool Source # (/=) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool Source #
type Rep AccountDeclarationInfo |

Instance details

Defined in Hledger.Data.Types

type Rep AccountDeclarationInfo = D1 ('MetaData "AccountDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "AccountDeclarationInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "adicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "aditags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag])) :*: (S1 ('MetaSel ('Just "adideclarationorder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "adisourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos))))

newtype TagDeclarationInfo Source #

Extra information found in a tag directive.

Constructors

TagDeclarationInfo |

Fields

- tdicomment :: Text

  any comment lines following the tag directive. No tags allowed here.

#### Instances

Instances details

Generic TagDeclarationInfo |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TagDeclarationInfo :: Type -> Type Source # Methods from :: TagDeclarationInfo -> Rep TagDeclarationInfo x Source # to :: Rep TagDeclarationInfo x -> TagDeclarationInfo Source #
Show TagDeclarationInfo |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TagDeclarationInfo -> ShowS Source # show :: TagDeclarationInfo -> String Source # showList :: [TagDeclarationInfo] -> ShowS Source #
Eq TagDeclarationInfo |
Instance details Defined in Hledger.Data.Types Methods (==) :: TagDeclarationInfo -> TagDeclarationInfo -> Bool Source # (/=) :: TagDeclarationInfo -> TagDeclarationInfo -> Bool Source #
type Rep TagDeclarationInfo |
Instance details Defined in Hledger.Data.Types type Rep TagDeclarationInfo = D1 ('MetaData "TagDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'True) (C1 ('MetaCons "TagDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "tdicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data PayeeDeclarationInfo Source #

Extra information found in a payee directive.

Constructors

PayeeDeclarationInfo |

Fields

- pdicomment :: Text

  any comment lines following the payee directive

- pditags :: [Tag]

  tags extracted from the comment, if any

#### Instances

Instances details

Generic PayeeDeclarationInfo |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PayeeDeclarationInfo :: Type -> Type Source # Methods from :: PayeeDeclarationInfo -> Rep PayeeDeclarationInfo x Source # to :: Rep PayeeDeclarationInfo x -> PayeeDeclarationInfo Source #
Show PayeeDeclarationInfo |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PayeeDeclarationInfo -> ShowS Source # show :: PayeeDeclarationInfo -> String Source # showList :: [PayeeDeclarationInfo] -> ShowS Source #
Eq PayeeDeclarationInfo |
Instance details Defined in Hledger.Data.Types Methods (==) :: PayeeDeclarationInfo -> PayeeDeclarationInfo -> Bool Source # (/=) :: PayeeDeclarationInfo -> PayeeDeclarationInfo -> Bool Source #
type Rep PayeeDeclarationInfo |

Instance details

Defined in Hledger.Data.Types

type Rep PayeeDeclarationInfo = D1 ('MetaData "PayeeDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "PayeeDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "pdicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "pditags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag])))

type StorageFormat = String Source #

The id of a data format understood by hledger, eg `journal` or `csv`. The --output-format option selects one of these for output.

type ParsedJournal = Journal Source #

A journal in the process of being parsed, not yet finalised. The data is partial, and list fields are in reverse order.

data Journal Source #

A Journal, containing transactions and various other things. The basic data model for hledger.

This is used during parsing (as the type alias ParsedJournal), and then finalised/validated for use as a Journal. Some extra parsing-related fields are included for convenience, at least for now. In a ParsedJournal these are updated as parsing proceeds, in a Journal they represent the final state at end of parsing (used eg by the add command).

Constructors

Journal |

Fields

- jparsedefaultyear :: Maybe Year

  the current default year, specified by the most recent Y directive (or current date)

- jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)

  the current default commodity and its format, specified by the most recent D directive

- jparsedecimalmark :: Maybe DecimalMark

  the character to always parse as decimal point, if set by CsvReader's decimal-mark (or a future journal directive)

- jparseparentaccounts :: [AccountName]

  the current stack of parent account names, specified by apply account directives

- jparsealiases :: [AccountAlias]

  the current account name aliases in effect, specified by alias directives (& options ?) ,jparsetransactioncount :: Integer -- ^ the current count of transactions parsed so far (only journal format txns, currently)

- jparsetimeclockentries :: [TimeclockEntry]

  timeclock sessions which have not been clocked out

- jincludefilestack :: [FilePath]
- jdeclaredpayees :: [(Payee, PayeeDeclarationInfo)]

  Payees declared by payee directives, in parse order (after journal finalisation)

- jdeclaredtags :: [(TagName, TagDeclarationInfo)]

  Tags declared by tag directives, in parse order (after journal finalisation)

- jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]

  Accounts declared by account directives, in parse order (after journal finalisation)

- jdeclaredaccounttags :: Map AccountName [Tag]

  Accounts which have tags declared in their directives, and those tags. (Does not include parents' tags.)

- jdeclaredaccounttypes :: Map AccountType [AccountName]

  Accounts whose type has been explicitly declared in their account directives, grouped by type.

- jaccounttypes :: Map AccountName AccountType

  All accounts for which a type has been declared or can be inferred from its parent or its name.

- jglobalcommoditystyles :: Map CommoditySymbol AmountStyle

  per-commodity display styles declared globally, eg by command line option or import command

- jcommodities :: Map CommoditySymbol Commodity

  commodities and formats declared by commodity directives

- jinferredcommodities :: Map CommoditySymbol AmountStyle

  commodities and formats inferred from journal amounts

- jpricedirectives :: [PriceDirective]

  Declarations of market prices by P directives, in parse order (after journal finalisation)

- jinferredmarketprices :: [MarketPrice]

  Market prices implied by transactions, in parse order (after journal finalisation)

- jtxnmodifiers :: [TransactionModifier]
- jperiodictxns :: [PeriodicTransaction]
- jtxns :: [Transaction]
- jfinalcommentlines :: Text

  any final trailing comments in the (main) journal file

- jfiles :: [(FilePath, Text)]

  the file path and raw text of the main and any included journal files. The main file is first, followed by any included files in the order encountered. TODO: FilePath is a sloppy type here, don't assume it's a real file; values like "", "-", "(string)" can be seen

- jlastreadtime :: POSIXTime

  when this journal was last read from its file(s) NOTE: after adding new fields, eg involving account names, consider updating the Anon instance in Hleger.Cli.Anon

#### Instances

Instances details

Generic Journal |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Journal :: Type -> Type Source # Methods from :: Journal -> Rep Journal x Source # to :: Rep Journal x -> Journal Source #
Eq Journal |
Instance details Defined in Hledger.Data.Types Methods (==) :: Journal -> Journal -> Bool Source # (/=) :: Journal -> Journal -> Bool Source #
Anon Journal Source # |
Instance details Defined in Hledger.Cli.Anon Methods anon :: Journal -> Journal Source #
type Rep Journal |

Instance details

Defined in Hledger.Data.Types

type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Journal" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "jparsedefaultyear") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Year)) :*: (S1 ('MetaSel ('Just "jparsedefaultcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (CommoditySymbol, AmountStyle))) :*: S1 ('MetaSel ('Just "jparsedecimalmark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DecimalMark)))) :*: (S1 ('MetaSel ('Just "jparseparentaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AccountName]) :*: (S1 ('MetaSel ('Just "jparsealiases") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AccountAlias]) :*: S1 ('MetaSel ('Just "jparsetimeclockentries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TimeclockEntry])))) :*: ((S1 ('MetaSel ('Just "jincludefilestack") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]) :*: (S1 ('MetaSel ('Just "jdeclaredpayees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Payee, PayeeDeclarationInfo)]) :*: S1 ('MetaSel ('Just "jdeclaredtags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(TagName, TagDeclarationInfo)]))) :*: (S1 ('MetaSel ('Just "jdeclaredaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(AccountName, AccountDeclarationInfo)]) :*: (S1 ('MetaSel ('Just "jdeclaredaccounttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountName [Tag])) :*: S1 ('MetaSel ('Just "jdeclaredaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountType [AccountName])))))) :*: (((S1 ('MetaSel ('Just "jaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountName AccountType)) :*: (S1 ('MetaSel ('Just "jglobalcommoditystyles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol AmountStyle)) :*: S1 ('MetaSel ('Just "jcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol Commodity)))) :*: (S1 ('MetaSel ('Just "jinferredcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol AmountStyle)) :*: (S1 ('MetaSel ('Just "jpricedirectives") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PriceDirective]) :*: S1 ('MetaSel ('Just "jinferredmarketprices") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [MarketPrice])))) :*: ((S1 ('MetaSel ('Just "jtxnmodifiers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TransactionModifier]) :*: (S1 ('MetaSel ('Just "jperiodictxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PeriodicTransaction]) :*: S1 ('MetaSel ('Just "jtxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Transaction]))) :*: (S1 ('MetaSel ('Just "jfinalcommentlines") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "jfiles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(FilePath, Text)]) :*: S1 ('MetaSel ('Just "jlastreadtime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime)))))))

data MarketPrice Source #

A historical market price (exchange rate) from one commodity to another. A more concise form of a PriceDirective, without the amount display info.

Constructors

MarketPrice |

Fields

- mpdate :: Day

  Date on which this price becomes effective.

- mpfrom :: CommoditySymbol

  The commodity being converted from.

- mpto :: CommoditySymbol

  The commodity being converted to.

- mprate :: Quantity

  One unit of the "from" commodity is worth this quantity of the "to" commodity.

#### Instances

Instances details

Generic MarketPrice |
Instance details Defined in Hledger.Data.Types Associated Types type Rep MarketPrice :: Type -> Type Source # Methods from :: MarketPrice -> Rep MarketPrice x Source # to :: Rep MarketPrice x -> MarketPrice Source #
Show MarketPrice |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> MarketPrice -> ShowS Source # show :: MarketPrice -> String Source # showList :: [MarketPrice] -> ShowS Source #
Eq MarketPrice |
Instance details Defined in Hledger.Data.Types Methods (==) :: MarketPrice -> MarketPrice -> Bool Source # (/=) :: MarketPrice -> MarketPrice -> Bool Source #
Ord MarketPrice |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MarketPrice -> MarketPrice -> Ordering Source #

(<) :: MarketPrice -> MarketPrice -> Bool Source #

(<=) :: MarketPrice -> MarketPrice -> Bool Source #

(>) :: MarketPrice -> MarketPrice -> Bool Source #

(>=) :: MarketPrice -> MarketPrice -> Bool Source #

max :: MarketPrice -> MarketPrice -> MarketPrice Source #

min :: MarketPrice -> MarketPrice -> MarketPrice Source #

type Rep MarketPrice |

Instance details

Defined in Hledger.Data.Types

type Rep MarketPrice = D1 ('MetaData "MarketPrice" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "MarketPrice" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just "mpfrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol)) :*: (S1 ('MetaSel ('Just "mpto") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "mprate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Quantity))))

data PriceDirective Source #

A market price declaration made by the journal format's P directive. It declares two things: a historical exchange rate between two commodities, and an amount display style for the second commodity.

Constructors

PriceDirective |

Fields

- pddate :: Day
- pdcommodity :: CommoditySymbol
- pdamount :: Amount

#### Instances

Instances details

Generic PriceDirective |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PriceDirective :: Type -> Type Source # Methods from :: PriceDirective -> Rep PriceDirective x Source # to :: Rep PriceDirective x -> PriceDirective Source #
Show PriceDirective |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PriceDirective -> ShowS Source # show :: PriceDirective -> String Source # showList :: [PriceDirective] -> ShowS Source #
Eq PriceDirective |
Instance details Defined in Hledger.Data.Types Methods (==) :: PriceDirective -> PriceDirective -> Bool Source # (/=) :: PriceDirective -> PriceDirective -> Bool Source #
Ord PriceDirective |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: PriceDirective -> PriceDirective -> Ordering Source #

(<) :: PriceDirective -> PriceDirective -> Bool Source #

(<=) :: PriceDirective -> PriceDirective -> Bool Source #

(>) :: PriceDirective -> PriceDirective -> Bool Source #

(>=) :: PriceDirective -> PriceDirective -> Bool Source #

max :: PriceDirective -> PriceDirective -> PriceDirective Source #

min :: PriceDirective -> PriceDirective -> PriceDirective Source #

type Rep PriceDirective |

Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "PriceDirective" 'PrefixI 'True) (S1 ('MetaSel ('Just "pddate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: (S1 ('MetaSel ('Just "pdcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "pdamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount))))

data TimeclockEntry Source #

Constructors

TimeclockEntry |

Fields

- tlsourcepos :: SourcePos
- tlcode :: TimeclockCode
- tldatetime :: LocalTime
- tlaccount :: AccountName
- tldescription :: Text
- tlcomment :: Text
- tltags :: [Tag]

#### Instances

Instances details

Generic TimeclockEntry |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TimeclockEntry :: Type -> Type Source # Methods from :: TimeclockEntry -> Rep TimeclockEntry x Source # to :: Rep TimeclockEntry x -> TimeclockEntry Source #
Eq TimeclockEntry |
Instance details Defined in Hledger.Data.Types Methods (==) :: TimeclockEntry -> TimeclockEntry -> Bool Source # (/=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #
Ord TimeclockEntry |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockEntry -> TimeclockEntry -> Ordering Source #

(<) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(<=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

max :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

min :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

type Rep TimeclockEntry |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockEntry = D1 ('MetaData "TimeclockEntry" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "TimeclockEntry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tlsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos) :*: (S1 ('MetaSel ('Just "tlcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TimeclockCode) :*: S1 ('MetaSel ('Just "tldatetime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalTime))) :*: ((S1 ('MetaSel ('Just "tlaccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "tldescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tlcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tltags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag])))))

data TimeclockCode Source #

Constructors

SetBalance |
SetRequiredHours |
In |
Out |
FinalOut |

#### Instances

Instances details

Generic TimeclockCode |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TimeclockCode :: Type -> Type Source # Methods from :: TimeclockCode -> Rep TimeclockCode x Source # to :: Rep TimeclockCode x -> TimeclockCode Source #
Eq TimeclockCode |
Instance details Defined in Hledger.Data.Types Methods (==) :: TimeclockCode -> TimeclockCode -> Bool Source # (/=) :: TimeclockCode -> TimeclockCode -> Bool Source #
Ord TimeclockCode |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockCode -> TimeclockCode -> Ordering Source #

(<) :: TimeclockCode -> TimeclockCode -> Bool Source #

(<=) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>=) :: TimeclockCode -> TimeclockCode -> Bool Source #

max :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

min :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

type Rep TimeclockCode |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) ((C1 ('MetaCons "SetBalance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetRequiredHours" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "In" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Out" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FinalOut" 'PrefixI 'False) (U1 :: Type -> Type))))

data PeriodicTransaction Source #

A periodic transaction rule, describing a transaction that recurs.

Constructors

PeriodicTransaction |

Fields

- ptperiodexpr :: Text

  the period expression as written

- ptinterval :: Interval

  the interval at which this transaction recurs

- ptspan :: DateSpan

  the (possibly unbounded) period during which this transaction recurs. Contains a whole number of intervals.

- ptsourcepos :: (SourcePos, SourcePos)

  the file position where the period expression starts, and where the last posting ends

- ptstatus :: Status

  some of Transaction's fields

- ptcode :: Text
- ptdescription :: Text
- ptcomment :: Text
- pttags :: [Tag]
- ptpostings :: [Posting]

#### Instances

Instances details

Generic PeriodicTransaction |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PeriodicTransaction :: Type -> Type Source # Methods from :: PeriodicTransaction -> Rep PeriodicTransaction x Source # to :: Rep PeriodicTransaction x -> PeriodicTransaction Source #
Eq PeriodicTransaction |
Instance details Defined in Hledger.Data.Types Methods (==) :: PeriodicTransaction -> PeriodicTransaction -> Bool Source # (/=) :: PeriodicTransaction -> PeriodicTransaction -> Bool Source #
type Rep PeriodicTransaction |

Instance details

Defined in Hledger.Data.Types

type Rep PeriodicTransaction = D1 ('MetaData "PeriodicTransaction" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "PeriodicTransaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "ptperiodexpr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptinterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Interval)) :*: (S1 ('MetaSel ('Just "ptspan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DateSpan) :*: (S1 ('MetaSel ('Just "ptsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SourcePos, SourcePos)) :*: S1 ('MetaSel ('Just "ptstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status)))) :*: ((S1 ('MetaSel ('Just "ptcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "ptcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "pttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "ptpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Posting]))))))

data TMPostingRule Source #

A transaction modifier transformation, which adds an extra posting to the matched posting's transaction. Can be like a regular posting, or can have the tmprIsMultiplier flag set, indicating that it's a multiplier for the matched posting's amount.

Constructors

TMPostingRule |

Fields

- tmprPosting :: Posting
- tmprIsMultiplier :: Bool

#### Instances

Instances details

Generic TMPostingRule |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TMPostingRule :: Type -> Type Source # Methods from :: TMPostingRule -> Rep TMPostingRule x Source # to :: Rep TMPostingRule x -> TMPostingRule Source #
Show TMPostingRule |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TMPostingRule -> ShowS Source # show :: TMPostingRule -> String Source # showList :: [TMPostingRule] -> ShowS Source #
Eq TMPostingRule |
Instance details Defined in Hledger.Data.Types Methods (==) :: TMPostingRule -> TMPostingRule -> Bool Source # (/=) :: TMPostingRule -> TMPostingRule -> Bool Source #
type Rep TMPostingRule |

Instance details

Defined in Hledger.Data.Types

type Rep TMPostingRule = D1 ('MetaData "TMPostingRule" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "TMPostingRule" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmprPosting") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Posting) :*: S1 ('MetaSel ('Just "tmprIsMultiplier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

data TransactionModifier Source #

A transaction modifier rule. This has a query which matches postings in the journal, and a list of transformations to apply to those postings or their transactions. Currently there is one kind of transformation: the TMPostingRule, which adds a posting ("auto posting") to the transaction, optionally setting its amount to the matched posting's amount multiplied by a constant.

Constructors

TransactionModifier |

Fields

- tmquerytxt :: Text
- tmpostingrules :: [TMPostingRule]

#### Instances

Instances details

Generic TransactionModifier |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TransactionModifier :: Type -> Type Source # Methods from :: TransactionModifier -> Rep TransactionModifier x Source # to :: Rep TransactionModifier x -> TransactionModifier Source #
Show TransactionModifier |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TransactionModifier -> ShowS Source # show :: TransactionModifier -> String Source # showList :: [TransactionModifier] -> ShowS Source #
Eq TransactionModifier |
Instance details Defined in Hledger.Data.Types Methods (==) :: TransactionModifier -> TransactionModifier -> Bool Source # (/=) :: TransactionModifier -> TransactionModifier -> Bool Source #
type Rep TransactionModifier |

Instance details

Defined in Hledger.Data.Types

type Rep TransactionModifier = D1 ('MetaData "TransactionModifier" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "TransactionModifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmquerytxt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tmpostingrules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TMPostingRule])))

data Transaction Source #

Constructors

Transaction |

Fields

- tindex :: Integer

  this transaction's 1-based position in the transaction stream, or 0 when not available

- tprecedingcomment :: Text

  any comment lines immediately preceding this transaction

- tsourcepos :: (SourcePos, SourcePos)

  the file position where the date starts, and where the last posting ends

- tdate :: Day
- tdate2 :: Maybe Day
- tstatus :: Status
- tcode :: Text
- tdescription :: Text
- tcomment :: Text

  this transaction's comment lines, as a single non-indented multi-line string

- ttags :: [Tag]

  tag names and values, extracted from the comment

- tpostings :: [Posting]

  this transaction's postings

#### Instances

Instances details

Generic Transaction |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Transaction :: Type -> Type Source # Methods from :: Transaction -> Rep Transaction x Source # to :: Rep Transaction x -> Transaction Source #
Show Transaction |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Transaction -> ShowS Source # show :: Transaction -> String Source # showList :: [Transaction] -> ShowS Source #
Eq Transaction |
Instance details Defined in Hledger.Data.Types Methods (==) :: Transaction -> Transaction -> Bool Source # (/=) :: Transaction -> Transaction -> Bool Source #
Anon Transaction Source # |
Instance details Defined in Hledger.Cli.Anon Methods anon :: Transaction -> Transaction Source #
type Rep Transaction |

Instance details

Defined in Hledger.Data.Types

type Rep Transaction = D1 ('MetaData "Transaction" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Transaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "tindex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "tprecedingcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SourcePos, SourcePos)) :*: (S1 ('MetaSel ('Just "tdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just "tdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day))))) :*: ((S1 ('MetaSel ('Just "tstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status) :*: (S1 ('MetaSel ('Just "tcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "tcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "tpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Posting]))))))

data Posting Source #

Constructors

Posting |

Fields

- pdate :: Maybe Day

  this posting's date, if different from the transaction's

- pdate2 :: Maybe Day

  this posting's secondary date, if different from the transaction's

- pstatus :: Status
- paccount :: AccountName
- pamount :: MixedAmount
- pcomment :: Text

  this posting's comment lines, as a single non-indented multi-line string

- ptype :: PostingType
- ptags :: [Tag]

  tag names and values, extracted from the posting comment and (after finalisation) the posting account's directive if any

- pbalanceassertion :: Maybe BalanceAssertion

  an expected balance in the account after this posting, in a single commodity, excluding subaccounts.

- ptransaction :: Maybe Transaction

  this posting's parent transaction (co-recursive types). Tying this knot gets tedious, Maybe makes it easier/optional.

- poriginal :: Maybe Posting

  When this posting has been transformed in some way (eg its amount or price was inferred, or the account name was changed by a pivot or budget report), this references the original untransformed posting (which will have Nothing in this field).

#### Instances

Instances details

Generic Posting |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Posting :: Type -> Type Source # Methods from :: Posting -> Rep Posting x Source # to :: Rep Posting x -> Posting Source #
Show Posting | Posting's show instance elides the parent transaction so as not to recurse forever.
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Posting -> ShowS Source # show :: Posting -> String Source # showList :: [Posting] -> ShowS Source #
Eq Posting |
Instance details Defined in Hledger.Data.Types Methods (==) :: Posting -> Posting -> Bool Source # (/=) :: Posting -> Posting -> Bool Source #
Anon Posting Source # |
Instance details Defined in Hledger.Cli.Anon Methods anon :: Posting -> Posting Source #
type Rep Posting |

Instance details

Defined in Hledger.Data.Types

type Rep Posting = D1 ('MetaData "Posting" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Posting" 'PrefixI 'True) (((S1 ('MetaSel ('Just "pdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Just "pdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day))) :*: (S1 ('MetaSel ('Just "pstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status) :*: (S1 ('MetaSel ('Just "paccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "pamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MixedAmount)))) :*: ((S1 ('MetaSel ('Just "pcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ptype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PostingType) :*: S1 ('MetaSel ('Just "ptags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]))) :*: (S1 ('MetaSel ('Just "pbalanceassertion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe BalanceAssertion)) :*: (S1 ('MetaSel ('Just "ptransaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Transaction)) :*: S1 ('MetaSel ('Just "poriginal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Posting)))))))

data BalanceAssertion Source #

A balance assertion is a declaration about an account's expected balance at a certain point (posting date and parse order). They provide additional error checking and readability to a journal file.

A balance assignments is an instruction to hledger to adjust an account's balance to a certain amount at a certain point.

The `BalanceAssertion` type is used for representing both of these.

hledger supports multiple kinds of balance assertions/assignments, which differ in whether they refer to a single commodity or all commodities, and the (subaccount-)inclusive or exclusive account balance.

Constructors

BalanceAssertion |

Fields

- baamount :: Amount

  the expected balance in a particular commodity

- batotal :: Bool

  disallow additional non-asserted commodities ?

- bainclusive :: Bool

  include subaccounts when calculating the actual balance ?

- baposition :: SourcePos

  the assertion's file position, for error reporting

#### Instances

Instances details

Generic BalanceAssertion |
Instance details Defined in Hledger.Data.Types Associated Types type Rep BalanceAssertion :: Type -> Type Source # Methods from :: BalanceAssertion -> Rep BalanceAssertion x Source # to :: Rep BalanceAssertion x -> BalanceAssertion Source #
Show BalanceAssertion |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> BalanceAssertion -> ShowS Source # show :: BalanceAssertion -> String Source # showList :: [BalanceAssertion] -> ShowS Source #
Eq BalanceAssertion |
Instance details Defined in Hledger.Data.Types Methods (==) :: BalanceAssertion -> BalanceAssertion -> Bool Source # (/=) :: BalanceAssertion -> BalanceAssertion -> Bool Source #
type Rep BalanceAssertion |

Instance details

Defined in Hledger.Data.Types

type Rep BalanceAssertion = D1 ('MetaData "BalanceAssertion" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "BalanceAssertion" 'PrefixI 'True) ((S1 ('MetaSel ('Just "baamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount) :*: S1 ('MetaSel ('Just "batotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "bainclusive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "baposition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos))))

data Status Source #

The status of a transaction or posting, recorded with a status mark (nothing, !, or *). What these mean is ultimately user defined.

Constructors

Unmarked |
Pending |
Cleared |

#### Instances

Instances details

Bounded Status |
Instance details Defined in Hledger.Data.Types Methods minBound :: Status Source # maxBound :: Status Source #
Enum Status |

Instance details

Defined in Hledger.Data.Types

Methods

succ :: Status -> Status Source #

pred :: Status -> Status Source #

toEnum :: Int -> Status Source #

fromEnum :: Status -> Int Source #

enumFrom :: Status -> [Status] Source #

enumFromThen :: Status -> Status -> [Status] Source #

enumFromTo :: Status -> Status -> [Status] Source #

enumFromThenTo :: Status -> Status -> Status -> [Status] Source #

Generic Status |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Status :: Type -> Type Source # Methods from :: Status -> Rep Status x Source # to :: Rep Status x -> Status Source #
Show Status |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Status -> ShowS Source # show :: Status -> String Source # showList :: [Status] -> ShowS Source #
Eq Status |
Instance details Defined in Hledger.Data.Types Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #
Ord Status |
Instance details Defined in Hledger.Data.Types Methods compare :: Status -> Status -> Ordering Source # (<) :: Status -> Status -> Bool Source # (<=) :: Status -> Status -> Bool Source # (>) :: Status -> Status -> Bool Source # (>=) :: Status -> Status -> Bool Source # max :: Status -> Status -> Status Source # min :: Status -> Status -> Status Source #
type Rep Status |
Instance details Defined in Hledger.Data.Types type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Unmarked" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Pending" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cleared" 'PrefixI 'False) (U1 :: Type -> Type)))

type DateTag = (TagName, Day) Source #

type Tag Source #

Arguments

= (TagName, TagValue) | A tag name and (possibly empty) value.

type TagValue = Text Source #

type TagName = Text Source #

data PostingType Source #

Constructors

RegularPosting |
VirtualPosting |
BalancedVirtualPosting |

#### Instances

Instances details

Generic PostingType |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PostingType :: Type -> Type Source # Methods from :: PostingType -> Rep PostingType x Source # to :: Rep PostingType x -> PostingType Source #
Show PostingType |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PostingType -> ShowS Source # show :: PostingType -> String Source # showList :: [PostingType] -> ShowS Source #
Eq PostingType |
Instance details Defined in Hledger.Data.Types Methods (==) :: PostingType -> PostingType -> Bool Source # (/=) :: PostingType -> PostingType -> Bool Source #
type Rep PostingType |
Instance details Defined in Hledger.Data.Types type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "RegularPosting" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "VirtualPosting" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BalancedVirtualPosting" 'PrefixI 'False) (U1 :: Type -> Type)))

data MixedAmount Source #

#### Instances

Instances details

Generic MixedAmount |
Instance details Defined in Hledger.Data.Types Associated Types type Rep MixedAmount :: Type -> Type Source # Methods from :: MixedAmount -> Rep MixedAmount x Source # to :: Rep MixedAmount x -> MixedAmount Source #
Show MixedAmount |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> MixedAmount -> ShowS Source # show :: MixedAmount -> String Source # showList :: [MixedAmount] -> ShowS Source #
Eq MixedAmount |
Instance details Defined in Hledger.Data.Types Methods (==) :: MixedAmount -> MixedAmount -> Bool Source # (/=) :: MixedAmount -> MixedAmount -> Bool Source #
Ord MixedAmount |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MixedAmount -> MixedAmount -> Ordering Source #

(<) :: MixedAmount -> MixedAmount -> Bool Source #

(<=) :: MixedAmount -> MixedAmount -> Bool Source #

(>) :: MixedAmount -> MixedAmount -> Bool Source #

(>=) :: MixedAmount -> MixedAmount -> Bool Source #

max :: MixedAmount -> MixedAmount -> MixedAmount Source #

min :: MixedAmount -> MixedAmount -> MixedAmount Source #

type Rep MixedAmount |
Instance details Defined in Hledger.Data.Types type Rep MixedAmount = D1 ('MetaData "MixedAmount" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'True) (C1 ('MetaCons "Mixed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map MixedAmountKey Amount))))

data Amount Source #

Constructors

Amount |

Fields

- acommodity :: !CommoditySymbol
- aquantity :: !Quantity
- astyle :: !AmountStyle
- aprice :: !(Maybe AmountPrice)

  the (fixed, transaction-specific) price for this amount, if any

#### Instances

Instances details

Generic Amount |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Amount :: Type -> Type Source # Methods from :: Amount -> Rep Amount x Source # to :: Rep Amount x -> Amount Source #
Show Amount |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Amount -> ShowS Source # show :: Amount -> String Source # showList :: [Amount] -> ShowS Source #
Eq Amount |
Instance details Defined in Hledger.Data.Types Methods (==) :: Amount -> Amount -> Bool Source # (/=) :: Amount -> Amount -> Bool Source #
Ord Amount |
Instance details Defined in Hledger.Data.Types Methods compare :: Amount -> Amount -> Ordering Source # (<) :: Amount -> Amount -> Bool Source # (<=) :: Amount -> Amount -> Bool Source # (>) :: Amount -> Amount -> Bool Source # (>=) :: Amount -> Amount -> Bool Source # max :: Amount -> Amount -> Amount Source # min :: Amount -> Amount -> Amount Source #
type Rep Amount |

Instance details

Defined in Hledger.Data.Types

type Rep Amount = D1 ('MetaData "Amount" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Amount" 'PrefixI 'True) ((S1 ('MetaSel ('Just "acommodity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "aquantity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity)) :*: (S1 ('MetaSel ('Just "astyle") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountStyle) :*: S1 ('MetaSel ('Just "aprice") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe AmountPrice)))))

data Commodity Source #

Constructors

Commodity |

Fields

- csymbol :: CommoditySymbol
- cformat :: Maybe AmountStyle

#### Instances

Instances details

Generic Commodity |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Commodity :: Type -> Type Source # Methods from :: Commodity -> Rep Commodity x Source # to :: Rep Commodity x -> Commodity Source #
Show Commodity |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Commodity -> ShowS Source # show :: Commodity -> String Source # showList :: [Commodity] -> ShowS Source #
Eq Commodity |
Instance details Defined in Hledger.Data.Types Methods (==) :: Commodity -> Commodity -> Bool Source # (/=) :: Commodity -> Commodity -> Bool Source #
type Rep Commodity |

Instance details

Defined in Hledger.Data.Types

type Rep Commodity = D1 ('MetaData "Commodity" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Commodity" 'PrefixI 'True) (S1 ('MetaSel ('Just "csymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "cformat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AmountStyle))))

type CommoditySymbol = Text Source #

data DigitGroupStyle Source #

A style for displaying digit groups in the integer part of a floating point number. It consists of the character used to separate groups (comma or period, whichever is not used as decimal point), and the size of each group, starting with the one nearest the decimal point. The last group size is assumed to repeat. Eg, comma between thousands is DigitGroups ',' [3].

Constructors

DigitGroups !Char ![Word8] |

#### Instances

Instances details

Generic DigitGroupStyle |
Instance details Defined in Hledger.Data.Types Associated Types type Rep DigitGroupStyle :: Type -> Type Source # Methods from :: DigitGroupStyle -> Rep DigitGroupStyle x Source # to :: Rep DigitGroupStyle x -> DigitGroupStyle Source #
Read DigitGroupStyle |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS DigitGroupStyle Source # readList :: ReadS [DigitGroupStyle] Source # readPrec :: ReadPrec DigitGroupStyle Source # readListPrec :: ReadPrec [DigitGroupStyle] Source #
Show DigitGroupStyle |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> DigitGroupStyle -> ShowS Source # show :: DigitGroupStyle -> String Source # showList :: [DigitGroupStyle] -> ShowS Source #
Eq DigitGroupStyle |
Instance details Defined in Hledger.Data.Types Methods (==) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source # (/=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #
Ord DigitGroupStyle |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: DigitGroupStyle -> DigitGroupStyle -> Ordering Source #

(<) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(<=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

max :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

min :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

type Rep DigitGroupStyle |

Instance details

Defined in Hledger.Data.Types

type Rep DigitGroupStyle = D1 ('MetaData "DigitGroupStyle" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "DigitGroups" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word8])))

data AmountPrecision Source #

The "display precision" for a hledger amount, by which we mean the number of decimal digits to display to the right of the decimal mark. This can be from 0 to 255 digits (the maximum supported by the Decimal library), or NaturalPrecision meaning "show all significant decimal digits".

Constructors

Precision !Word8 |
NaturalPrecision |

#### Instances

Instances details

Generic AmountPrecision |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AmountPrecision :: Type -> Type Source # Methods from :: AmountPrecision -> Rep AmountPrecision x Source # to :: Rep AmountPrecision x -> AmountPrecision Source #
Read AmountPrecision |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountPrecision Source # readList :: ReadS [AmountPrecision] Source # readPrec :: ReadPrec AmountPrecision Source # readListPrec :: ReadPrec [AmountPrecision] Source #
Show AmountPrecision |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountPrecision -> ShowS Source # show :: AmountPrecision -> String Source # showList :: [AmountPrecision] -> ShowS Source #
Eq AmountPrecision |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountPrecision -> AmountPrecision -> Bool Source # (/=) :: AmountPrecision -> AmountPrecision -> Bool Source #
Ord AmountPrecision |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrecision -> AmountPrecision -> Ordering Source #

(<) :: AmountPrecision -> AmountPrecision -> Bool Source #

(<=) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>=) :: AmountPrecision -> AmountPrecision -> Bool Source #

max :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

min :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

type Rep AmountPrecision |

Instance details

Defined in Hledger.Data.Types

type Rep AmountPrecision = D1 ('MetaData "AmountPrecision" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Precision" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8)) :+: C1 ('MetaCons "NaturalPrecision" 'PrefixI 'False) (U1 :: Type -> Type))

data AmountStyle Source #

Display style for an amount.

Constructors

AmountStyle |

Fields

- ascommodityside :: !Side

  does the symbol appear on the left or the right ?

- ascommodityspaced :: !Bool

  space between symbol and quantity ?

- asprecision :: !AmountPrecision

  number of digits displayed after the decimal point

- asdecimalpoint :: !(Maybe Char)

  character used as decimal point: period or comma. Nothing means "unspecified, use default"

- asdigitgroups :: !(Maybe DigitGroupStyle)

  style for displaying digit groups, if any

#### Instances

Instances details

Generic AmountStyle |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AmountStyle :: Type -> Type Source # Methods from :: AmountStyle -> Rep AmountStyle x Source # to :: Rep AmountStyle x -> AmountStyle Source #
Read AmountStyle |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountStyle Source # readList :: ReadS [AmountStyle] Source # readPrec :: ReadPrec AmountStyle Source # readListPrec :: ReadPrec [AmountStyle] Source #
Show AmountStyle |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountStyle -> ShowS Source # show :: AmountStyle -> String Source # showList :: [AmountStyle] -> ShowS Source #
Eq AmountStyle |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountStyle -> AmountStyle -> Bool Source # (/=) :: AmountStyle -> AmountStyle -> Bool Source #
Ord AmountStyle |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountStyle -> AmountStyle -> Ordering Source #

(<) :: AmountStyle -> AmountStyle -> Bool Source #

(<=) :: AmountStyle -> AmountStyle -> Bool Source #

(>) :: AmountStyle -> AmountStyle -> Bool Source #

(>=) :: AmountStyle -> AmountStyle -> Bool Source #

max :: AmountStyle -> AmountStyle -> AmountStyle Source #

min :: AmountStyle -> AmountStyle -> AmountStyle Source #

type Rep AmountStyle |

Instance details

Defined in Hledger.Data.Types

type Rep AmountStyle = D1 ('MetaData "AmountStyle" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "AmountStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ascommodityside") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Side) :*: S1 ('MetaSel ('Just "ascommodityspaced") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "asprecision") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountPrecision) :*: (S1 ('MetaSel ('Just "asdecimalpoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Char)) :*: S1 ('MetaSel ('Just "asdigitgroups") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe DigitGroupStyle))))))

data AmountPrice Source #

An amount's per-unit or total cost/selling price in another commodity, as recorded in the journal entry eg with `or` @. Cost, formerly AKA "transaction price". The amount is always positive.

Constructors

UnitPrice !Amount |
TotalPrice !Amount |

#### Instances

Instances details

Generic AmountPrice |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AmountPrice :: Type -> Type Source # Methods from :: AmountPrice -> Rep AmountPrice x Source # to :: Rep AmountPrice x -> AmountPrice Source #
Show AmountPrice |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountPrice -> ShowS Source # show :: AmountPrice -> String Source # showList :: [AmountPrice] -> ShowS Source #
Eq AmountPrice |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountPrice -> AmountPrice -> Bool Source # (/=) :: AmountPrice -> AmountPrice -> Bool Source #
Ord AmountPrice |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrice -> AmountPrice -> Ordering Source #

(<) :: AmountPrice -> AmountPrice -> Bool Source #

(<=) :: AmountPrice -> AmountPrice -> Bool Source #

(>) :: AmountPrice -> AmountPrice -> Bool Source #

(>=) :: AmountPrice -> AmountPrice -> Bool Source #

max :: AmountPrice -> AmountPrice -> AmountPrice Source #

min :: AmountPrice -> AmountPrice -> AmountPrice Source #

type Rep AmountPrice |

Instance details

Defined in Hledger.Data.Types

type Rep AmountPrice = D1 ('MetaData "AmountPrice" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "UnitPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Amount)) :+: C1 ('MetaCons "TotalPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Amount)))

type Quantity = Decimal Source #

The basic numeric type used in amounts.

type DecimalMark = Char Source #

One of the decimal marks we support: either period or comma.

data Side Source #

Constructors

L |
R |

#### Instances

Instances details

Generic Side |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Side :: Type -> Type Source # Methods from :: Side -> Rep Side x Source # to :: Rep Side x -> Side Source #
Read Side |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS Side Source # readList :: ReadS [Side] Source # readPrec :: ReadPrec Side Source # readListPrec :: ReadPrec [Side] Source #
Show Side |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Side -> ShowS Source # show :: Side -> String Source # showList :: [Side] -> ShowS Source #
Eq Side |
Instance details Defined in Hledger.Data.Types Methods (==) :: Side -> Side -> Bool Source # (/=) :: Side -> Side -> Bool Source #
Ord Side |
Instance details Defined in Hledger.Data.Types Methods compare :: Side -> Side -> Ordering Source # (<) :: Side -> Side -> Bool Source # (<=) :: Side -> Side -> Bool Source # (>) :: Side -> Side -> Bool Source # (>=) :: Side -> Side -> Bool Source # max :: Side -> Side -> Side Source # min :: Side -> Side -> Side Source #
type Rep Side |
Instance details Defined in Hledger.Data.Types type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R" 'PrefixI 'False) (U1 :: Type -> Type))

data AccountAlias Source #

Constructors

BasicAlias AccountName AccountName |
RegexAlias Regexp Replacement |

#### Instances

Instances details

Generic AccountAlias |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AccountAlias :: Type -> Type Source # Methods from :: AccountAlias -> Rep AccountAlias x Source # to :: Rep AccountAlias x -> AccountAlias Source #
Read AccountAlias |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AccountAlias Source # readList :: ReadS [AccountAlias] Source # readPrec :: ReadPrec AccountAlias Source # readListPrec :: ReadPrec [AccountAlias] Source #
Show AccountAlias |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountAlias -> ShowS Source # show :: AccountAlias -> String Source # showList :: [AccountAlias] -> ShowS Source #
Eq AccountAlias |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountAlias -> AccountAlias -> Bool Source # (/=) :: AccountAlias -> AccountAlias -> Bool Source #
Ord AccountAlias |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountAlias -> AccountAlias -> Ordering Source #

(<) :: AccountAlias -> AccountAlias -> Bool Source #

(<=) :: AccountAlias -> AccountAlias -> Bool Source #

(>) :: AccountAlias -> AccountAlias -> Bool Source #

(>=) :: AccountAlias -> AccountAlias -> Bool Source #

max :: AccountAlias -> AccountAlias -> AccountAlias Source #

min :: AccountAlias -> AccountAlias -> AccountAlias Source #

type Rep AccountAlias |

Instance details

Defined in Hledger.Data.Types

type Rep AccountAlias = D1 ('MetaData "AccountAlias" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "BasicAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName)) :+: C1 ('MetaCons "RegexAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Regexp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Replacement)))

data AccountType Source #

Constructors

Asset |
Liability |
Equity |
Revenue |
Expense |
Cash | a subtype of Asset - liquid assets to show in cashflow report
Conversion | a subtype of Equity - account in which to generate conversion postings for transaction prices

#### Instances

Instances details

Generic AccountType |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AccountType :: Type -> Type Source # Methods from :: AccountType -> Rep AccountType x Source # to :: Rep AccountType x -> AccountType Source #
Show AccountType |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountType -> ShowS Source # show :: AccountType -> String Source # showList :: [AccountType] -> ShowS Source #
Eq AccountType |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountType -> AccountType -> Bool Source # (/=) :: AccountType -> AccountType -> Bool Source #
Ord AccountType |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountType -> AccountType -> Ordering Source #

(<) :: AccountType -> AccountType -> Bool Source #

(<=) :: AccountType -> AccountType -> Bool Source #

(>) :: AccountType -> AccountType -> Bool Source #

(>=) :: AccountType -> AccountType -> Bool Source #

max :: AccountType -> AccountType -> AccountType Source #

min :: AccountType -> AccountType -> AccountType Source #

type Rep AccountType |

Instance details

Defined in Hledger.Data.Types

type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) ((C1 ('MetaCons "Asset" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Liability" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Equity" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Revenue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Expense" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Conversion" 'PrefixI 'False) (U1 :: Type -> Type))))

type AccountName = Text Source #

type Payee = Text Source #

data Interval Source #

Constructors

NoInterval |
Days Int |
Weeks Int |
Months Int |
Quarters Int |
Years Int |
DayOfMonth Int |
WeekdayOfMonth Int Int |
DaysOfWeek [Int] |
DayOfYear Int Int |

#### Instances

Instances details

Generic Interval |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Interval :: Type -> Type Source # Methods from :: Interval -> Rep Interval x Source # to :: Rep Interval x -> Interval Source #
Show Interval |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Interval -> ShowS Source # show :: Interval -> String Source # showList :: [Interval] -> ShowS Source #
Default Interval |
Instance details Defined in Hledger.Data.Types Methods def :: Interval #
Eq Interval |
Instance details Defined in Hledger.Data.Types Methods (==) :: Interval -> Interval -> Bool Source # (/=) :: Interval -> Interval -> Bool Source #
Ord Interval |
Instance details Defined in Hledger.Data.Types Methods compare :: Interval -> Interval -> Ordering Source # (<) :: Interval -> Interval -> Bool Source # (<=) :: Interval -> Interval -> Bool Source # (>) :: Interval -> Interval -> Bool Source # (>=) :: Interval -> Interval -> Bool Source # max :: Interval -> Interval -> Interval Source # min :: Interval -> Interval -> Interval Source #
type Rep Interval |

Instance details

Defined in Hledger.Data.Types

type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (((C1 ('MetaCons "NoInterval" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Days" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "Weeks" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "Months" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "Quarters" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))) :+: ((C1 ('MetaCons "Years" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "DayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "WeekdayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "DaysOfWeek" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int])) :+: C1 ('MetaCons "DayOfYear" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))))

type DayOfMonth = Int Source #

Day of month, in range 1 to 31.

data Period Source #

Constructors

DayPeriod Day |
WeekPeriod Day |
MonthPeriod Year Month |
QuarterPeriod Year Quarter |
YearPeriod Year |
PeriodBetween Day Day |
PeriodFrom Day |
PeriodTo Day |
PeriodAll |

#### Instances

Instances details

Generic Period |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Period :: Type -> Type Source # Methods from :: Period -> Rep Period x Source # to :: Rep Period x -> Period Source #
Show Period |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Period -> ShowS Source # show :: Period -> String Source # showList :: [Period] -> ShowS Source #
Default Period |
Instance details Defined in Hledger.Data.Types Methods def :: Period #
Eq Period |
Instance details Defined in Hledger.Data.Types Methods (==) :: Period -> Period -> Bool Source # (/=) :: Period -> Period -> Bool Source #
Ord Period |
Instance details Defined in Hledger.Data.Types Methods compare :: Period -> Period -> Ordering Source # (<) :: Period -> Period -> Bool Source # (<=) :: Period -> Period -> Bool Source # (>) :: Period -> Period -> Bool Source # (>=) :: Period -> Period -> Bool Source # max :: Period -> Period -> Period Source # min :: Period -> Period -> Period Source #
type Rep Period |

Instance details

Defined in Hledger.Data.Types

type Rep Period = D1 ('MetaData "Period" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (((C1 ('MetaCons "DayPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: C1 ('MetaCons "WeekPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day))) :+: (C1 ('MetaCons "MonthPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Year) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Month)) :+: C1 ('MetaCons "QuarterPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Year) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Quarter)))) :+: ((C1 ('MetaCons "YearPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Year)) :+: C1 ('MetaCons "PeriodBetween" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day))) :+: (C1 ('MetaCons "PeriodFrom" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: (C1 ('MetaCons "PeriodTo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: C1 ('MetaCons "PeriodAll" 'PrefixI 'False) (U1 :: Type -> Type)))))

class Ord p => DayPeriod p where Source #

The class of types which can be represented as a period of days.

Since: time-1.12.1

Methods

periodFirstDay :: p -> Day Source #

Returns the first `Day` in a period of days.

periodLastDay :: p -> Day Source #

Returns the last `Day` in a period of days.

dayPeriod :: Day -> p Source #

Get the period this day is in.

#### Instances

Instances details

DayPeriod Day |
Instance details Defined in Data.Time.Calendar.Days Methods periodFirstDay :: Day -> Day Source # periodLastDay :: Day -> Day Source # dayPeriod :: Day -> Day Source #

data DateSpan Source #

A possibly open-ended span of time, from an optional inclusive start date to an optional exclusive end date. Each date can be either exact or flexible. An "exact date span" is a Datepan with exact start and end dates.

Constructors

DateSpan (Maybe EFDay) (Maybe EFDay) |

#### Instances

Instances details

Generic DateSpan |
Instance details Defined in Hledger.Data.Types Associated Types type Rep DateSpan :: Type -> Type Source # Methods from :: DateSpan -> Rep DateSpan x Source # to :: Rep DateSpan x -> DateSpan Source #
Default DateSpan |
Instance details Defined in Hledger.Data.Types Methods def :: DateSpan #
Eq DateSpan |
Instance details Defined in Hledger.Data.Types Methods (==) :: DateSpan -> DateSpan -> Bool Source # (/=) :: DateSpan -> DateSpan -> Bool Source #
Ord DateSpan |
Instance details Defined in Hledger.Data.Types Methods compare :: DateSpan -> DateSpan -> Ordering Source # (<) :: DateSpan -> DateSpan -> Bool Source # (<=) :: DateSpan -> DateSpan -> Bool Source # (>) :: DateSpan -> DateSpan -> Bool Source # (>=) :: DateSpan -> DateSpan -> Bool Source # max :: DateSpan -> DateSpan -> DateSpan Source # min :: DateSpan -> DateSpan -> DateSpan Source #
type Rep DateSpan |

Instance details

Defined in Hledger.Data.Types

type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "DateSpan" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EFDay)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EFDay))))

data EFDay Source #

A date which is either exact or flexible. Flexible dates are allowed to be adjusted in certain situations.

Constructors

Exact Day |
Flex Day |

#### Instances

Instances details

Generic EFDay |
Instance details Defined in Hledger.Data.Types Associated Types type Rep EFDay :: Type -> Type Source # Methods from :: EFDay -> Rep EFDay x Source # to :: Rep EFDay x -> EFDay Source #
Show EFDay |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> EFDay -> ShowS Source # show :: EFDay -> String Source # showList :: [EFDay] -> ShowS Source #
Eq EFDay |
Instance details Defined in Hledger.Data.Types Methods (==) :: EFDay -> EFDay -> Bool Source # (/=) :: EFDay -> EFDay -> Bool Source #
Ord EFDay |
Instance details Defined in Hledger.Data.Types Methods compare :: EFDay -> EFDay -> Ordering Source # (<) :: EFDay -> EFDay -> Bool Source # (<=) :: EFDay -> EFDay -> Bool Source # (>) :: EFDay -> EFDay -> Bool Source # (>=) :: EFDay -> EFDay -> Bool Source # max :: EFDay -> EFDay -> EFDay Source # min :: EFDay -> EFDay -> EFDay Source #
type Rep EFDay |

Instance details

Defined in Hledger.Data.Types

type Rep EFDay = D1 ('MetaData "EFDay" "Hledger.Data.Types" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "Exact" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: C1 ('MetaCons "Flex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)))

data WhichDate Source #

Constructors

PrimaryDate |
SecondaryDate |

#### Instances

Instances details

Show WhichDate |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> WhichDate -> ShowS Source # show :: WhichDate -> String Source # showList :: [WhichDate] -> ShowS Source #
Eq WhichDate |
Instance details Defined in Hledger.Data.Types Methods (==) :: WhichDate -> WhichDate -> Bool Source # (/=) :: WhichDate -> WhichDate -> Bool Source #

data SmartInterval Source #

Constructors

Day |
Week |
Month |
Quarter |
Year |

#### Instances

Instances details

Show SmartInterval |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartInterval -> ShowS Source # show :: SmartInterval -> String Source # showList :: [SmartInterval] -> ShowS Source #

newtype Day Source #

The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.

Constructors

ModifiedJulianDay |

Fields

- toModifiedJulianDay :: Integer

#### Instances

Instances details

FromJSON Day |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser Day Source # parseJSONList :: Value -> Parser [Day] Source #
FromJSONKey Day |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction Day Source # fromJSONKeyList :: FromJSONKeyFunction [Day] Source #
ToJSON Day |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: Day -> Value Source # toEncoding :: Day -> Encoding Source # toJSONList :: [Day] -> Value Source # toEncodingList :: [Day] -> Encoding Source #
ToJSONKey Day |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction Day Source # toJSONKeyList :: ToJSONKeyFunction [Day] Source #
Data Day |

Instance details

Defined in Data.Time.Calendar.Days

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day Source #

toConstr :: Day -> Constr Source #

dataTypeOf :: Day -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Day) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) Source #

gmapT :: (forall b. Data b => b -> b) -> Day -> Day Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

Enum Day |
Instance details Defined in Data.Time.Calendar.Days Methods succ :: Day -> Day Source # pred :: Day -> Day Source # toEnum :: Int -> Day Source # fromEnum :: Day -> Int Source # enumFrom :: Day -> [Day] Source # enumFromThen :: Day -> Day -> [Day] Source # enumFromTo :: Day -> Day -> [Day] Source # enumFromThenTo :: Day -> Day -> Day -> [Day] Source #
Ix Day |
Instance details Defined in Data.Time.Calendar.Days Methods range :: (Day, Day) -> [Day] Source # index :: (Day, Day) -> Day -> Int Source # unsafeIndex :: (Day, Day) -> Day -> Int Source # inRange :: (Day, Day) -> Day -> Bool Source # rangeSize :: (Day, Day) -> Int Source # unsafeRangeSize :: (Day, Day) -> Int Source #
NFData Day |
Instance details Defined in Data.Time.Calendar.Days Methods rnf :: Day -> () Source #
Eq Day |
Instance details Defined in Data.Time.Calendar.Days Methods (==) :: Day -> Day -> Bool Source # (/=) :: Day -> Day -> Bool Source #
Ord Day |
Instance details Defined in Data.Time.Calendar.Days Methods compare :: Day -> Day -> Ordering Source # (<) :: Day -> Day -> Bool Source # (<=) :: Day -> Day -> Bool Source # (>) :: Day -> Day -> Bool Source # (>=) :: Day -> Day -> Bool Source # max :: Day -> Day -> Day Source # min :: Day -> Day -> Day Source #
DayPeriod Day |
Instance details Defined in Data.Time.Calendar.Days Methods periodFirstDay :: Day -> Day Source # periodLastDay :: Day -> Day Source # dayPeriod :: Day -> Day Source #

type Month = Int Source #

type Quarter = Int Source #

data SmartDate Source #

A possibly incomplete year-month-day date provided by the user, to be interpreted as either a date or a date span depending on context. Missing parts "on the left" will be filled from the provided reference date, e.g. if the year and month are missing, the reference date's year and month are used. Missing parts "on the right" are assumed, when interpreting as a date, to be 1, (e.g. if the year and month are present but the day is missing, it means first day of that month); or when interpreting as a date span, to be a wildcard (so it would mean all days of that month). See the `smartdate` parser for more examples.

Or, one of the standard periods and an offset relative to the reference date: (last|this|next) (day|week|month|quarter|year), where "this" means the period containing the reference date.

Constructors

SmartCompleteDate Day |
SmartAssumeStart Year (Maybe Month) |
SmartFromReference (Maybe Month) MonthDay |
SmartMonth Month |
SmartRelative Integer SmartInterval |

#### Instances

Instances details

Show SmartDate |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartDate -> ShowS Source # show :: SmartDate -> String Source # showList :: [SmartDate] -> ShowS Source #

type WeekDay = Int Source #

type MonthDay = Int Source #

type YearDay = Int Source #

type MonthWeek = Int Source #

type YearWeek = Int Source #

type HledgerParseErrors = ParseErrorBundle Text HledgerParseErrorData Source #

A specialised version of ParseErrorBundle: a non-empty collection of hledger parse errors, equipped with PosState to help pretty-print them. Specialised for a `Text` parse stream.

data HledgerParseErrorData Source #

Custom error data for hledger parsers. Specialised for a `Text` parse stream. ReparseableTextParseErrorData ?

#### Instances

Instances details

Show HledgerParseErrorData |
Instance details Defined in Text.Megaparsec.Custom Methods showsPrec :: Int -> HledgerParseErrorData -> ShowS Source # show :: HledgerParseErrorData -> String Source # showList :: [HledgerParseErrorData] -> ShowS Source #
Eq HledgerParseErrorData |
Instance details Defined in Text.Megaparsec.Custom Methods (==) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source # (/=) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #
Ord HledgerParseErrorData |

Instance details

Defined in Text.Megaparsec.Custom

Methods

compare :: HledgerParseErrorData -> HledgerParseErrorData -> Ordering Source #

(<) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

(<=) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

(>) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

(>=) :: HledgerParseErrorData -> HledgerParseErrorData -> Bool Source #

max :: HledgerParseErrorData -> HledgerParseErrorData -> HledgerParseErrorData Source #

min :: HledgerParseErrorData -> HledgerParseErrorData -> HledgerParseErrorData Source #

ShowErrorComponent HledgerParseErrorData |
Instance details Defined in Text.Megaparsec.Custom Methods showErrorComponent :: HledgerParseErrorData -> String Source # errorComponentLen :: HledgerParseErrorData -> Int Source #
Ord (ParseError Text HledgerParseErrorData) |

Instance details

Defined in Text.Megaparsec.Custom

Methods

compare :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Ordering Source #

(<) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(<=) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(>) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

(>=) :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> Bool Source #

max :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData Source #

min :: ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData -> ParseError Text HledgerParseErrorData Source #

data WideBuilder Source #

Helper for constructing Builders while keeping track of text width.

Constructors

WideBuilder |

Fields

- wbBuilder :: !Builder
- wbWidth :: !Int

#### Instances

Instances details

Monoid WideBuilder |
Instance details Defined in Text.WideString Methods mempty :: WideBuilder Source # mappend :: WideBuilder -> WideBuilder -> WideBuilder Source # mconcat :: [WideBuilder] -> WideBuilder Source #
Semigroup WideBuilder |
Instance details Defined in Text.WideString Methods (<>) :: WideBuilder -> WideBuilder -> WideBuilder Source # sconcat :: NonEmpty WideBuilder -> WideBuilder Source # stimes :: Integral b => b -> WideBuilder -> WideBuilder Source #
Show WideBuilder |
Instance details Defined in Text.WideString Methods showsPrec :: Int -> WideBuilder -> ShowS Source # show :: WideBuilder -> String Source # showList :: [WideBuilder] -> ShowS Source #

type TextParser (m :: Type -> Type) a = ParsecT HledgerParseErrorData Text m a Source #

A parser of text that runs in some monad.

type SimpleTextParser = Parsec HledgerParseErrorData Text Source #

A parser of strict text to some type.

type SimpleStringParser a = Parsec HledgerParseErrorData String a Source #

A parser of string to some type.

data RawOpts Source #

The result of running cmdargs: an association list of option names to string values.

#### Instances

Instances details

Show RawOpts |
Instance details Defined in Hledger.Data.RawOptions Methods showsPrec :: Int -> RawOpts -> ShowS Source # show :: RawOpts -> String Source # showList :: [RawOpts] -> ShowS Source #
Default RawOpts |
Instance details Defined in Hledger.Data.RawOptions Methods def :: RawOpts #

data ReportItemField Source #

An id identifying which report item field to interpolate. These are drawn from several hledger report types, so are not all applicable for a given report.

Constructors

AccountField | A posting or balance report item's account name
DefaultDateField | A posting or register or entry report item's date
DescriptionField | A posting or register or entry report item's description
TotalField | A balance or posting report item's balance or running total. Always rendered right-justified.
DepthSpacerField | A balance report item's indent level (which may be different from the account name depth). Rendered as this number of spaces, multiplied by the minimum width spec if any.
FieldNo Int | A report item's nth field. May be unimplemented.

#### Instances

Instances details

Show ReportItemField |
Instance details Defined in Hledger.Data.StringFormat Methods showsPrec :: Int -> ReportItemField -> ShowS Source # show :: ReportItemField -> String Source # showList :: [ReportItemField] -> ShowS Source #
Eq ReportItemField |
Instance details Defined in Hledger.Data.StringFormat Methods (==) :: ReportItemField -> ReportItemField -> Bool Source # (/=) :: ReportItemField -> ReportItemField -> Bool Source #

data StringFormatComponent Source #

Constructors

FormatLiteral Text | Literal text to be rendered as-is

FormatField Bool (Maybe Int) (Maybe Int) ReportItemField

A data field to be formatted and interpolated. Parameters:

- Left justify ? Right justified if false
- Minimum width ? Will be space-padded if narrower than this
- Maximum width ? Will be clipped if wider than this
- Which of the standard hledger report item fields to interpolate

#### Instances

Instances details

Show StringFormatComponent |
Instance details Defined in Hledger.Data.StringFormat Methods showsPrec :: Int -> StringFormatComponent -> ShowS Source # show :: StringFormatComponent -> String Source # showList :: [StringFormatComponent] -> ShowS Source #
Eq StringFormatComponent |
Instance details Defined in Hledger.Data.StringFormat Methods (==) :: StringFormatComponent -> StringFormatComponent -> Bool Source # (/=) :: StringFormatComponent -> StringFormatComponent -> Bool Source #

data StringFormat Source #

A format specification/template to use when rendering a report line item as text.

A format is a sequence of components; each is either a literal string, or a hledger report item field with specified width and justification whose value will be interpolated at render time.

A component's value may be a multi-line string (or a multi-commodity amount), in which case the final string will be either single-line or a top or bottom-aligned multi-line string depending on the StringFormat variant used.

Currently this is only used in the balance command's single-column mode, which provides a limited StringFormat renderer.

Constructors

OneLine [StringFormatComponent] | multi-line values will be rendered on one line, comma-separated
TopAligned [StringFormatComponent] | values will be top-aligned (and bottom-padded to the same height)
BottomAligned [StringFormatComponent] | values will be bottom-aligned (and top-padded)

#### Instances

Instances details

Show StringFormat |
Instance details Defined in Hledger.Data.StringFormat Methods showsPrec :: Int -> StringFormat -> ShowS Source # show :: StringFormat -> String Source # showList :: [StringFormat] -> ShowS Source #
Default StringFormat |
Instance details Defined in Hledger.Data.StringFormat Methods def :: StringFormat #
Eq StringFormat |
Instance details Defined in Hledger.Data.StringFormat Methods (==) :: StringFormat -> StringFormat -> Bool Source # (/=) :: StringFormat -> StringFormat -> Bool Source #

data AmountDisplayOpts Source #

Options for the display of Amount and MixedAmount.

Constructors

AmountDisplayOpts |

Fields

- displayPrice :: Bool

  Whether to display the Price of an Amount.

- displayZeroCommodity :: Bool

  If the Amount rounds to 0, whether to display its commodity string.

- displayThousandsSep :: Bool

  Whether to display thousands separators.

- displayColour :: Bool

  Whether to colourise negative Amounts.

- displayOneLine :: Bool

  Whether to display on one line.

- displayMinWidth :: Maybe Int

  Minimum width to pad to

- displayMaxWidth :: Maybe Int

  Maximum width to clip to | Display amounts in this order (without the commodity symbol) and display a 0 in case a corresponding commodity does not exist

- displayOrder :: Maybe [CommoditySymbol]

#### Instances

Instances details

Show AmountDisplayOpts |
Instance details Defined in Hledger.Data.Amount Methods showsPrec :: Int -> AmountDisplayOpts -> ShowS Source # show :: AmountDisplayOpts -> String Source # showList :: [AmountDisplayOpts] -> ShowS Source #
Default AmountDisplayOpts | Display Amount and MixedAmount with no colour.
Instance details Defined in Hledger.Data.Amount Methods def :: AmountDisplayOpts #

type PriceOracle = (Day, CommoditySymbol, Maybe CommoditySymbol) -> Maybe (CommoditySymbol, Quantity) Source #

A price oracle is a magic memoising function that efficiently looks up market prices (exchange rates) from one commodity to another (or if unspecified, to a default valuation commodity) on a given date.

data ValuationType Source #

What kind of value conversion should be done on amounts ? CLI: --value=then|end|now|DATE[,COMM]

Constructors

AtThen (Maybe CommoditySymbol) | convert to default or given valuation commodity, using market prices at each posting's date
AtEnd (Maybe CommoditySymbol) | convert to default or given valuation commodity, using market prices at period end(s)
AtNow (Maybe CommoditySymbol) | convert to default or given valuation commodity, using current market prices
AtDate Day (Maybe CommoditySymbol) | convert to default or given valuation commodity, using market prices on some date

#### Instances

Instances details

Show ValuationType |
Instance details Defined in Hledger.Data.Valuation Methods showsPrec :: Int -> ValuationType -> ShowS Source # show :: ValuationType -> String Source # showList :: [ValuationType] -> ShowS Source #
Eq ValuationType |
Instance details Defined in Hledger.Data.Valuation Methods (==) :: ValuationType -> ValuationType -> Bool Source # (/=) :: ValuationType -> ValuationType -> Bool Source #

data ConversionOp Source #

Which operation to perform on conversion transactions. (There was also an "infer equity postings" operation, but that is now done earlier, in journal finalisation.)

Constructors

NoConversionOp |
ToCost |

#### Instances

Instances details

Show ConversionOp |
Instance details Defined in Hledger.Data.Valuation Methods showsPrec :: Int -> ConversionOp -> ShowS Source # show :: ConversionOp -> String Source # showList :: [ConversionOp] -> ShowS Source #
Eq ConversionOp |
Instance details Defined in Hledger.Data.Valuation Methods (==) :: ConversionOp -> ConversionOp -> Bool Source # (/=) :: ConversionOp -> ConversionOp -> Bool Source #

data QueryOpt Source #

A query option changes a query's/report's behaviour and output in some way.

Constructors

QueryOptInAcctOnly AccountName | show an account register focussed on this account
QueryOptInAcct AccountName | as above but include sub-accounts in the account register | QueryOptCostBasis -- ^ show amounts converted to cost where possible | QueryOptDate2 -- ^ show secondary dates instead of primary dates

#### Instances

Instances details

Show QueryOpt |
Instance details Defined in Hledger.Query Methods showsPrec :: Int -> QueryOpt -> ShowS Source # show :: QueryOpt -> String Source # showList :: [QueryOpt] -> ShowS Source #
Eq QueryOpt |
Instance details Defined in Hledger.Query Methods (==) :: QueryOpt -> QueryOpt -> Bool Source # (/=) :: QueryOpt -> QueryOpt -> Bool Source #

data OrdPlus Source #

A more expressive Ord, used for amt: queries. The Abs* variants compare with the absolute value of a number, ignoring sign.

Constructors

Lt |
LtEq |
Gt |
GtEq |
Eq |
AbsLt |
AbsLtEq |
AbsGt |
AbsGtEq |
AbsEq |

#### Instances

Instances details

Show OrdPlus |
Instance details Defined in Hledger.Query Methods showsPrec :: Int -> OrdPlus -> ShowS Source # show :: OrdPlus -> String Source # showList :: [OrdPlus] -> ShowS Source #
Eq OrdPlus |
Instance details Defined in Hledger.Query Methods (==) :: OrdPlus -> OrdPlus -> Bool Source # (/=) :: OrdPlus -> OrdPlus -> Bool Source #

data Query Source #

A query is a composition of search criteria, which can be used to match postings, transactions, accounts and more.

Constructors

Not Query | negate this match
And [Query] | match if all of these match
Or [Query] | match if any of these match no-op queries
Any | always match
None | never match data queries (in "standard" order, roughly as they appear in a transaction)
Date DateSpan | match primary dates in this date span
Date2 DateSpan | match secondary dates in this date span
StatusQ Status | match this txn/posting status
Code Regexp | match txn codes infix-matched by this regexp
Desc Regexp | match txn descriptions infix-matched by this regexp
Tag Regexp (Maybe Regexp) | match if a tag's name, and optionally its value, is infix-matched by the respective regexps
Acct Regexp | match account names infix-matched by this regexp
Type [AccountType] | match accounts whose type is one of these (or with no types, any account)
Depth Int | match if account depth is less than or equal to this value (or, sometimes used as a display option)
Real Bool | match postings with this "realness" value
Amt OrdPlus Quantity | match if the amount's numeric quantity is less thangreater thanequal to/unsignedly equal to some value
Sym Regexp | match if the commodity symbol is fully-matched by this regexp

#### Instances

Instances details

Show Query |
Instance details Defined in Hledger.Query Methods showsPrec :: Int -> Query -> ShowS Source # show :: Query -> String Source # showList :: [Query] -> ShowS Source #
Default Query |
Instance details Defined in Hledger.Query Methods def :: Query #
Eq Query |
Instance details Defined in Hledger.Query Methods (==) :: Query -> Query -> Bool Source # (/=) :: Query -> Query -> Bool Source #

type ErroringJournalParser (m :: Type -> Type) a = StateT Journal (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError m)) a Source #

A parser of text that runs in some monad, keeping a Journal as state, that can throw an exception to end parsing, preventing further parser backtracking.

type JournalParser (m :: Type -> Type) a = StateT Journal (ParsecT HledgerParseErrorData Text m) a Source #

A parser of text that runs in some monad, keeping a Journal as state.

data BalancingOpts Source #

Constructors

BalancingOpts |

Fields

- ignore_assertions_ :: Bool

  should failing balance assertions be ignored ?

- infer_balancing_costs_ :: Bool

  Are we permitted to infer missing costs to balance transactions ? Distinct from InputOpts{infer_costs_}.

- commodity_styles_ :: Maybe (Map CommoditySymbol AmountStyle)

  commodity display styles

#### Instances

Instances details

Show BalancingOpts |
Instance details Defined in Hledger.Data.Balancing Methods showsPrec :: Int -> BalancingOpts -> ShowS Source # show :: BalancingOpts -> String Source # showList :: [BalancingOpts] -> ShowS Source #
HasBalancingOpts BalancingOpts |
Instance details Defined in Hledger.Data.Balancing Methods balancingOpts :: Lens' BalancingOpts BalancingOpts Source # commodity_styles :: Lens' BalancingOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' BalancingOpts Bool Source # infer_balancing_costs :: Lens' BalancingOpts Bool Source #

class HasBalancingOpts c where Source #

Minimal complete definition

balancingOpts

Methods

balancingOpts :: Lens' c BalancingOpts Source #

commodity_styles :: Lens' c (Maybe (Map CommoditySymbol AmountStyle)) Source #

ignore_assertions :: Lens' c Bool Source #

infer_balancing_costs :: Lens' c Bool Source #

#### Instances

Instances details

HasBalancingOpts CliOpts Source # |
Instance details Defined in Hledger.Cli.CliOptions Methods balancingOpts :: Lens' CliOpts BalancingOpts Source # commodity_styles :: Lens' CliOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' CliOpts Bool Source # infer_balancing_costs :: Lens' CliOpts Bool Source #
HasBalancingOpts BalancingOpts |
Instance details Defined in Hledger.Data.Balancing Methods balancingOpts :: Lens' BalancingOpts BalancingOpts Source # commodity_styles :: Lens' BalancingOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' BalancingOpts Bool Source # infer_balancing_costs :: Lens' BalancingOpts Bool Source #
HasBalancingOpts InputOpts |
Instance details Defined in Hledger.Read.InputOptions Methods balancingOpts :: Lens' InputOpts BalancingOpts Source # commodity_styles :: Lens' InputOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' InputOpts Bool Source # infer_balancing_costs :: Lens' InputOpts Bool Source #

data InputOpts Source #

Constructors

InputOpts |

Fields

- mformat_ :: Maybe StorageFormat

  a file/storage format to try, unless overridden by a filename prefix. Nothing means try all.

- mrules_file_ :: Maybe FilePath

  a conversion rules file to use (when reading CSV)

- aliases_ :: [String]

  account name aliases to apply

- anon_ :: Bool

  do light anonymisation/obfuscation of the data

- new_ :: Bool

  read only new transactions since this file was last read

- new_save_ :: Bool

  save latest new transactions state for next time

- pivot_ :: String

  use the given field's value as the account name

- forecast_ :: Maybe DateSpan

  span in which to generate forecast transactions

- verbose_tags_ :: Bool

  add user-visible tags when generating/modifying transactions & postings ?

- reportspan_ :: DateSpan

  a dirty hack keeping the query dates in InputOpts. This rightfully lives in ReportSpec, but is duplicated here.

- auto_ :: Bool

  generate automatic postings when journal is parsed ?

- infer_equity_ :: Bool

  infer equity conversion postings from costs ?

- infer_costs_ :: Bool

  infer costs from equity conversion postings ? distinct from BalancingOpts{infer_balancing_costs_}

- balancingopts_ :: BalancingOpts

  options for balancing transactions

- strict_ :: Bool

  do extra error checking (eg, all posted accounts are declared, no prices are inferred)

- _ioDay :: Day

  today's date, for use with forecast transactions XXX this duplicates _rsDay, and should eventually be removed when it's not needed anymore.

#### Instances

Instances details

Show InputOpts |
Instance details Defined in Hledger.Read.InputOptions Methods showsPrec :: Int -> InputOpts -> ShowS Source # show :: InputOpts -> String Source # showList :: [InputOpts] -> ShowS Source #
HasBalancingOpts InputOpts |
Instance details Defined in Hledger.Read.InputOptions Methods balancingOpts :: Lens' InputOpts BalancingOpts Source # commodity_styles :: Lens' InputOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' InputOpts Bool Source # infer_balancing_costs :: Lens' InputOpts Bool Source #
HasInputOpts InputOpts |

Instance details

Defined in Hledger.Read.InputOptions

Methods

inputOpts :: Lens' InputOpts InputOpts Source #

aliases :: Lens' InputOpts [String] Source #

anon__ :: Lens' InputOpts Bool Source #

auto__ :: Lens' InputOpts Bool Source #

balancingopts :: Lens' InputOpts BalancingOpts Source #

forecast :: Lens' InputOpts (Maybe DateSpan) Source #

infer_costs :: Lens' InputOpts Bool Source #

infer_equity :: Lens' InputOpts Bool Source #

ioDay :: Lens' InputOpts Day Source #

mformat :: Lens' InputOpts (Maybe StorageFormat) Source #

mrules_file :: Lens' InputOpts (Maybe FilePath) Source #

new__ :: Lens' InputOpts Bool Source #

new_save :: Lens' InputOpts Bool Source #

pivot :: Lens' InputOpts String Source #

reportspan :: Lens' InputOpts DateSpan Source #

strict :: Lens' InputOpts Bool Source #

verbose_tags :: Lens' InputOpts Bool Source #

class HasInputOpts c where Source #

Minimal complete definition

inputOpts

Methods

inputOpts :: Lens' c InputOpts Source #

aliases :: Lens' c [String] Source #

anon__ :: Lens' c Bool Source #

auto__ :: Lens' c Bool Source #

balancingopts :: Lens' c BalancingOpts Source #

forecast :: Lens' c (Maybe DateSpan) Source #

infer_costs :: Lens' c Bool Source #

infer_equity :: Lens' c Bool Source #

ioDay :: Lens' c Day Source #

mformat :: Lens' c (Maybe StorageFormat) Source #

mrules_file :: Lens' c (Maybe FilePath) Source #

new__ :: Lens' c Bool Source #

new_save :: Lens' c Bool Source #

pivot :: Lens' c String Source #

reportspan :: Lens' c DateSpan Source #

strict :: Lens' c Bool Source #

verbose_tags :: Lens' c Bool Source #

#### Instances

Instances details

HasInputOpts CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

inputOpts :: Lens' CliOpts InputOpts Source #

aliases :: Lens' CliOpts [String] Source #

anon__ :: Lens' CliOpts Bool Source #

auto__ :: Lens' CliOpts Bool Source #

balancingopts :: Lens' CliOpts BalancingOpts Source #

forecast :: Lens' CliOpts (Maybe DateSpan) Source #

infer_costs :: Lens' CliOpts Bool Source #

infer_equity :: Lens' CliOpts Bool Source #

ioDay :: Lens' CliOpts Day Source #

mformat :: Lens' CliOpts (Maybe StorageFormat) Source #

mrules_file :: Lens' CliOpts (Maybe FilePath) Source #

new__ :: Lens' CliOpts Bool Source #

new_save :: Lens' CliOpts Bool Source #

pivot :: Lens' CliOpts String Source #

reportspan :: Lens' CliOpts DateSpan Source #

strict :: Lens' CliOpts Bool Source #

verbose_tags :: Lens' CliOpts Bool Source #

HasInputOpts InputOpts |

Instance details

Defined in Hledger.Read.InputOptions

Methods

inputOpts :: Lens' InputOpts InputOpts Source #

aliases :: Lens' InputOpts [String] Source #

anon__ :: Lens' InputOpts Bool Source #

auto__ :: Lens' InputOpts Bool Source #

balancingopts :: Lens' InputOpts BalancingOpts Source #

forecast :: Lens' InputOpts (Maybe DateSpan) Source #

infer_costs :: Lens' InputOpts Bool Source #

infer_equity :: Lens' InputOpts Bool Source #

ioDay :: Lens' InputOpts Day Source #

mformat :: Lens' InputOpts (Maybe StorageFormat) Source #

mrules_file :: Lens' InputOpts (Maybe FilePath) Source #

new__ :: Lens' InputOpts Bool Source #

new_save :: Lens' InputOpts Bool Source #

pivot :: Lens' InputOpts String Source #

reportspan :: Lens' InputOpts DateSpan Source #

strict :: Lens' InputOpts Bool Source #

verbose_tags :: Lens' InputOpts Bool Source #

data ReportSpec Source #

A fully-determined set of report parameters (report options with all partial values made total, eg the begin and end dates are known, avoiding date/regex errors; plus the reporting date), and the query successfully calculated from them.

If you change the report options or date in one of these, you should use `reportOptsToSpec` to regenerate the whole thing, avoiding inconsistency.

Constructors

ReportSpec |

Fields

- _rsReportOpts :: ReportOpts

  The underlying ReportOpts used to generate this ReportSpec

- _rsDay :: Day

  The Day this ReportSpec is generated for

- _rsQuery :: Query

  The generated Query for the given day

- _rsQueryOpts :: [QueryOpt]

  A list of QueryOpts for the given day

#### Instances

Instances details

Show ReportSpec |
Instance details Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> ReportSpec -> ShowS Source # show :: ReportSpec -> String Source # showList :: [ReportSpec] -> ShowS Source #
Default ReportSpec |
Instance details Defined in Hledger.Reports.ReportOptions Methods def :: ReportSpec #
HasReportOpts ReportSpec |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOpts :: ReportableLens' ReportSpec ReportOpts Source #

period :: ReportableLens' ReportSpec Period Source #

statuses :: ReportableLens' ReportSpec [Status] Source #

depth :: ReportableLens' ReportSpec (Maybe Int) Source #

date2 :: ReportableLens' ReportSpec Bool Source #

real :: ReportableLens' ReportSpec Bool Source #

querystring :: ReportableLens' ReportSpec [Text] Source #

HasReportOptsNoUpdate ReportSpec |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOptsNoUpdate :: Lens' ReportSpec ReportOpts Source #

accountlistmode :: Lens' ReportSpec AccountListMode Source #

average :: Lens' ReportSpec Bool Source #

balanceaccum :: Lens' ReportSpec BalanceAccumulation Source #

balancecalc :: Lens' ReportSpec BalanceCalculation Source #

budgetpat :: Lens' ReportSpec (Maybe Text) Source #

color__ :: Lens' ReportSpec Bool Source #

conversionop :: Lens' ReportSpec (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' ReportSpec Bool Source #

declared :: Lens' ReportSpec Bool Source #

depthNoUpdate :: Lens' ReportSpec (Maybe Int) Source #

drop__ :: Lens' ReportSpec Int Source #

empty__ :: Lens' ReportSpec Bool Source #

format :: Lens' ReportSpec StringFormat Source #

infer_prices :: Lens' ReportSpec Bool Source #

interval :: Lens' ReportSpec Interval Source #

invert :: Lens' ReportSpec Bool Source #

layout :: Lens' ReportSpec Layout Source #

no_elide :: Lens' ReportSpec Bool Source #

no_total :: Lens' ReportSpec Bool Source #

normalbalance :: Lens' ReportSpec (Maybe NormalSign) Source #

percent :: Lens' ReportSpec Bool Source #

periodNoUpdate :: Lens' ReportSpec Period Source #

pretty :: Lens' ReportSpec Bool Source #

querystringNoUpdate :: Lens' ReportSpec [Text] Source #

realNoUpdate :: Lens' ReportSpec Bool Source #

related :: Lens' ReportSpec Bool Source #

row_total :: Lens' ReportSpec Bool Source #

show_costs :: Lens' ReportSpec Bool Source #

sort_amount :: Lens' ReportSpec Bool Source #

statusesNoUpdate :: Lens' ReportSpec [Status] Source #

transpose__ :: Lens' ReportSpec Bool Source #

txn_dates :: Lens' ReportSpec Bool Source #

value :: Lens' ReportSpec (Maybe ValuationType) Source #

HasReportSpec ReportSpec |
Instance details Defined in Hledger.Reports.ReportOptions Methods reportSpec :: Lens' ReportSpec ReportSpec Source # rsDay :: Lens' ReportSpec Day Source # rsQuery :: Lens' ReportSpec Query Source # rsQueryOpts :: Lens' ReportSpec [QueryOpt] Source # rsReportOpts :: Lens' ReportSpec ReportOpts Source #

data ReportOpts Source #

Standard options for customising report filtering and output. Most of these correspond to standard hledger command-line options or query arguments, but not all. Some are used only by certain commands, as noted below.

Constructors

ReportOpts |

Fields

- period_ :: Period
- interval_ :: Interval
- statuses_ :: [Status]

  Zero, one, or two statuses to be matched

- conversionop_ :: Maybe ConversionOp

  Which operation should we apply to conversion transactions?

- value_ :: Maybe ValuationType

  What value should amounts be converted to ?

- infer_prices_ :: Bool

  Infer market prices from transactions ?

- depth_ :: Maybe Int
- date2_ :: Bool
- empty_ :: Bool
- no_elide_ :: Bool
- real_ :: Bool
- format_ :: StringFormat
- pretty_ :: Bool
- querystring_ :: [Text]
- average_ :: Bool
- related_ :: Bool
- txn_dates_ :: Bool
- balancecalc_ :: BalanceCalculation

  What to calculate in balance report cells

- balanceaccum_ :: BalanceAccumulation

  How to accumulate balance report values over time

- budgetpat_ :: Maybe Text

  A case-insensitive description substring to select periodic transactions for budget reports. (Not a regexp, nor a full hledger query, for now.)

- accountlistmode_ :: AccountListMode
- drop_ :: Int
- declared_ :: Bool

  Include accounts declared but not yet posted to ?

- row_total_ :: Bool
- no_total_ :: Bool
- show_costs_ :: Bool

  Show costs for reports which normally don't show them ?

- sort_amount_ :: Bool
- percent_ :: Bool
- invert_ :: Bool

  Flip all amount signs in reports ?

- normalbalance_ :: Maybe NormalSign

  This can be set when running balance reports on a set of accounts with the same normal balance type (eg all assets, or all incomes). - It helps --sort-amount know how to sort negative numbers (eg in the income section of an income statement) - It helps compound balance report commands (is, bs etc.) do sign normalisation, converting normally negative subreports to normally positive for a more conventional display.

- color_ :: Bool

  Whether to use ANSI color codes in text output. Influenced by the --color/colour flag (cf CliOptions), whether stdout is an interactive terminal, and the value of TERM and existence of NO_COLOR environment variables.

- transpose_ :: Bool
- layout_ :: Layout

#### Instances

Instances details

Show ReportOpts |
Instance details Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> ReportOpts -> ShowS Source # show :: ReportOpts -> String Source # showList :: [ReportOpts] -> ShowS Source #
Default ReportOpts |
Instance details Defined in Hledger.Reports.ReportOptions Methods def :: ReportOpts #
HasReportOpts ReportOpts |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOpts :: ReportableLens' ReportOpts ReportOpts Source #

period :: ReportableLens' ReportOpts Period Source #

statuses :: ReportableLens' ReportOpts [Status] Source #

depth :: ReportableLens' ReportOpts (Maybe Int) Source #

date2 :: ReportableLens' ReportOpts Bool Source #

real :: ReportableLens' ReportOpts Bool Source #

querystring :: ReportableLens' ReportOpts [Text] Source #

HasReportOptsNoUpdate ReportOpts |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOptsNoUpdate :: Lens' ReportOpts ReportOpts Source #

accountlistmode :: Lens' ReportOpts AccountListMode Source #

average :: Lens' ReportOpts Bool Source #

balanceaccum :: Lens' ReportOpts BalanceAccumulation Source #

balancecalc :: Lens' ReportOpts BalanceCalculation Source #

budgetpat :: Lens' ReportOpts (Maybe Text) Source #

color__ :: Lens' ReportOpts Bool Source #

conversionop :: Lens' ReportOpts (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' ReportOpts Bool Source #

declared :: Lens' ReportOpts Bool Source #

depthNoUpdate :: Lens' ReportOpts (Maybe Int) Source #

drop__ :: Lens' ReportOpts Int Source #

empty__ :: Lens' ReportOpts Bool Source #

format :: Lens' ReportOpts StringFormat Source #

infer_prices :: Lens' ReportOpts Bool Source #

interval :: Lens' ReportOpts Interval Source #

invert :: Lens' ReportOpts Bool Source #

layout :: Lens' ReportOpts Layout Source #

no_elide :: Lens' ReportOpts Bool Source #

no_total :: Lens' ReportOpts Bool Source #

normalbalance :: Lens' ReportOpts (Maybe NormalSign) Source #

percent :: Lens' ReportOpts Bool Source #

periodNoUpdate :: Lens' ReportOpts Period Source #

pretty :: Lens' ReportOpts Bool Source #

querystringNoUpdate :: Lens' ReportOpts [Text] Source #

realNoUpdate :: Lens' ReportOpts Bool Source #

related :: Lens' ReportOpts Bool Source #

row_total :: Lens' ReportOpts Bool Source #

show_costs :: Lens' ReportOpts Bool Source #

sort_amount :: Lens' ReportOpts Bool Source #

statusesNoUpdate :: Lens' ReportOpts [Status] Source #

transpose__ :: Lens' ReportOpts Bool Source #

txn_dates :: Lens' ReportOpts Bool Source #

value :: Lens' ReportOpts (Maybe ValuationType) Source #

data AccountListMode Source #

Should accounts be displayed: in the command's default style, hierarchically, or as a flat list ?

Constructors

ALFlat |
ALTree |

#### Instances

Instances details

Show AccountListMode |
Instance details Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> AccountListMode -> ShowS Source # show :: AccountListMode -> String Source # showList :: [AccountListMode] -> ShowS Source #
Default AccountListMode |
Instance details Defined in Hledger.Reports.ReportOptions Methods def :: AccountListMode #
Eq AccountListMode |
Instance details Defined in Hledger.Reports.ReportOptions Methods (==) :: AccountListMode -> AccountListMode -> Bool Source # (/=) :: AccountListMode -> AccountListMode -> Bool Source #

data BalanceAccumulation Source #

How to accumulate calculated values across periods (columns) in a balance report. "Balance report types -> Accumulation type" in the hledger manual.

Constructors

PerPeriod | No accumulation. Eg, shows the change of balance in each period.
Cumulative | Accumulate changes across periods, starting from zero at report start.
Historical | Accumulate changes across periods, including any from before report start. Eg, shows the historical end balance of each period.

#### Instances

Instances details

Show BalanceAccumulation |
Instance details Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> BalanceAccumulation -> ShowS Source # show :: BalanceAccumulation -> String Source # showList :: [BalanceAccumulation] -> ShowS Source #
Default BalanceAccumulation |
Instance details Defined in Hledger.Reports.ReportOptions Methods def :: BalanceAccumulation #
Eq BalanceAccumulation |
Instance details Defined in Hledger.Reports.ReportOptions Methods (==) :: BalanceAccumulation -> BalanceAccumulation -> Bool Source # (/=) :: BalanceAccumulation -> BalanceAccumulation -> Bool Source #

data BalanceCalculation Source #

What to calculate for each cell in a balance report. "Balance report types -> Calculation type" in the hledger manual.

Constructors

CalcChange | Sum of posting amounts in the period.
CalcBudget | Sum of posting amounts and the goal for the period.
CalcValueChange | Change from previous period's historical end value to this period's historical end value.
CalcGain | Change from previous period's gain, i.e. valuation minus cost basis.
CalcPostingsCount | Number of postings in the period.

#### Instances

Instances details

Show BalanceCalculation |
Instance details Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> BalanceCalculation -> ShowS Source # show :: BalanceCalculation -> String Source # showList :: [BalanceCalculation] -> ShowS Source #
Default BalanceCalculation |
Instance details Defined in Hledger.Reports.ReportOptions Methods def :: BalanceCalculation #
Eq BalanceCalculation |
Instance details Defined in Hledger.Reports.ReportOptions Methods (==) :: BalanceCalculation -> BalanceCalculation -> Bool Source # (/=) :: BalanceCalculation -> BalanceCalculation -> Bool Source #

class HasReportOptsNoUpdate c where Source #

Lenses for ReportOpts.

Minimal complete definition

reportOptsNoUpdate

Methods

reportOptsNoUpdate :: Lens' c ReportOpts Source #

accountlistmode :: Lens' c AccountListMode Source #

average :: Lens' c Bool Source #

balanceaccum :: Lens' c BalanceAccumulation Source #

balancecalc :: Lens' c BalanceCalculation Source #

budgetpat :: Lens' c (Maybe Text) Source #

color__ :: Lens' c Bool Source #

conversionop :: Lens' c (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' c Bool Source #

declared :: Lens' c Bool Source #

depthNoUpdate :: Lens' c (Maybe Int) Source #

drop__ :: Lens' c Int Source #

empty__ :: Lens' c Bool Source #

format :: Lens' c StringFormat Source #

infer_prices :: Lens' c Bool Source #

interval :: Lens' c Interval Source #

invert :: Lens' c Bool Source #

layout :: Lens' c Layout Source #

no_elide :: Lens' c Bool Source #

no_total :: Lens' c Bool Source #

normalbalance :: Lens' c (Maybe NormalSign) Source #

percent :: Lens' c Bool Source #

periodNoUpdate :: Lens' c Period Source #

pretty :: Lens' c Bool Source #

querystringNoUpdate :: Lens' c [Text] Source #

realNoUpdate :: Lens' c Bool Source #

related :: Lens' c Bool Source #

row_total :: Lens' c Bool Source #

show_costs :: Lens' c Bool Source #

sort_amount :: Lens' c Bool Source #

statusesNoUpdate :: Lens' c [Status] Source #

transpose__ :: Lens' c Bool Source #

txn_dates :: Lens' c Bool Source #

value :: Lens' c (Maybe ValuationType) Source #

#### Instances

Instances details

HasReportOptsNoUpdate CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

reportOptsNoUpdate :: Lens' CliOpts ReportOpts Source #

accountlistmode :: Lens' CliOpts AccountListMode Source #

average :: Lens' CliOpts Bool Source #

balanceaccum :: Lens' CliOpts BalanceAccumulation Source #

balancecalc :: Lens' CliOpts BalanceCalculation Source #

budgetpat :: Lens' CliOpts (Maybe Text) Source #

color__ :: Lens' CliOpts Bool Source #

conversionop :: Lens' CliOpts (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' CliOpts Bool Source #

declared :: Lens' CliOpts Bool Source #

depthNoUpdate :: Lens' CliOpts (Maybe Int) Source #

drop__ :: Lens' CliOpts Int Source #

empty__ :: Lens' CliOpts Bool Source #

format :: Lens' CliOpts StringFormat Source #

infer_prices :: Lens' CliOpts Bool Source #

interval :: Lens' CliOpts Interval Source #

invert :: Lens' CliOpts Bool Source #

layout :: Lens' CliOpts Layout Source #

no_elide :: Lens' CliOpts Bool Source #

no_total :: Lens' CliOpts Bool Source #

normalbalance :: Lens' CliOpts (Maybe NormalSign) Source #

percent :: Lens' CliOpts Bool Source #

periodNoUpdate :: Lens' CliOpts Period Source #

pretty :: Lens' CliOpts Bool Source #

querystringNoUpdate :: Lens' CliOpts [Text] Source #

realNoUpdate :: Lens' CliOpts Bool Source #

related :: Lens' CliOpts Bool Source #

row_total :: Lens' CliOpts Bool Source #

show_costs :: Lens' CliOpts Bool Source #

sort_amount :: Lens' CliOpts Bool Source #

statusesNoUpdate :: Lens' CliOpts [Status] Source #

transpose__ :: Lens' CliOpts Bool Source #

txn_dates :: Lens' CliOpts Bool Source #

value :: Lens' CliOpts (Maybe ValuationType) Source #

HasReportOptsNoUpdate ReportOpts |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOptsNoUpdate :: Lens' ReportOpts ReportOpts Source #

accountlistmode :: Lens' ReportOpts AccountListMode Source #

average :: Lens' ReportOpts Bool Source #

balanceaccum :: Lens' ReportOpts BalanceAccumulation Source #

balancecalc :: Lens' ReportOpts BalanceCalculation Source #

budgetpat :: Lens' ReportOpts (Maybe Text) Source #

color__ :: Lens' ReportOpts Bool Source #

conversionop :: Lens' ReportOpts (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' ReportOpts Bool Source #

declared :: Lens' ReportOpts Bool Source #

depthNoUpdate :: Lens' ReportOpts (Maybe Int) Source #

drop__ :: Lens' ReportOpts Int Source #

empty__ :: Lens' ReportOpts Bool Source #

format :: Lens' ReportOpts StringFormat Source #

infer_prices :: Lens' ReportOpts Bool Source #

interval :: Lens' ReportOpts Interval Source #

invert :: Lens' ReportOpts Bool Source #

layout :: Lens' ReportOpts Layout Source #

no_elide :: Lens' ReportOpts Bool Source #

no_total :: Lens' ReportOpts Bool Source #

normalbalance :: Lens' ReportOpts (Maybe NormalSign) Source #

percent :: Lens' ReportOpts Bool Source #

periodNoUpdate :: Lens' ReportOpts Period Source #

pretty :: Lens' ReportOpts Bool Source #

querystringNoUpdate :: Lens' ReportOpts [Text] Source #

realNoUpdate :: Lens' ReportOpts Bool Source #

related :: Lens' ReportOpts Bool Source #

row_total :: Lens' ReportOpts Bool Source #

show_costs :: Lens' ReportOpts Bool Source #

sort_amount :: Lens' ReportOpts Bool Source #

statusesNoUpdate :: Lens' ReportOpts [Status] Source #

transpose__ :: Lens' ReportOpts Bool Source #

txn_dates :: Lens' ReportOpts Bool Source #

value :: Lens' ReportOpts (Maybe ValuationType) Source #

HasReportOptsNoUpdate ReportSpec |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOptsNoUpdate :: Lens' ReportSpec ReportOpts Source #

accountlistmode :: Lens' ReportSpec AccountListMode Source #

average :: Lens' ReportSpec Bool Source #

balanceaccum :: Lens' ReportSpec BalanceAccumulation Source #

balancecalc :: Lens' ReportSpec BalanceCalculation Source #

budgetpat :: Lens' ReportSpec (Maybe Text) Source #

color__ :: Lens' ReportSpec Bool Source #

conversionop :: Lens' ReportSpec (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' ReportSpec Bool Source #

declared :: Lens' ReportSpec Bool Source #

depthNoUpdate :: Lens' ReportSpec (Maybe Int) Source #

drop__ :: Lens' ReportSpec Int Source #

empty__ :: Lens' ReportSpec Bool Source #

format :: Lens' ReportSpec StringFormat Source #

infer_prices :: Lens' ReportSpec Bool Source #

interval :: Lens' ReportSpec Interval Source #

invert :: Lens' ReportSpec Bool Source #

layout :: Lens' ReportSpec Layout Source #

no_elide :: Lens' ReportSpec Bool Source #

no_total :: Lens' ReportSpec Bool Source #

normalbalance :: Lens' ReportSpec (Maybe NormalSign) Source #

percent :: Lens' ReportSpec Bool Source #

periodNoUpdate :: Lens' ReportSpec Period Source #

pretty :: Lens' ReportSpec Bool Source #

querystringNoUpdate :: Lens' ReportSpec [Text] Source #

realNoUpdate :: Lens' ReportSpec Bool Source #

related :: Lens' ReportSpec Bool Source #

row_total :: Lens' ReportSpec Bool Source #

show_costs :: Lens' ReportSpec Bool Source #

sort_amount :: Lens' ReportSpec Bool Source #

statusesNoUpdate :: Lens' ReportSpec [Status] Source #

transpose__ :: Lens' ReportSpec Bool Source #

txn_dates :: Lens' ReportSpec Bool Source #

value :: Lens' ReportSpec (Maybe ValuationType) Source #

class HasReportOptsNoUpdate a => HasReportOpts a where Source #

Special lenses for ReportOpts which also update the Query and QueryOpts in ReportSpec. Note that these are not true lenses, as they have a further restriction on the functor. This will work as a normal lens for all common uses, but since they don't obey the lens laws for some fancy cases, they may fail in some exotic circumstances.

Note that setEither/overEither should only be necessary with querystring and reportOpts: the other lenses should never fail.

### Examples:

    >>> import Lens.Micro (set)
    >>> _rsQuery <$> setEither querystring ["assets"] defreportspec
    Right (Acct (RegexpCI "assets"))
    >>> _rsQuery <$> setEither querystring ["(assets"] defreportspec
    Left "This regular expression is malformed, please correct it:\n(assets"
    >>> _rsQuery $ set querystring ["assets"] defreportspec
    Acct (RegexpCI "assets")
    >>> _rsQuery $ set querystring ["(assets"] defreportspec
    *** Exception: Error: Updating ReportSpec failed: try using overEither instead of over or setEither instead of set
    >>> _rsQuery $ set period (MonthPeriod 2021 08) defreportspec
    Date DateSpan 2021-08

Minimal complete definition

Nothing

Methods

reportOpts :: ReportableLens' a ReportOpts Source #

period :: ReportableLens' a Period Source #

statuses :: ReportableLens' a [Status] Source #

depth :: ReportableLens' a (Maybe Int) Source #

date2 :: ReportableLens' a Bool Source #

real :: ReportableLens' a Bool Source #

querystring :: ReportableLens' a [Text] Source #

#### Instances

Instances details

HasReportOpts CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

reportOpts :: ReportableLens' CliOpts ReportOpts Source #

period :: ReportableLens' CliOpts Period Source #

statuses :: ReportableLens' CliOpts [Status] Source #

depth :: ReportableLens' CliOpts (Maybe Int) Source #

date2 :: ReportableLens' CliOpts Bool Source #

real :: ReportableLens' CliOpts Bool Source #

querystring :: ReportableLens' CliOpts [Text] Source #

HasReportOpts ReportOpts |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOpts :: ReportableLens' ReportOpts ReportOpts Source #

period :: ReportableLens' ReportOpts Period Source #

statuses :: ReportableLens' ReportOpts [Status] Source #

depth :: ReportableLens' ReportOpts (Maybe Int) Source #

date2 :: ReportableLens' ReportOpts Bool Source #

real :: ReportableLens' ReportOpts Bool Source #

querystring :: ReportableLens' ReportOpts [Text] Source #

HasReportOpts ReportSpec |

Instance details

Defined in Hledger.Reports.ReportOptions

Methods

reportOpts :: ReportableLens' ReportSpec ReportOpts Source #

period :: ReportableLens' ReportSpec Period Source #

statuses :: ReportableLens' ReportSpec [Status] Source #

depth :: ReportableLens' ReportSpec (Maybe Int) Source #

date2 :: ReportableLens' ReportSpec Bool Source #

real :: ReportableLens' ReportSpec Bool Source #

querystring :: ReportableLens' ReportSpec [Text] Source #

class HasReportSpec c where Source #

Minimal complete definition

reportSpec

Methods

reportSpec :: Lens' c ReportSpec Source #

rsDay :: Lens' c Day Source #

rsQuery :: Lens' c Query Source #

rsQueryOpts :: Lens' c [QueryOpt] Source #

rsReportOpts :: Lens' c ReportOpts Source #

#### Instances

Instances details

HasReportSpec CliOpts Source # |
Instance details Defined in Hledger.Cli.CliOptions Methods reportSpec :: Lens' CliOpts ReportSpec Source # rsDay :: Lens' CliOpts Day Source # rsQuery :: Lens' CliOpts Query Source # rsQueryOpts :: Lens' CliOpts [QueryOpt] Source # rsReportOpts :: Lens' CliOpts ReportOpts Source #
HasReportSpec ReportSpec |
Instance details Defined in Hledger.Reports.ReportOptions Methods reportSpec :: Lens' ReportSpec ReportSpec Source # rsDay :: Lens' ReportSpec Day Source # rsQuery :: Lens' ReportSpec Query Source # rsQueryOpts :: Lens' ReportSpec [QueryOpt] Source # rsReportOpts :: Lens' ReportSpec ReportOpts Source #

data DisplayName Source #

A full name, display name, and depth for an account.

Constructors

DisplayName |

Fields

- displayFull :: AccountName
- displayName :: AccountName
- displayDepth :: Int

#### Instances

Instances details

ToJSON DisplayName |
Instance details Defined in Hledger.Reports.ReportTypes Methods toJSON :: DisplayName -> Value Source # toEncoding :: DisplayName -> Encoding Source # toJSONList :: [DisplayName] -> Value Source # toEncodingList :: [DisplayName] -> Encoding Source #
Show DisplayName |
Instance details Defined in Hledger.Reports.ReportTypes Methods showsPrec :: Int -> DisplayName -> ShowS Source # show :: DisplayName -> String Source # showList :: [DisplayName] -> ShowS Source #
Eq DisplayName |
Instance details Defined in Hledger.Reports.ReportTypes Methods (==) :: DisplayName -> DisplayName -> Bool Source # (/=) :: DisplayName -> DisplayName -> Bool Source #
Ord DisplayName |

Instance details

Defined in Hledger.Reports.ReportTypes

Methods

compare :: DisplayName -> DisplayName -> Ordering Source #

(<) :: DisplayName -> DisplayName -> Bool Source #

(<=) :: DisplayName -> DisplayName -> Bool Source #

(>) :: DisplayName -> DisplayName -> Bool Source #

(>=) :: DisplayName -> DisplayName -> Bool Source #

max :: DisplayName -> DisplayName -> DisplayName Source #

min :: DisplayName -> DisplayName -> DisplayName Source #

data CBCSubreportSpec a Source #

Description of one subreport within a compound balance report. Part of a CompoundBalanceCommandSpec, but also used in hledger-lib.

Constructors

CBCSubreportSpec |

Fields

- cbcsubreporttitle :: Text

  The title to use for the subreport

- cbcsubreportquery :: Query

  The Query to use for the subreport

- cbcsubreportoptions :: ReportOpts -> ReportOpts

  A function to transform the ReportOpts used to produce the subreport

- cbcsubreporttransform :: PeriodicReport DisplayName MixedAmount -> PeriodicReport a MixedAmount

  A function to transform the result of the subreport

- cbcsubreportincreasestotal :: Bool

  Whether the subreport and overall report total are of the same sign (e.g. Assets are normally positive in a balance sheet report, as is the overall total. Liabilities are normally of the opposite sign.)

data CompoundPeriodicReport a b Source #

A compound balance report has:

- an overall title
- the period (date span) of each column
- one or more named, normal-positive multi balance reports, with columns corresponding to the above, and a flag indicating whether they increased or decreased the overall totals
- a list of overall totals for each column, and their grand total and average

It is used in compound balance report commands like balancesheet, cashflow and incomestatement.

Constructors

CompoundPeriodicReport |

Fields

- cbrTitle :: Text
- cbrDates :: [DateSpan]
- cbrSubreports :: [(Text, PeriodicReport a b, Bool)]
- cbrTotals :: PeriodicReportRow () b

#### Instances

Instances details

Functor (CompoundPeriodicReport a) |
Instance details Defined in Hledger.Reports.ReportTypes Methods fmap :: (a0 -> b) -> CompoundPeriodicReport a a0 -> CompoundPeriodicReport a b Source # (<$) :: a0 -> CompoundPeriodicReport a b -> CompoundPeriodicReport a a0 Source #
(ToJSON b, ToJSON a) => ToJSON (CompoundPeriodicReport a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods toJSON :: CompoundPeriodicReport a b -> Value Source # toEncoding :: CompoundPeriodicReport a b -> Encoding Source # toJSONList :: [CompoundPeriodicReport a b] -> Value Source # toEncodingList :: [CompoundPeriodicReport a b] -> Encoding Source #
Generic (CompoundPeriodicReport a b) |
Instance details Defined in Hledger.Reports.ReportTypes Associated Types type Rep (CompoundPeriodicReport a b) :: Type -> Type Source # Methods from :: CompoundPeriodicReport a b -> Rep (CompoundPeriodicReport a b) x Source # to :: Rep (CompoundPeriodicReport a b) x -> CompoundPeriodicReport a b Source #
(Show a, Show b) => Show (CompoundPeriodicReport a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods showsPrec :: Int -> CompoundPeriodicReport a b -> ShowS Source # show :: CompoundPeriodicReport a b -> String Source # showList :: [CompoundPeriodicReport a b] -> ShowS Source #
type Rep (CompoundPeriodicReport a b) |

Instance details

Defined in Hledger.Reports.ReportTypes

type Rep (CompoundPeriodicReport a b) = D1 ('MetaData "CompoundPeriodicReport" "Hledger.Reports.ReportTypes" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "CompoundPeriodicReport" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cbrTitle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "cbrDates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [DateSpan])) :*: (S1 ('MetaSel ('Just "cbrSubreports") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, PeriodicReport a b, Bool)]) :*: S1 ('MetaSel ('Just "cbrTotals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PeriodicReportRow () b)))))

data PeriodicReportRow a b Source #

Constructors

PeriodicReportRow |

Fields

- prrName :: a
- prrAmounts :: [b]
- prrTotal :: b
- prrAverage :: b

#### Instances

Instances details

Bifunctor PeriodicReportRow |
Instance details Defined in Hledger.Reports.ReportTypes Methods bimap :: (a -> b) -> (c -> d) -> PeriodicReportRow a c -> PeriodicReportRow b d Source # first :: (a -> b) -> PeriodicReportRow a c -> PeriodicReportRow b c Source # second :: (b -> c) -> PeriodicReportRow a b -> PeriodicReportRow a c Source #
Functor (PeriodicReportRow a) |
Instance details Defined in Hledger.Reports.ReportTypes Methods fmap :: (a0 -> b) -> PeriodicReportRow a a0 -> PeriodicReportRow a b Source # (<$) :: a0 -> PeriodicReportRow a b -> PeriodicReportRow a a0 Source #
(ToJSON b, ToJSON a) => ToJSON (PeriodicReportRow a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods toJSON :: PeriodicReportRow a b -> Value Source # toEncoding :: PeriodicReportRow a b -> Encoding Source # toJSONList :: [PeriodicReportRow a b] -> Value Source # toEncodingList :: [PeriodicReportRow a b] -> Encoding Source #
Semigroup b => Semigroup (PeriodicReportRow a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods (<>) :: PeriodicReportRow a b -> PeriodicReportRow a b -> PeriodicReportRow a b Source # sconcat :: NonEmpty (PeriodicReportRow a b) -> PeriodicReportRow a b Source # stimes :: Integral b0 => b0 -> PeriodicReportRow a b -> PeriodicReportRow a b Source #
Generic (PeriodicReportRow a b) |
Instance details Defined in Hledger.Reports.ReportTypes Associated Types type Rep (PeriodicReportRow a b) :: Type -> Type Source # Methods from :: PeriodicReportRow a b -> Rep (PeriodicReportRow a b) x Source # to :: Rep (PeriodicReportRow a b) x -> PeriodicReportRow a b Source #
(Show a, Show b) => Show (PeriodicReportRow a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods showsPrec :: Int -> PeriodicReportRow a b -> ShowS Source # show :: PeriodicReportRow a b -> String Source # showList :: [PeriodicReportRow a b] -> ShowS Source #
type Rep (PeriodicReportRow a b) |

Instance details

Defined in Hledger.Reports.ReportTypes

type Rep (PeriodicReportRow a b) = D1 ('MetaData "PeriodicReportRow" "Hledger.Reports.ReportTypes" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "PeriodicReportRow" 'PrefixI 'True) ((S1 ('MetaSel ('Just "prrName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "prrAmounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [b])) :*: (S1 ('MetaSel ('Just "prrTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b) :*: S1 ('MetaSel ('Just "prrAverage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b))))

data PeriodicReport a b Source #

A periodic report is a generic tabular report, where each row corresponds to some label (usually an account name) and each column to a date period. The column periods are usually consecutive subperiods formed by splitting the overall report period by some report interval (daily, weekly, etc.). It has:

1. a list of each column's period (date span)
2. a list of rows, each containing:

- an account label
- the account's depth
- A list of amounts, one for each column. Depending on the value type, these can represent balance changes, ending balances, budget performance, etc. (for example, see `BalanceAccumulation` and Hledger.Cli.Commands.Balance).
- the total of the row's amounts for a periodic report, or zero for cumulative/historical reports (since summing end balances generally doesn't make sense).
- the average of the row's amounts

1. the column totals, and the overall grand total (or zero for cumulative/historical reports) and grand average.

Constructors

PeriodicReport |

Fields

- prDates :: [DateSpan]
- prRows :: [PeriodicReportRow a b]
- prTotals :: PeriodicReportRow () b

#### Instances

Instances details

Bifunctor PeriodicReport |
Instance details Defined in Hledger.Reports.ReportTypes Methods bimap :: (a -> b) -> (c -> d) -> PeriodicReport a c -> PeriodicReport b d Source # first :: (a -> b) -> PeriodicReport a c -> PeriodicReport b c Source # second :: (b -> c) -> PeriodicReport a b -> PeriodicReport a c Source #
Functor (PeriodicReport a) |
Instance details Defined in Hledger.Reports.ReportTypes Methods fmap :: (a0 -> b) -> PeriodicReport a a0 -> PeriodicReport a b Source # (<$) :: a0 -> PeriodicReport a b -> PeriodicReport a a0 Source #
(ToJSON a, ToJSON b) => ToJSON (PeriodicReport a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods toJSON :: PeriodicReport a b -> Value Source # toEncoding :: PeriodicReport a b -> Encoding Source # toJSONList :: [PeriodicReport a b] -> Value Source # toEncodingList :: [PeriodicReport a b] -> Encoding Source #
Generic (PeriodicReport a b) |
Instance details Defined in Hledger.Reports.ReportTypes Associated Types type Rep (PeriodicReport a b) :: Type -> Type Source # Methods from :: PeriodicReport a b -> Rep (PeriodicReport a b) x Source # to :: Rep (PeriodicReport a b) x -> PeriodicReport a b Source #
(Show a, Show b) => Show (PeriodicReport a b) |
Instance details Defined in Hledger.Reports.ReportTypes Methods showsPrec :: Int -> PeriodicReport a b -> ShowS Source # show :: PeriodicReport a b -> String Source # showList :: [PeriodicReport a b] -> ShowS Source #
type Rep (PeriodicReport a b) |

Instance details

Defined in Hledger.Reports.ReportTypes

type Rep (PeriodicReport a b) = D1 ('MetaData "PeriodicReport" "Hledger.Reports.ReportTypes" "hledger-lib-1.30-IFfdvBhLqTIF6Hc6bQ0Jhe" 'False) (C1 ('MetaCons "PeriodicReport" 'PrefixI 'True) (S1 ('MetaSel ('Just "prDates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [DateSpan]) :*: (S1 ('MetaSel ('Just "prRows") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PeriodicReportRow a b]) :*: S1 ('MetaSel ('Just "prTotals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PeriodicReportRow () b)))))

type Average Source #

Arguments

= MixedAmount | The average of `Change`s or `Balance`s in a report or report row.

type Total Source #

Arguments

= MixedAmount | The sum of `Change`s in a report or a report row. Does not make sense for `Balance`s.

type Balance Source #

Arguments

= MixedAmount | An ending balance as of some date.

type Percentage = Decimal Source #

type PostingsReportItem = (Maybe Day, Maybe Period, Maybe Text, Posting, MixedAmount) Source #

type PostingsReport = [PostingsReportItem] Source #

A postings report is a list of postings with a running total, and a little extra transaction info to help with rendering. This is used eg for the register command.

type MultiBalanceReportRow = PeriodicReportRow DisplayName MixedAmount Source #

type MultiBalanceReport = PeriodicReport DisplayName MixedAmount Source #

A multi balance report is a kind of periodic report, where the amounts correspond to balance changes or ending balances in a given period. It has:

1. a list of each column's period (date span)
2. a list of rows, each containing:

- the full account name, display name, and display depth
- A list of amounts, one for each column.
- the total of the row's amounts for a periodic report
- the average of the row's amounts

1. the column totals, and the overall grand total (or zero for cumulative/historical reports) and grand average.

type EntriesReportItem = Transaction Source #

type EntriesReport = [EntriesReportItem] Source #

A journal entries report is a list of whole transactions as originally entered in the journal (mostly). This is used by eg hledger's print command and hledger-web's journal entries view.

type BudgetReport = PeriodicReport DisplayName BudgetCell Source #

type BudgetReportRow = PeriodicReportRow DisplayName BudgetCell Source #

type BudgetCell = (Maybe Change, Maybe BudgetGoal) Source #

A budget report tracks expected and actual changes per account and subperiod.

type BudgetAverage = Average Source #

type BudgetTotal = Total Source #

type BudgetGoal = Change Source #

type BalanceReportItem = (AccountName, AccountName, Int, MixedAmount) Source #

type BalanceReport = ([BalanceReportItem], MixedAmount) Source #

A simple balance report. It has:

1. a list of items, one per account, each containing:

- the full account name
- the Ledger-style elided short account name (the leaf account name, prefixed by any boring parents immediately above); or with --flat, the full account name again
- the number of indentation steps for rendering a Ledger-style account tree, taking into account elided boring parents, --no-elide and --flat
- an amount

1. the total of all amounts

type AccountTransactionsReportItem = (Transaction, Transaction, Bool, Text, MixedAmount, MixedAmount) Source #

type AccountTransactionsReport = [AccountTransactionsReportItem] Source #

An account transactions report represents transactions affecting a particular account (or possibly several accounts, but we don't use that). It is used eg by hledger-ui's and hledger-web's register view, and hledger's aregister report, where we want to show one row per transaction, in the context of the current account. Report items consist of:

- the transaction, unmodified
- the transaction as seen in the context of the current account and query, which means:
- the transaction date is set to the "transaction context date": the earliest of the transaction date and any other posting dates of postings to the current account (matched by the report query).
- the transaction's postings are filtered, excluding any which are not matched by the report query
- a text description of the other account(s) posted to/from
- a flag indicating whether there's more than one other account involved
- the total increase/decrease to the current account
- the report transactions' running total after this transaction; or if historical balance is requested (-H), the historical running total. The historical running total includes transactions from before the report start date if one is specified, filtered by the report query. The historical running total may or may not be the account's historical running balance, depending on the report query.

Items are sorted by transaction register date (the earliest date the transaction posts to the current account), most recent first. Reporting intervals are currently ignored.

type PrefixedFilePath = FilePath Source #

A file path optionally prefixed by a reader name and colon (journal:, csv:, timedot:, etc.).

type Assertion = IO () #

type AssertionPredicate = IO Bool #

class Assertable t where #

Methods

assert :: t -> Assertion #

#### Instances

Instances details

Assertable String |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assert :: String -> Assertion #
Assertable () |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assert :: () -> Assertion #
Assertable Bool |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assert :: Bool -> Assertion #
Assertable t => Assertable (IO t) |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assert :: IO t -> Assertion #

data HUnitFailure #

Constructors

HUnitFailure (Maybe SrcLoc) String |

#### Instances

Instances details

Exception HUnitFailure |
Instance details Defined in Test.Tasty.HUnit.Orig Methods toException :: HUnitFailure -> SomeException Source # fromException :: SomeException -> Maybe HUnitFailure Source # displayException :: HUnitFailure -> String Source #
Show HUnitFailure |
Instance details Defined in Test.Tasty.HUnit.Orig Methods showsPrec :: Int -> HUnitFailure -> ShowS Source # show :: HUnitFailure -> String Source # showList :: [HUnitFailure] -> ShowS Source #
Eq HUnitFailure |
Instance details Defined in Test.Tasty.HUnit.Orig Methods (==) :: HUnitFailure -> HUnitFailure -> Bool Source # (/=) :: HUnitFailure -> HUnitFailure -> Bool Source #

class AssertionPredicable t where #

Methods

assertionPredicate :: t -> IO Bool #

#### Instances

Instances details

AssertionPredicable Bool |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assertionPredicate :: Bool -> IO Bool #
AssertionPredicable t => AssertionPredicable (IO t) |
Instance details Defined in Test.Tasty.HUnit.Orig Methods assertionPredicate :: IO t -> IO Bool #

data CalendarDiffDays Source #

Constructors

CalendarDiffDays |

Fields

- cdMonths :: Integer
- cdDays :: Integer

#### Instances

Instances details

FromJSON CalendarDiffDays |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser CalendarDiffDays Source # parseJSONList :: Value -> Parser [CalendarDiffDays] Source #
ToJSON CalendarDiffDays |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: CalendarDiffDays -> Value Source # toEncoding :: CalendarDiffDays -> Encoding Source # toJSONList :: [CalendarDiffDays] -> Value Source # toEncodingList :: [CalendarDiffDays] -> Encoding Source #
Data CalendarDiffDays | Since: time-1.9.2

Instance details

Defined in Data.Time.Calendar.CalendarDiffDays

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CalendarDiffDays -> c CalendarDiffDays Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CalendarDiffDays Source #

toConstr :: CalendarDiffDays -> Constr Source #

dataTypeOf :: CalendarDiffDays -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CalendarDiffDays) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CalendarDiffDays) Source #

gmapT :: (forall b. Data b => b -> b) -> CalendarDiffDays -> CalendarDiffDays Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffDays -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffDays -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CalendarDiffDays -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CalendarDiffDays -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CalendarDiffDays -> m CalendarDiffDays Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffDays -> m CalendarDiffDays Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffDays -> m CalendarDiffDays Source #

Monoid CalendarDiffDays | Additive
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods mempty :: CalendarDiffDays Source # mappend :: CalendarDiffDays -> CalendarDiffDays -> CalendarDiffDays Source # mconcat :: [CalendarDiffDays] -> CalendarDiffDays Source #
Semigroup CalendarDiffDays | Additive
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods (<>) :: CalendarDiffDays -> CalendarDiffDays -> CalendarDiffDays Source # sconcat :: NonEmpty CalendarDiffDays -> CalendarDiffDays Source # stimes :: Integral b => b -> CalendarDiffDays -> CalendarDiffDays Source #
Show CalendarDiffDays |
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods showsPrec :: Int -> CalendarDiffDays -> ShowS Source # show :: CalendarDiffDays -> String Source # showList :: [CalendarDiffDays] -> ShowS Source #
NFData CalendarDiffDays |
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods rnf :: CalendarDiffDays -> () Source #
Eq CalendarDiffDays |
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods (==) :: CalendarDiffDays -> CalendarDiffDays -> Bool Source # (/=) :: CalendarDiffDays -> CalendarDiffDays -> Bool Source #

type MonthOfYear = Int Source #

Month of year, in range 1 (January) to 12 (December).

data DayOfWeek Source #

Constructors

Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
Sunday |

#### Instances

Instances details

FromJSON DayOfWeek |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser DayOfWeek Source # parseJSONList :: Value -> Parser [DayOfWeek] Source #
FromJSONKey DayOfWeek |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction DayOfWeek Source # fromJSONKeyList :: FromJSONKeyFunction [DayOfWeek] Source #
ToJSON DayOfWeek |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: DayOfWeek -> Value Source # toEncoding :: DayOfWeek -> Encoding Source # toJSONList :: [DayOfWeek] -> Value Source # toEncodingList :: [DayOfWeek] -> Encoding Source #
ToJSONKey DayOfWeek |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction DayOfWeek Source # toJSONKeyList :: ToJSONKeyFunction [DayOfWeek] Source #
Data DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DayOfWeek -> c DayOfWeek Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DayOfWeek Source #

toConstr :: DayOfWeek -> Constr Source #

dataTypeOf :: DayOfWeek -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DayOfWeek) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DayOfWeek) Source #

gmapT :: (forall b. Data b => b -> b) -> DayOfWeek -> DayOfWeek Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DayOfWeek -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DayOfWeek -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DayOfWeek -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DayOfWeek -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek Source #

Enum DayOfWeek | "Circular", so for example `[Tuesday ..]` gives an endless sequence. Also: `fromEnum` gives [1 .. 7] for [Monday .. Sunday], and `toEnum` performs mod 7 to give a cycle of days.

Instance details

Defined in Data.Time.Calendar.Week

Methods

succ :: DayOfWeek -> DayOfWeek Source #

pred :: DayOfWeek -> DayOfWeek Source #

toEnum :: Int -> DayOfWeek Source #

fromEnum :: DayOfWeek -> Int Source #

enumFrom :: DayOfWeek -> [DayOfWeek] Source #

enumFromThen :: DayOfWeek -> DayOfWeek -> [DayOfWeek] Source #

enumFromTo :: DayOfWeek -> DayOfWeek -> [DayOfWeek] Source #

enumFromThenTo :: DayOfWeek -> DayOfWeek -> DayOfWeek -> [DayOfWeek] Source #

Ix DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

range :: (DayOfWeek, DayOfWeek) -> [DayOfWeek] Source #

index :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Int Source #

unsafeIndex :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Int Source #

inRange :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Bool Source #

rangeSize :: (DayOfWeek, DayOfWeek) -> Int Source #

unsafeRangeSize :: (DayOfWeek, DayOfWeek) -> Int Source #

Read DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods readsPrec :: Int -> ReadS DayOfWeek Source # readList :: ReadS [DayOfWeek] Source # readPrec :: ReadPrec DayOfWeek Source # readListPrec :: ReadPrec [DayOfWeek] Source #
Show DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods showsPrec :: Int -> DayOfWeek -> ShowS Source # show :: DayOfWeek -> String Source # showList :: [DayOfWeek] -> ShowS Source #
NFData DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods rnf :: DayOfWeek -> () Source #
Eq DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods (==) :: DayOfWeek -> DayOfWeek -> Bool Source # (/=) :: DayOfWeek -> DayOfWeek -> Bool Source #
Ord DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

compare :: DayOfWeek -> DayOfWeek -> Ordering Source #

(<) :: DayOfWeek -> DayOfWeek -> Bool Source #

(<=) :: DayOfWeek -> DayOfWeek -> Bool Source #

(>) :: DayOfWeek -> DayOfWeek -> Bool Source #

(>=) :: DayOfWeek -> DayOfWeek -> Bool Source #

max :: DayOfWeek -> DayOfWeek -> DayOfWeek Source #

min :: DayOfWeek -> DayOfWeek -> DayOfWeek Source #

data DiffTime Source #

This is a length of time, as measured by a clock. Conversion functions such as `fromInteger` and `realToFrac` will treat it as seconds. For example, `(0.010 :: DiffTime)` corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

#### Instances

Instances details

FromJSON DiffTime | This instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype `Scientific` and provide your own instance using `withScientific` if you want to allow larger inputs.
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser DiffTime Source # parseJSONList :: Value -> Parser [DiffTime] Source #
ToJSON DiffTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: DiffTime -> Value Source # toEncoding :: DiffTime -> Encoding Source # toJSONList :: [DiffTime] -> Value Source # toEncodingList :: [DiffTime] -> Encoding Source #
Data DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime Source #

toConstr :: DiffTime -> Constr Source #

dataTypeOf :: DiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

Enum DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

succ :: DiffTime -> DiffTime Source #

pred :: DiffTime -> DiffTime Source #

toEnum :: Int -> DiffTime Source #

fromEnum :: DiffTime -> Int Source #

enumFrom :: DiffTime -> [DiffTime] Source #

enumFromThen :: DiffTime -> DiffTime -> [DiffTime] Source #

enumFromTo :: DiffTime -> DiffTime -> [DiffTime] Source #

enumFromThenTo :: DiffTime -> DiffTime -> DiffTime -> [DiffTime] Source #

Num DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (+) :: DiffTime -> DiffTime -> DiffTime Source # (-) :: DiffTime -> DiffTime -> DiffTime Source # (*) :: DiffTime -> DiffTime -> DiffTime Source # negate :: DiffTime -> DiffTime Source # abs :: DiffTime -> DiffTime Source # signum :: DiffTime -> DiffTime Source # fromInteger :: Integer -> DiffTime Source #
Read DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods readsPrec :: Int -> ReadS DiffTime Source # readList :: ReadS [DiffTime] Source # readPrec :: ReadPrec DiffTime Source # readListPrec :: ReadPrec [DiffTime] Source #
Fractional DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (/) :: DiffTime -> DiffTime -> DiffTime Source # recip :: DiffTime -> DiffTime Source # fromRational :: Rational -> DiffTime Source #
Real DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods toRational :: DiffTime -> Rational Source #
RealFrac DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods properFraction :: Integral b => DiffTime -> (b, DiffTime) Source # truncate :: Integral b => DiffTime -> b Source # round :: Integral b => DiffTime -> b Source # ceiling :: Integral b => DiffTime -> b Source # floor :: Integral b => DiffTime -> b Source #
Show DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods showsPrec :: Int -> DiffTime -> ShowS Source # show :: DiffTime -> String Source # showList :: [DiffTime] -> ShowS Source #
NFData DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods rnf :: DiffTime -> () Source #
Eq DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (==) :: DiffTime -> DiffTime -> Bool Source # (/=) :: DiffTime -> DiffTime -> Bool Source #
Ord DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

compare :: DiffTime -> DiffTime -> Ordering Source #

(<) :: DiffTime -> DiffTime -> Bool Source #

(<=) :: DiffTime -> DiffTime -> Bool Source #

(>) :: DiffTime -> DiffTime -> Bool Source #

(>=) :: DiffTime -> DiffTime -> Bool Source #

max :: DiffTime -> DiffTime -> DiffTime Source #

min :: DiffTime -> DiffTime -> DiffTime Source #

data NominalDiffTime Source #

This is a length of time, as measured by UTC. It has a precision of 10^-12 s.

Conversion functions such as `fromInteger` and `realToFrac` will treat it as seconds. For example, `(0.010 :: NominalDiffTime)` corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

#### Instances

Instances details

FromJSON NominalDiffTime | This instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype `Scientific` and provide your own instance using `withScientific` if you want to allow larger inputs.
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser NominalDiffTime Source # parseJSONList :: Value -> Parser [NominalDiffTime] Source #
ToJSON NominalDiffTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: NominalDiffTime -> Value Source # toEncoding :: NominalDiffTime -> Encoding Source # toJSONList :: [NominalDiffTime] -> Value Source # toEncodingList :: [NominalDiffTime] -> Encoding Source #
Data NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime Source #

toConstr :: NominalDiffTime -> Constr Source #

dataTypeOf :: NominalDiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

Enum NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

succ :: NominalDiffTime -> NominalDiffTime Source #

pred :: NominalDiffTime -> NominalDiffTime Source #

toEnum :: Int -> NominalDiffTime Source #

fromEnum :: NominalDiffTime -> Int Source #

enumFrom :: NominalDiffTime -> [NominalDiffTime] Source #

enumFromThen :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

enumFromTo :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

enumFromThenTo :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

Num NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

(+) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

(-) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

(*) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

negate :: NominalDiffTime -> NominalDiffTime Source #

abs :: NominalDiffTime -> NominalDiffTime Source #

signum :: NominalDiffTime -> NominalDiffTime Source #

fromInteger :: Integer -> NominalDiffTime Source #

Read NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods readsPrec :: Int -> ReadS NominalDiffTime Source # readList :: ReadS [NominalDiffTime] Source # readPrec :: ReadPrec NominalDiffTime Source # readListPrec :: ReadPrec [NominalDiffTime] Source #
Fractional NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (/) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source # recip :: NominalDiffTime -> NominalDiffTime Source # fromRational :: Rational -> NominalDiffTime Source #
Real NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods toRational :: NominalDiffTime -> Rational Source #
RealFrac NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods properFraction :: Integral b => NominalDiffTime -> (b, NominalDiffTime) Source # truncate :: Integral b => NominalDiffTime -> b Source # round :: Integral b => NominalDiffTime -> b Source # ceiling :: Integral b => NominalDiffTime -> b Source # floor :: Integral b => NominalDiffTime -> b Source #
Show NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods showsPrec :: Int -> NominalDiffTime -> ShowS Source # show :: NominalDiffTime -> String Source # showList :: [NominalDiffTime] -> ShowS Source #
NFData NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods rnf :: NominalDiffTime -> () Source #
Eq NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (==) :: NominalDiffTime -> NominalDiffTime -> Bool Source # (/=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #
Ord NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

compare :: NominalDiffTime -> NominalDiffTime -> Ordering Source #

(<) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(<=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

max :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

min :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

newtype UniversalTime Source #

The Modified Julian Date is the day with the fraction of the day, measured from UT midnight. It's used to represent UT1, which is time as measured by the earth's rotation, adjusted for various wobbles.

Constructors

ModJulianDate |

Fields

- getModJulianDate :: Rational

#### Instances

Instances details

Data UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniversalTime -> c UniversalTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UniversalTime Source #

toConstr :: UniversalTime -> Constr Source #

dataTypeOf :: UniversalTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UniversalTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UniversalTime) Source #

gmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UniversalTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniversalTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

NFData UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods rnf :: UniversalTime -> () Source #
Eq UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods (==) :: UniversalTime -> UniversalTime -> Bool Source # (/=) :: UniversalTime -> UniversalTime -> Bool Source #
Ord UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

compare :: UniversalTime -> UniversalTime -> Ordering Source #

(<) :: UniversalTime -> UniversalTime -> Bool Source #

(<=) :: UniversalTime -> UniversalTime -> Bool Source #

(>) :: UniversalTime -> UniversalTime -> Bool Source #

(>=) :: UniversalTime -> UniversalTime -> Bool Source #

max :: UniversalTime -> UniversalTime -> UniversalTime Source #

min :: UniversalTime -> UniversalTime -> UniversalTime Source #

data CalendarDiffTime Source #

Constructors

CalendarDiffTime |

Fields

- ctMonths :: Integer
- ctTime :: NominalDiffTime

#### Instances

Instances details

FromJSON CalendarDiffTime |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser CalendarDiffTime Source # parseJSONList :: Value -> Parser [CalendarDiffTime] Source #
ToJSON CalendarDiffTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: CalendarDiffTime -> Value Source # toEncoding :: CalendarDiffTime -> Encoding Source # toJSONList :: [CalendarDiffTime] -> Value Source # toEncodingList :: [CalendarDiffTime] -> Encoding Source #
Data CalendarDiffTime | Since: time-1.9.2

Instance details

Defined in Data.Time.LocalTime.Internal.CalendarDiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CalendarDiffTime -> c CalendarDiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CalendarDiffTime Source #

toConstr :: CalendarDiffTime -> Constr Source #

dataTypeOf :: CalendarDiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CalendarDiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CalendarDiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> CalendarDiffTime -> CalendarDiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CalendarDiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CalendarDiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CalendarDiffTime -> m CalendarDiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffTime -> m CalendarDiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffTime -> m CalendarDiffTime Source #

Monoid CalendarDiffTime | Additive
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods mempty :: CalendarDiffTime Source # mappend :: CalendarDiffTime -> CalendarDiffTime -> CalendarDiffTime Source # mconcat :: [CalendarDiffTime] -> CalendarDiffTime Source #
Semigroup CalendarDiffTime | Additive
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods (<>) :: CalendarDiffTime -> CalendarDiffTime -> CalendarDiffTime Source # sconcat :: NonEmpty CalendarDiffTime -> CalendarDiffTime Source # stimes :: Integral b => b -> CalendarDiffTime -> CalendarDiffTime Source #
Show CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods showsPrec :: Int -> CalendarDiffTime -> ShowS Source # show :: CalendarDiffTime -> String Source # showList :: [CalendarDiffTime] -> ShowS Source #
NFData CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods rnf :: CalendarDiffTime -> () Source #
Eq CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods (==) :: CalendarDiffTime -> CalendarDiffTime -> Bool Source # (/=) :: CalendarDiffTime -> CalendarDiffTime -> Bool Source #

data TimeZone Source #

A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.

Constructors

TimeZone |

Fields

- timeZoneMinutes :: Int

  The number of minutes offset from UTC. Positive means local time will be later in the day than UTC.

- timeZoneSummerOnly :: Bool

  Is this time zone just persisting for the summer?

- timeZoneName :: String

  The name of the zone, typically a three- or four-letter acronym.

#### Instances

Instances details

Data TimeZone |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeZone

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeZone -> c TimeZone Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TimeZone Source #

toConstr :: TimeZone -> Constr Source #

dataTypeOf :: TimeZone -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TimeZone) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TimeZone) Source #

gmapT :: (forall b. Data b => b -> b) -> TimeZone -> TimeZone Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeZone -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeZone -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TimeZone -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeZone -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone Source #

Show TimeZone | This only shows the time zone name, or offset if the name is empty.
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods showsPrec :: Int -> TimeZone -> ShowS Source # show :: TimeZone -> String Source # showList :: [TimeZone] -> ShowS Source #
NFData TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods rnf :: TimeZone -> () Source #
Eq TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods (==) :: TimeZone -> TimeZone -> Bool Source # (/=) :: TimeZone -> TimeZone -> Bool Source #
Ord TimeZone |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeZone

Methods

compare :: TimeZone -> TimeZone -> Ordering Source #

(<) :: TimeZone -> TimeZone -> Bool Source #

(<=) :: TimeZone -> TimeZone -> Bool Source #

(>) :: TimeZone -> TimeZone -> Bool Source #

(>=) :: TimeZone -> TimeZone -> Bool Source #

max :: TimeZone -> TimeZone -> TimeZone Source #

min :: TimeZone -> TimeZone -> TimeZone Source #

data TimeOfDay Source #

Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.

`TimeOfDay 24 0 0` is considered invalid for the purposes of `makeTimeOfDayValid`, as well as reading and parsing, but valid for ISO 8601 parsing in Data.Time.Format.ISO8601.

Constructors

TimeOfDay |

Fields

- todHour :: Int

  range 0 - 23

- todMin :: Int

  range 0 - 59

- todSec :: Pico

  Note that 0 <= `todSec` < 61, accomodating leap seconds. Any local minute may have a leap second, since leap seconds happen in all zones simultaneously

#### Instances

Instances details

FromJSON TimeOfDay |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser TimeOfDay Source # parseJSONList :: Value -> Parser [TimeOfDay] Source #
FromJSONKey TimeOfDay |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction TimeOfDay Source # fromJSONKeyList :: FromJSONKeyFunction [TimeOfDay] Source #
ToJSON TimeOfDay |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: TimeOfDay -> Value Source # toEncoding :: TimeOfDay -> Encoding Source # toJSONList :: [TimeOfDay] -> Value Source # toEncodingList :: [TimeOfDay] -> Encoding Source #
ToJSONKey TimeOfDay |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction TimeOfDay Source # toJSONKeyList :: ToJSONKeyFunction [TimeOfDay] Source #
Data TimeOfDay |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeOfDay

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeOfDay -> c TimeOfDay Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TimeOfDay Source #

toConstr :: TimeOfDay -> Constr Source #

dataTypeOf :: TimeOfDay -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TimeOfDay) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TimeOfDay) Source #

gmapT :: (forall b. Data b => b -> b) -> TimeOfDay -> TimeOfDay Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeOfDay -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeOfDay -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TimeOfDay -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeOfDay -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay Source #

Show TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods showsPrec :: Int -> TimeOfDay -> ShowS Source # show :: TimeOfDay -> String Source # showList :: [TimeOfDay] -> ShowS Source #
NFData TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods rnf :: TimeOfDay -> () Source #
Eq TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods (==) :: TimeOfDay -> TimeOfDay -> Bool Source # (/=) :: TimeOfDay -> TimeOfDay -> Bool Source #
Ord TimeOfDay |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeOfDay

Methods

compare :: TimeOfDay -> TimeOfDay -> Ordering Source #

(<) :: TimeOfDay -> TimeOfDay -> Bool Source #

(<=) :: TimeOfDay -> TimeOfDay -> Bool Source #

(>) :: TimeOfDay -> TimeOfDay -> Bool Source #

(>=) :: TimeOfDay -> TimeOfDay -> Bool Source #

max :: TimeOfDay -> TimeOfDay -> TimeOfDay Source #

min :: TimeOfDay -> TimeOfDay -> TimeOfDay Source #

data LocalTime Source #

A simple day and time aggregate, where the day is of the specified parameter, and the time is a TimeOfDay. Conversion of this (as local civil time) to UTC depends on the time zone. Conversion of this (as local mean time) to UT1 depends on the longitude.

Constructors

LocalTime |

Fields

- localDay :: Day
- localTimeOfDay :: TimeOfDay

#### Instances

Instances details

FromJSON LocalTime |
Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser LocalTime Source # parseJSONList :: Value -> Parser [LocalTime] Source #
FromJSONKey LocalTime |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction LocalTime Source # fromJSONKeyList :: FromJSONKeyFunction [LocalTime] Source #
ToJSON LocalTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: LocalTime -> Value Source # toEncoding :: LocalTime -> Encoding Source # toJSONList :: [LocalTime] -> Value Source # toEncodingList :: [LocalTime] -> Encoding Source #
ToJSONKey LocalTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction LocalTime Source # toJSONKeyList :: ToJSONKeyFunction [LocalTime] Source #
Data LocalTime |

Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LocalTime -> c LocalTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LocalTime Source #

toConstr :: LocalTime -> Constr Source #

dataTypeOf :: LocalTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LocalTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LocalTime) Source #

gmapT :: (forall b. Data b => b -> b) -> LocalTime -> LocalTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LocalTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LocalTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> LocalTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LocalTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime Source #

Show LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods showsPrec :: Int -> LocalTime -> ShowS Source # show :: LocalTime -> String Source # showList :: [LocalTime] -> ShowS Source #
NFData LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods rnf :: LocalTime -> () Source #
Eq LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods (==) :: LocalTime -> LocalTime -> Bool Source # (/=) :: LocalTime -> LocalTime -> Bool Source #
Ord LocalTime |

Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Methods

compare :: LocalTime -> LocalTime -> Ordering Source #

(<) :: LocalTime -> LocalTime -> Bool Source #

(<=) :: LocalTime -> LocalTime -> Bool Source #

(>) :: LocalTime -> LocalTime -> Bool Source #

(>=) :: LocalTime -> LocalTime -> Bool Source #

max :: LocalTime -> LocalTime -> LocalTime Source #

min :: LocalTime -> LocalTime -> LocalTime Source #

data TimeLocale Source #

Constructors

TimeLocale |

Fields

- wDays :: [(String, String)]

  full and abbreviated week days, starting with Sunday

- months :: [(String, String)]

  full and abbreviated months

- amPm :: (String, String)

  AM/PM symbols

- dateTimeFmt :: String

  formatting strings

- dateFmt :: String

  formatting strings

- timeFmt :: String

  formatting strings

- time12Fmt :: String

  formatting strings

- knownTimeZones :: [TimeZone]

  time zones known by name

#### Instances

Instances details

Show TimeLocale |
Instance details Defined in Data.Time.Format.Locale Methods showsPrec :: Int -> TimeLocale -> ShowS Source # show :: TimeLocale -> String Source # showList :: [TimeLocale] -> ShowS Source #
Eq TimeLocale |
Instance details Defined in Data.Time.Format.Locale Methods (==) :: TimeLocale -> TimeLocale -> Bool Source # (/=) :: TimeLocale -> TimeLocale -> Bool Source #
Ord TimeLocale |

Instance details

Defined in Data.Time.Format.Locale

Methods

compare :: TimeLocale -> TimeLocale -> Ordering Source #

(<) :: TimeLocale -> TimeLocale -> Bool Source #

(<=) :: TimeLocale -> TimeLocale -> Bool Source #

(>) :: TimeLocale -> TimeLocale -> Bool Source #

(>=) :: TimeLocale -> TimeLocale -> Bool Source #

max :: TimeLocale -> TimeLocale -> TimeLocale Source #

min :: TimeLocale -> TimeLocale -> TimeLocale Source #

class ParseTime t Source #

The class of types which can be parsed given a UNIX-style time format string.

Minimal complete definition

parseTimeSpecifier, buildTime

class FormatTime t Source #

Minimal complete definition

formatCharacter

#### Instances

Instances details

FormatTime DotNetTime |
Instance details Defined in Data.Aeson.Types.Internal Methods formatCharacter :: Bool -> Char -> Maybe (FormatOptions -> DotNetTime -> String) Source #

data ZonedTime Source #

A local time together with a time zone.

There is no `Eq` instance for `ZonedTime`. If you want to compare local times, use `zonedTimeToLocalTime`. If you want to compare absolute times, use `zonedTimeToUTC`.

Constructors

ZonedTime |

Fields

- zonedTimeToLocalTime :: LocalTime
- zonedTimeZone :: TimeZone

#### Instances

Instances details

FromJSON ZonedTime

Supported string formats:

`YYYY-MM-DD HH:MM Z` `YYYY-MM-DD HH:MM:SS Z` `YYYY-MM-DD HH:MM:SS.SSS Z`

The first space may instead be a `T`, and the second space is optional. The `Z` represents UTC. The `Z` may be replaced with a time zone offset of the form `+0000` or `-08:00`, where the first two digits are hours, the `:` is optional and the second two digits (also optional) are minutes.

Instance details Defined in Data.Aeson.Types.FromJSON Methods parseJSON :: Value -> Parser ZonedTime Source # parseJSONList :: Value -> Parser [ZonedTime] Source #
FromJSONKey ZonedTime |
Instance details Defined in Data.Aeson.Types.FromJSON Methods fromJSONKey :: FromJSONKeyFunction ZonedTime Source # fromJSONKeyList :: FromJSONKeyFunction [ZonedTime] Source #
ToJSON ZonedTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSON :: ZonedTime -> Value Source # toEncoding :: ZonedTime -> Encoding Source # toJSONList :: [ZonedTime] -> Value Source # toEncodingList :: [ZonedTime] -> Encoding Source #
ToJSONKey ZonedTime |
Instance details Defined in Data.Aeson.Types.ToJSON Methods toJSONKey :: ToJSONKeyFunction ZonedTime Source # toJSONKeyList :: ToJSONKeyFunction [ZonedTime] Source #
Data ZonedTime |

Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ZonedTime -> c ZonedTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ZonedTime Source #

toConstr :: ZonedTime -> Constr Source #

dataTypeOf :: ZonedTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ZonedTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ZonedTime) Source #

gmapT :: (forall b. Data b => b -> b) -> ZonedTime -> ZonedTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ZonedTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ZonedTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime Source #

Show ZonedTime | For the time zone, this only shows the name, or offset if the name is empty.
Instance details Defined in Data.Time.LocalTime.Internal.ZonedTime Methods showsPrec :: Int -> ZonedTime -> ShowS Source # show :: ZonedTime -> String Source # showList :: [ZonedTime] -> ShowS Source #
NFData ZonedTime |
Instance details Defined in Data.Time.LocalTime.Internal.ZonedTime Methods rnf :: ZonedTime -> () Source #

data CliOpts Source #

Command line options, used in the `hledger` package and above. This is the "opts" used throughout hledger CLI code. representing the options and arguments that were provided at startup on the command-line.

Constructors

CliOpts |

Fields

- rawopts_ :: RawOpts
- command_ :: String
- file_ :: [FilePath]
- inputopts_ :: InputOpts
- reportspec_ :: ReportSpec
- output_file_ :: Maybe FilePath
- output_format_ :: Maybe String
- debug_ :: Int

  debug level, set by `--debug[=N]`. See also `debugLevel`.

- no_new_accounts_ :: Bool
- width_ :: Maybe String

  the --width value provided, if any

- available_width_ :: Int

  estimated usable screen width, based on 1. the COLUMNS env var, if set 2. the width reported by the terminal, if supported 3. the default (80)

- progstarttime_ :: POSIXTime

#### Instances

Instances details

Show CliOpts Source # |
Instance details Defined in Hledger.Cli.CliOptions Methods showsPrec :: Int -> CliOpts -> ShowS Source # show :: CliOpts -> String Source # showList :: [CliOpts] -> ShowS Source #
Default CliOpts Source # |
Instance details Defined in Hledger.Cli.CliOptions Methods def :: CliOpts #
HasCliOpts CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

cliOpts :: Lens' CliOpts CliOpts Source #

available_width :: Lens' CliOpts Int Source #

command :: Lens' CliOpts String Source #

debug__ :: Lens' CliOpts Int Source #

file__ :: Lens' CliOpts [FilePath] Source #

inputopts :: Lens' CliOpts InputOpts Source #

no_new_accounts :: Lens' CliOpts Bool Source #

output_file :: Lens' CliOpts (Maybe FilePath) Source #

output_format :: Lens' CliOpts (Maybe String) Source #

progstarttime :: Lens' CliOpts POSIXTime Source #

rawopts__ :: Lens' CliOpts RawOpts Source #

reportspec :: Lens' CliOpts ReportSpec Source #

width__ :: Lens' CliOpts (Maybe String) Source #

HasBalancingOpts CliOpts Source # |
Instance details Defined in Hledger.Cli.CliOptions Methods balancingOpts :: Lens' CliOpts BalancingOpts Source # commodity_styles :: Lens' CliOpts (Maybe (Map CommoditySymbol AmountStyle)) Source # ignore_assertions :: Lens' CliOpts Bool Source # infer_balancing_costs :: Lens' CliOpts Bool Source #
HasInputOpts CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

inputOpts :: Lens' CliOpts InputOpts Source #

aliases :: Lens' CliOpts [String] Source #

anon__ :: Lens' CliOpts Bool Source #

auto__ :: Lens' CliOpts Bool Source #

balancingopts :: Lens' CliOpts BalancingOpts Source #

forecast :: Lens' CliOpts (Maybe DateSpan) Source #

infer_costs :: Lens' CliOpts Bool Source #

infer_equity :: Lens' CliOpts Bool Source #

ioDay :: Lens' CliOpts Day Source #

mformat :: Lens' CliOpts (Maybe StorageFormat) Source #

mrules_file :: Lens' CliOpts (Maybe FilePath) Source #

new__ :: Lens' CliOpts Bool Source #

new_save :: Lens' CliOpts Bool Source #

pivot :: Lens' CliOpts String Source #

reportspan :: Lens' CliOpts DateSpan Source #

strict :: Lens' CliOpts Bool Source #

verbose_tags :: Lens' CliOpts Bool Source #

HasReportOpts CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

reportOpts :: ReportableLens' CliOpts ReportOpts Source #

period :: ReportableLens' CliOpts Period Source #

statuses :: ReportableLens' CliOpts [Status] Source #

depth :: ReportableLens' CliOpts (Maybe Int) Source #

date2 :: ReportableLens' CliOpts Bool Source #

real :: ReportableLens' CliOpts Bool Source #

querystring :: ReportableLens' CliOpts [Text] Source #

HasReportOptsNoUpdate CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

reportOptsNoUpdate :: Lens' CliOpts ReportOpts Source #

accountlistmode :: Lens' CliOpts AccountListMode Source #

average :: Lens' CliOpts Bool Source #

balanceaccum :: Lens' CliOpts BalanceAccumulation Source #

balancecalc :: Lens' CliOpts BalanceCalculation Source #

budgetpat :: Lens' CliOpts (Maybe Text) Source #

color__ :: Lens' CliOpts Bool Source #

conversionop :: Lens' CliOpts (Maybe ConversionOp) Source #

date2NoUpdate :: Lens' CliOpts Bool Source #

declared :: Lens' CliOpts Bool Source #

depthNoUpdate :: Lens' CliOpts (Maybe Int) Source #

drop__ :: Lens' CliOpts Int Source #

empty__ :: Lens' CliOpts Bool Source #

format :: Lens' CliOpts StringFormat Source #

infer_prices :: Lens' CliOpts Bool Source #

interval :: Lens' CliOpts Interval Source #

invert :: Lens' CliOpts Bool Source #

layout :: Lens' CliOpts Layout Source #

no_elide :: Lens' CliOpts Bool Source #

no_total :: Lens' CliOpts Bool Source #

normalbalance :: Lens' CliOpts (Maybe NormalSign) Source #

percent :: Lens' CliOpts Bool Source #

periodNoUpdate :: Lens' CliOpts Period Source #

pretty :: Lens' CliOpts Bool Source #

querystringNoUpdate :: Lens' CliOpts [Text] Source #

realNoUpdate :: Lens' CliOpts Bool Source #

related :: Lens' CliOpts Bool Source #

row_total :: Lens' CliOpts Bool Source #

show_costs :: Lens' CliOpts Bool Source #

sort_amount :: Lens' CliOpts Bool Source #

statusesNoUpdate :: Lens' CliOpts [Status] Source #

transpose__ :: Lens' CliOpts Bool Source #

txn_dates :: Lens' CliOpts Bool Source #

value :: Lens' CliOpts (Maybe ValuationType) Source #

HasReportSpec CliOpts Source # |
Instance details Defined in Hledger.Cli.CliOptions Methods reportSpec :: Lens' CliOpts ReportSpec Source # rsDay :: Lens' CliOpts Day Source # rsQuery :: Lens' CliOpts Query Source # rsQueryOpts :: Lens' CliOpts [QueryOpt] Source # rsReportOpts :: Lens' CliOpts ReportOpts Source #

class HasCliOpts c where Source #

Minimal complete definition

cliOpts

Methods

cliOpts :: Lens' c CliOpts Source #

available_width :: Lens' c Int Source #

command :: Lens' c String Source #

debug__ :: Lens' c Int Source #

file__ :: Lens' c [FilePath] Source #

inputopts :: Lens' c InputOpts Source #

no_new_accounts :: Lens' c Bool Source #

output_file :: Lens' c (Maybe FilePath) Source #

output_format :: Lens' c (Maybe String) Source #

progstarttime :: Lens' c POSIXTime Source #

rawopts__ :: Lens' c RawOpts Source #

reportspec :: Lens' c ReportSpec Source #

width__ :: Lens' c (Maybe String) Source #

#### Instances

Instances details

HasCliOpts CliOpts Source # |

Instance details

Defined in Hledger.Cli.CliOptions

Methods

cliOpts :: Lens' CliOpts CliOpts Source #

available_width :: Lens' CliOpts Int Source #

command :: Lens' CliOpts String Source #

debug__ :: Lens' CliOpts Int Source #

file__ :: Lens' CliOpts [FilePath] Source #

inputopts :: Lens' CliOpts InputOpts Source #

no_new_accounts :: Lens' CliOpts Bool Source #

output_file :: Lens' CliOpts (Maybe FilePath) Source #

output_format :: Lens' CliOpts (Maybe String) Source #

progstarttime :: Lens' CliOpts POSIXTime Source #

rawopts__ :: Lens' CliOpts RawOpts Source #

reportspec :: Lens' CliOpts ReportSpec Source #

width__ :: Lens' CliOpts (Maybe String) Source #

type CommandDoc = String Source #

A command's documentation. Used both as part of CLI help, and as part of the hledger manual. See parseCommandDoc.

type Topic = String Source #

type ProgramName = String Source #

type PackageVersion = String Source #

type VersionString = String Source #

pattern MixedAmountKeyUnitPrice :: !CommoditySymbol -> !CommoditySymbol -> !Quantity -> MixedAmountKey Source #

pattern MixedAmountKeyNoPrice :: !CommoditySymbol -> MixedAmountKey Source #

pattern MixedAmountKeyTotalPrice :: !CommoditySymbol -> !CommoditySymbol -> MixedAmountKey Source #

pattern December :: MonthOfYear Source #

The twelve `MonthOfYear` patterns form a `COMPLETE` set.

pattern November :: MonthOfYear Source #

pattern October :: MonthOfYear Source #

pattern September :: MonthOfYear Source #

pattern August :: MonthOfYear Source #

pattern July :: MonthOfYear Source #

pattern June :: MonthOfYear Source #

pattern May :: MonthOfYear Source #

pattern April :: MonthOfYear Source #

pattern March :: MonthOfYear Source #

pattern February :: MonthOfYear Source #

pattern January :: MonthOfYear Source #

pattern BeforeCommonEra :: Integer -> Year Source #

Also known as Before Christ. Note that Year 1 = 1 CE, and the previous Year 0 = 1 BCE. `CommonEra` and `BeforeCommonEra` form a `COMPLETE` set.

pattern CommonEra :: Integer -> Year Source #

Also known as Anno Domini.

pattern YearMonthDay :: Year -> MonthOfYear -> DayOfMonth -> Day Source #

Bidirectional abstract constructor for the proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.

elem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 Source #

Does the element occur in the structure?

Note: `elem` is often used in infix form.

#### Examples

Expand

Basic usage:

    >>> 3 `elem` []
    False

    >>> 3 `elem` [1,2]
    False

    >>> 3 `elem` [1,2,3,4,5]
    True

For infinite structures, the default implementation of `elem` terminates if the sought-after value exists at a finite distance from the left side of the structure:

    >>> 3 `elem` [1..]
    True

    >>> 3 `elem` ([4..] ++ [3])
    * Hangs forever *

Since: base-4.8.0.0

minimum :: (Foldable t, Ord a) => t a -> a Source #

The least element of a non-empty structure.

This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the minimum in faster than linear time.

#### Examples

Expand

Basic usage:

    >>> minimum [1..10]
    1

    >>> minimum []
    *** Exception: Prelude.minimum: empty list

    >>> minimum Nothing
    *** Exception: minimum: empty structure

WARNING: This function is partial for possibly-empty structures like lists.

Since: base-4.8.0.0

maximum :: (Foldable t, Ord a) => t a -> a Source #

The largest element of a non-empty structure.

This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the maximum in faster than linear time.

#### Examples

Expand

Basic usage:

    >>> maximum [1..10]
    10

    >>> maximum []
    *** Exception: Prelude.maximum: empty list

    >>> maximum Nothing
    *** Exception: maximum: empty structure

WARNING: This function is partial for possibly-empty structures like lists.

Since: base-4.8.0.0

foldr1 :: Foldable t => (a -> a -> a) -> t a -> a Source #

A variant of `foldr` that has no base case, and thus may only be applied to non-empty structures.

This function is non-total and will raise a runtime exception if the structure happens to be empty.

#### Examples

Expand

Basic usage:

    >>> foldr1 (+) [1..4]
    10

    >>> foldr1 (+) []
    Exception: Prelude.foldr1: empty list

    >>> foldr1 (+) Nothing
    *** Exception: foldr1: empty structure

    >>> foldr1 (-) [1..4]
    -2

    >>> foldr1 (&&) [True, False, True, True]
    False

    >>> foldr1 (||) [False, False, True, True]
    True

    >>> foldr1 (+) [1..]
    * Hangs forever *

product :: (Foldable t, Num a) => t a -> a Source #

The `product` function computes the product of the numbers of a structure.

#### Examples

Expand

Basic usage:

    >>> product []
    1

    >>> product [42]
    42

    >>> product [1..10]
    3628800

    >>> product [4.1, 2.0, 1.7]
    13.939999999999998

    >>> product [1..]
    * Hangs forever *

Since: base-4.8.0.0

sum :: (Foldable t, Num a) => t a -> a Source #

The `sum` function computes the sum of the numbers of a structure.

#### Examples

Expand

Basic usage:

    >>> sum []
    0

    >>> sum [42]
    42

    >>> sum [1..10]
    55

    >>> sum [4.1, 2.0, 1.7]
    7.8

    >>> sum [1..]
    * Hangs forever *

Since: base-4.8.0.0

foldl1 :: Foldable t => (a -> a -> a) -> t a -> a Source #

A variant of `foldl` that has no base case, and thus may only be applied to non-empty structures.

This function is non-total and will raise a runtime exception if the structure happens to be empty.

    foldl1 f = foldl1 f . toList

#### Examples

Expand

Basic usage:

    >>> foldl1 (+) [1..4]
    10

    >>> foldl1 (+) []
    *** Exception: Prelude.foldl1: empty list

    >>> foldl1 (+) Nothing
    *** Exception: foldl1: empty structure

    >>> foldl1 (-) [1..4]
    -8

    >>> foldl1 (&&) [True, False, True, True]
    False

    >>> foldl1 (||) [False, False, True, True]
    True

    >>> foldl1 (+) [1..]
    * Hangs forever *

length :: Foldable t => t a -> Int Source #

Returns the size/length of a finite structure as an `Int`. The default implementation just counts elements starting with the leftmost. Instances for structures that can compute the element count faster than via element-by-element counting, should provide a specialised implementation.

#### Examples

Expand

Basic usage:

    >>> length []
    0

    >>> length ['a', 'b', 'c']
    3
    >>> length [1..]
    * Hangs forever *

Since: base-4.8.0.0

foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b Source #

Left-associative fold of a structure but with strict application of the operator.

This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result (e.g. `sum`).

For a general `Foldable` structure this should be semantically identical to,

    foldl' f z = foldl' f z . toList

Since: base-4.6.0.0

foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b Source #

Right-associative fold of a structure, lazy in the accumulator.

In the case of lists, `foldr`, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

    foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

Note that since the head of the resulting expression is produced by an application of the operator to the first element of the list, given an operator lazy in its right argument, `foldr` can produce a terminating expression from an unbounded list.

For a general `Foldable` structure this should be semantically identical to,

    foldr f z = foldr f z . toList

#### Examples

Expand

Basic usage:

    >>> foldr (||) False [False, True, False]
    True

    >>> foldr (||) False []
    False

    >>> foldr (\c acc -> acc ++ [c]) "foo" ['a', 'b', 'c', 'd']
    "foodcba"

##### Infinite structures

⚠️ Applying `foldr` to infinite structures usually doesn't terminate.

It may still terminate under one of the following conditions:

- the folding function is short-circuiting
- the folding function is lazy on its second argument

###### Short-circuiting

`(`||`)` short-circuits on `True` values, so the following terminates because there is a `True` value finitely far from the left side:

    >>> foldr (||) False (True : repeat False)
    True

But the following doesn't terminate:

    >>> foldr (||) False (repeat False ++ [True])
    * Hangs forever *

###### Laziness in the second argument

Applying `foldr` to infinite structures terminates when the operator is lazy in its second argument (the initial accumulator is never used in this case, and so could be left `undefined`, but `[]` is more clear):

    >>> take 5 $ foldr (\i acc -> i : fmap (+3) acc) [] (repeat 1)
    [1,4,7,10,13]

foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b Source #

Left-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument.

In the case of lists, `foldl`, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

    foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. Like all left-associative folds, `foldl` will diverge if given an infinite list.

If you want an efficient strict left-fold, you probably want to use `foldl'` instead of `foldl`. The reason for this is that the latter does not force the inner results (e.g. `z `f` x1` in the above example) before applying them to the operator (e.g. to `(`f` x2)`). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.

For a general `Foldable` structure this should be semantically identical to:

    foldl f z = foldl f z . toList

#### Examples

Expand

The first example is a strict fold, which in practice is best performed with `foldl'`.

    >>> foldl (+) 42 [1,2,3,4]
    52

Though the result below is lazy, the input is reversed before prepending it to the initial accumulator, so corecursion begins only after traversing the entire input string.

    >>> foldl (\acc c -> c : acc) "abcd" "efgh"
    "hgfeabcd"

A left fold of a structure that is infinite on the right cannot terminate, even when for any finite input the fold just returns the initial accumulator:

    >>> foldl (\a _ -> a) 0 $ repeat 1
    * Hangs forever *

WARNING: When it comes to lists, you always want to use either `foldl'` or `foldr` instead.

null :: Foldable t => t a -> Bool Source #

Test whether the structure is empty. The default implementation is Left-associative and lazy in both the initial element and the accumulator. Thus optimised for structures where the first element can be accessed in constant time. Structures where this is not the case should have a non-default implementation.

#### Examples

Expand

Basic usage:

    >>> null []
    True

    >>> null [1]
    False

`null` is expected to terminate even for infinite structures. The default implementation terminates provided the structure is bounded on the left (there is a leftmost element).

    >>> null [1..]
    False

Since: base-4.8.0.0

pager :: String -> IO () Source #

Display the given text on the terminal, using the user's $PAGER if the text is taller than the current terminal and stdout is interactive and TERM is not "dumb" (except on Windows, where a pager will not be used). If the text contains ANSI codes, because hledger thinks the current terminal supports those, the pager should be configured to display those, otherwise users will see junk on screen (#2015). We call "setLessR" at hledger startup to make that less likely.

process :: Mode a -> [String] -> Either String a Source #

Process a list of flags (usually obtained from `getArgs`/`expandArgsAt`) with a mode. Returns `Left` and an error message if the command line fails to parse, or `Right` and the associated value.

toUpper :: Char -> Char Source #

Convert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged.

singleton :: a -> [a] Source #

Produce singleton list.

    >>> singleton True
    [True]

Since: base-4.15.0.0

delete :: Eq a => a -> [a] -> [a] Source #

\(\mathcal{O}(n)\). `delete` `x` removes the first occurrence of `x` from its list argument. For example,

    >>> delete 'a' "banana"
    "bnana"

It is a special case of `deleteBy`, which allows the programmer to supply their own equality test.

lookup :: Eq a => a -> [(a, b)] -> Maybe b Source #

\(\mathcal{O}(n)\). `lookup` `key assocs` looks up a key in an association list.

    >>> lookup 2 []
    Nothing
    >>> lookup 2 [(1, "first")]
    Nothing
    >>> lookup 2 [(1, "first"), (2, "second"), (3, "third")]
    Just "second"

insert :: Ord a => a -> [a] -> [a] Source #

\(\mathcal{O}(n)\). The `insert` function takes an element and a list and inserts the element into the list at the first position where it is less than or equal to the next element. In particular, if the list is sorted before the call, the result will also be sorted. It is a special case of `insertBy`, which allows the programmer to supply their own comparison function.

    >>> insert 4 [1,2,3,5,6,7]
    [1,2,3,4,5,6,7]

map :: (a -> b) -> [a] -> [b] Source #

\(\mathcal{O}(n)\). `map` `f xs` is the list obtained by applying `f` to each element of `xs`, i.e.,

    map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
    map f [x1, x2, ...] == [f x1, f x2, ...]

    >>> map (+1) [1, 2, 3]
    [2,3,4]

union :: Eq a => [a] -> [a] -> [a] Source #

The `union` function returns the list union of the two lists. For example,

    >>> "dog" `union` "cow"
    "dogcw"

Duplicates, and elements of the first list, are removed from the the second list, but if the first list contains duplicates, so will the result. It is a special case of `unionBy`, which allows the programmer to supply their own equality test.

filter :: (a -> Bool) -> [a] -> [a] Source #

\(\mathcal{O}(n)\). `filter`, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,

    filter p xs = [ x | x <- xs, p x]

    >>> filter odd [1, 2, 3]
    [1,3]

mapMaybe :: (a -> Maybe b) -> [a] -> [b] Source #

The `mapMaybe` function is a version of `map` which can throw out elements. In particular, the functional argument returns something of type ``Maybe` b`. If this is `Nothing`, no element is added on to the result list. If it is ``Just` b`, then `b` is included in the result list.

#### Examples

Expand

Using ``mapMaybe` f x` is a shortcut for ``catMaybes` $ `map` f x` in most cases:

    >>> import Text.Read ( readMaybe )
    >>> let readMaybeInt = readMaybe :: String -> Maybe Int
    >>> mapMaybe readMaybeInt ["1", "Foo", "3"]
    [1,3]
    >>> catMaybes $ map readMaybeInt ["1", "Foo", "3"]
    [1,3]

If we map the `Just` constructor, the entire list should be returned:

    >>> mapMaybe Just [1,2,3]
    [1,2,3]

toLower :: Char -> Char Source #

Convert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged.

(++) :: [a] -> [a] -> [a] infixr 5 Source #

Append two lists, i.e.,

    [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
    [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]

If the first list is not finite, the result is the first list.

WARNING: This function takes linear time in the number of elements of the first list.

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 Source #

An infix synonym for `fmap`.

The name of this operator is an allusion to `$`. Note the similarities between their types:

     ($)  ::              (a -> b) ->   a ->   b
    (<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas `$` is function application, `<$>` is function application lifted over a `Functor`.

#### Examples

Expand

Convert from a ``Maybe` `Int`` to a ``Maybe` `String`` using `show`:

    >>> show <$> Nothing
    Nothing
    >>> show <$> Just 3
    Just "3"

Convert from an ``Either` `Int` `Int`` to an ``Either` `Int`` `String` using `show`:

    >>> show <$> Left 17
    Left 17
    >>> show <$> Right 17
    Right "17"

Double each element of a list:

    >>> (*2) <$> [1,2,3]
    [2,4,6]

Apply `even` to the second element of a pair:

    >>> even <$> (2,2)
    (2,True)

join :: Monad m => m (m a) -> m a Source #

The `join` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.

'``join` bss`' can be understood as the `do` expression

    do bs <- bss
       bs

#### Examples

Expand

A common use of `join` is to run an `IO` computation returned from an `STM` transaction, since `STM` transactions can't perform `IO` directly. Recall that

    atomically :: STM a -> IO a

is used to run `STM` transactions atomically. So, by specializing the types of `atomically` and `join` to

    atomically :: STM (IO b) -> IO (IO b)
    join       :: IO (IO b)  -> IO b

we can compose them as

    join . atomically :: STM (IO b) -> IO b

to run an `STM` transaction and the `IO` action it returns.

stdout :: Handle Source #

stdin :: Handle Source #

hIsTerminalDevice :: Handle -> IO Bool Source #

Is the handle connected to a terminal?

On Windows the result of `hIsTerminalDevide` might be misleading, because non-native terminals, such as MinTTY used in MSYS and Cygwin environments, are implemented via redirection. Use `System.Win32.Types.withHandleToHANDLE System.Win32.MinTTY.isMinTTYHandle` to recognise it. Also consider `ansi-terminal` package for crossplatform terminal support.

hIsWritable :: Handle -> IO Bool Source #

zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] Source #

\(\mathcal{O}(\min(m,n))\). `zipWith` generalises `zip` by zipping with the function given as the first argument, instead of a tupling function.

    zipWith (,) xs ys == zip xs ys
    zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]

For example, ``zipWith` (+)` is applied to two lists to produce the list of corresponding sums:

    >>> zipWith (+) [1, 2, 3] [4, 5, 6]
    [5,7,9]

`zipWith` is right-lazy:

    >>> let f = undefined
    >>> zipWith f [] undefined
    []

`zipWith` is capable of list fusion, but it is restricted to its first list argument and its resulting list.

hGetContents :: Handle -> IO String Source #

Computation `hGetContents` `hdl` returns the list of characters corresponding to the unread portion of the channel or file managed by `hdl`, which is put into an intermediate state, semi-closed. In this state, `hdl` is effectively closed, but items are read from `hdl` on demand and accumulated in a special list returned by `hGetContents` `hdl`.

Any operation that fails because a handle is closed, also fails if a handle is semi-closed. The only exception is `hClose`. A semi-closed handle becomes closed:

- if `hClose` is applied to it;
- if an I/O error occurs when reading an item from the handle;
- or once the entire contents of the handle has been read.

Once a semi-closed handle becomes closed, the contents of the associated list becomes fixed. The contents of this final list is only partially specified: it will contain at least all the items of the stream that were evaluated prior to the handle becoming closed.

Any I/O errors encountered while a handle is semi-closed are simply discarded.

This operation may fail with:

- `isEOFError` if the end of file has been reached.

sortBy :: (a -> a -> Ordering) -> [a] -> [a] Source #

The `sortBy` function is the non-overloaded version of `sort`.

    >>> sortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")]
    [(1,"Hello"),(2,"world"),(4,"!")]

genericLength :: Num i => [a] -> i Source #

\(\mathcal{O}(n)\). The `genericLength` function is an overloaded version of `length`. In particular, instead of returning an `Int`, it returns any type which is an instance of `Num`. It is, however, less efficient than `length`.

    >>> genericLength [1, 2, 3] :: Int
    3
    >>> genericLength [1, 2, 3] :: Float
    3.0

Users should take care to pick a return type that is wide enough to contain the full length of the list. If the width is insufficient, the overflow behaviour will depend on the `(+)` implementation in the selected `Num` instance. The following example overflows because the actual list length of 200 lies outside of the `Int8` range of `-128..127`.

    >>> genericLength [1..200] :: Int8
    -56

maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a Source #

The largest element of a non-empty structure with respect to the given comparison function.

#### Examples

Expand

Basic usage:

    >>> maximumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]
    "Longest"

WARNING: This function is partial for possibly-empty structures like lists.

minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a Source #

The least element of a non-empty structure with respect to the given comparison function.

#### Examples

Expand

Basic usage:

    >>> minimumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]
    "!"

WARNING: This function is partial for possibly-empty structures like lists.

genericReplicate :: Integral i => i -> a -> [a] Source #

The `genericReplicate` function is an overloaded version of `replicate`, which accepts any `Integral` value as the number of repetitions to make.

genericTake :: Integral i => i -> [a] -> [a] Source #

The `genericTake` function is an overloaded version of `take`, which accepts any `Integral` value as the number of elements to take.

genericDrop :: Integral i => i -> [a] -> [a] Source #

The `genericDrop` function is an overloaded version of `drop`, which accepts any `Integral` value as the number of elements to drop.

genericSplitAt :: Integral i => i -> [a] -> ([a], [a]) Source #

The `genericSplitAt` function is an overloaded version of `splitAt`, which accepts any `Integral` value as the position at which to split.

genericIndex :: Integral i => [a] -> i -> a Source #

The `genericIndex` function is an overloaded version of `!!`, which accepts any `Integral` value as the index.

isLetter :: Char -> Bool Source #

Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to `isAlpha`.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `UppercaseLetter`
- `LowercaseLetter`
- `TitlecaseLetter`
- `ModifierLetter`
- `OtherLetter`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Letter".

#### Examples

Expand

Basic usage:

    >>> isLetter 'a'
    True
    >>> isLetter 'A'
    True
    >>> isLetter 'λ'
    True
    >>> isLetter '0'
    False
    >>> isLetter '%'
    False
    >>> isLetter '♥'
    False
    >>> isLetter '\31'
    False

Ensure that `isLetter` and `isAlpha` are equivalent.

    >>> let chars = [(chr 0)..]
    >>> let letters = map isLetter chars
    >>> let alphas = map isAlpha chars
    >>> letters == alphas
    True

openFile :: FilePath -> IOMode -> IO Handle Source #

isAlpha :: Char -> Bool Source #

Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to `isLetter`.

ord :: Char -> Int Source #

The `fromEnum` method restricted to the type `Char`.

chr :: Int -> Char Source #

The `toEnum` method restricted to the type `Char`.

mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) Source #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see `mapM_`.

#### Examples

Expand

`mapM` is literally a `traverse` with a type signature restricted to `Monad`. Its implementation may be more efficient due to additional power of `Monad`.

sequence :: (Traversable t, Monad m) => t (m a) -> m (t a) Source #

Evaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see `sequence_`.

#### Examples

Expand

Basic usage:

The first two examples are instances where the input and and output of `sequence` are isomorphic.

    >>> sequence $ Right [1,2,3,4]
    [Right 1,Right 2,Right 3,Right 4]

    >>> sequence $ [Right 1,Right 2,Right 3,Right 4]
    Right [1,2,3,4]

The following examples demonstrate short circuit behavior for `sequence`.

    >>> sequence $ Left [1,2,3,4]
    Left [1,2,3,4]

    >>> sequence $ [Left 0, Right 1,Right 2,Right 3,Right 4]
    Left 0

forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) Source #

`forM` is `mapM` with its arguments flipped. For a version that ignores the results see `forM_`.

throwTo :: Exception e => ThreadId -> e -> IO () Source #

`throwTo` raises an arbitrary exception in the target thread (GHC only).

Exception delivery synchronizes between the source and target thread: `throwTo` does not return until the exception has been raised in the target thread. The calling thread can thus be certain that the target thread has received the exception. Exception delivery is also atomic with respect to other exceptions. Atomicity is a useful property to have when dealing with race conditions: e.g. if there are two threads that can kill each other, it is guaranteed that only one of the threads will get to kill the other.

Whatever work the target thread was doing when the exception was raised is not lost: the computation is suspended until required by another thread.

If the target thread is currently making a foreign call, then the exception will not be raised (and hence `throwTo` will not return) until the call has completed. This is the case regardless of whether the call is inside a `mask` or not. However, in GHC a foreign call can be annotated as `interruptible`, in which case a `throwTo` will cause the RTS to attempt to cause the call to return; see the GHC documentation for more details.

Important note: the behaviour of `throwTo` differs from that described in the paper "Asynchronous exceptions in Haskell" (http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper, `throwTo` is non-blocking; but the library implementation adopts a more synchronous design in which `throwTo` does not return until the exception is received by the target thread. The trade-off is discussed in Section 9 of the paper. Like any blocking operation, `throwTo` is therefore interruptible (see Section 5.3 of the paper). Unlike other interruptible operations, however, `throwTo` is always interruptible, even if it does not actually block.

There is no guarantee that the exception will be delivered promptly, although the runtime will endeavour to ensure that arbitrary delays don't occur. In GHC, an exception can only be raised when a thread reaches a safe point, where a safe point is where memory allocation occurs. Some loops do not perform any memory allocation inside the loop and therefore cannot be interrupted by a `throwTo`.

If the target of `throwTo` is the calling thread, then the behaviour is the same as `throwIO`, except that the exception is thrown as an asynchronous exception. This means that if there is an enclosing pure computation, which would be the case if the current IO operation is inside `unsafePerformIO` or `unsafeInterleaveIO`, that computation is not permanently replaced by the exception, but is suspended as if it had received an asynchronous exception.

Note that if `throwTo` is called with the current thread as the target, the exception will be thrown even if the thread is currently inside `mask` or `uninterruptibleMask`.

forkIOWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId Source #

Like `forkIO`, but the child thread is passed a function that can be used to unmask asynchronous exceptions. This function is typically used in the following way

     ... mask_ $ forkIOWithUnmask $ \unmask ->
                    catch (unmask ...) handler

so that the exception handler in the child thread is established with asynchronous exceptions masked, meanwhile the main body of the child thread is executed in the unmasked state.

Note that the unmask function passed to the child thread should only be used in that thread; the behaviour is undefined if it is invoked in a different thread.

Since: base-4.4.0.0

forkIO :: IO () -> IO ThreadId Source #

Creates a new thread to run the `IO` computation passed as the first argument, and returns the `ThreadId` of the newly created thread.

The new thread will be a lightweight, unbound thread. Foreign calls made by this thread are not guaranteed to be made by any particular OS thread; if you need foreign calls to be made by a particular OS thread, then use `forkOS` instead.

The new thread inherits the masked state of the parent (see `mask`).

The newly created thread has an exception handler that discards the exceptions `BlockedIndefinitelyOnMVar`, `BlockedIndefinitelyOnSTM`, and `ThreadKilled`, and passes all other exceptions to the uncaught exception handler.

WARNING: Exceptions in the new thread will not be rethrown in the thread that created it. This means that you might be completely unaware of the problem if/when this happens. You may want to use the async library instead.

stderr :: Handle Source #

forever :: Applicative f => f a -> f b Source #

Repeat an action indefinitely.

#### Examples

Expand

A common use of `forever` is to process input from network sockets, `Handle`s, and channels (e.g. `MVar` and `Chan`).

For example, here is how we might implement an echo server, using `forever` both to listen for client connections on a network socket and to echo client input on client connection handles:

    echoServer :: Socket -> IO ()
    echoServer socket = forever $ do
      client <- accept socket
      forkFinally (echo client) (\_ -> hClose client)
      where
        echo :: Handle -> IO ()
        echo client = forever $
          hGetLine client >>= hPutStrLn client

Note that "forever" isn't necessarily non-terminating. If the action is in a ``MonadPlus`` and short-circuits after some number of iterations. then ``forever`` actually returns `mzero`, effectively short-circuiting its caller.

utf8 :: TextEncoding Source #

The UTF-8 Unicode encoding

mkTextEncoding :: String -> IO TextEncoding Source #

Look up the named Unicode encoding. May fail with

- `isDoesNotExistError` if the encoding is unknown

The set of known encodings is system-dependent, but includes at least:

-     UTF-8

- `UTF-16`, `UTF-16BE`, `UTF-16LE`
- `UTF-32`, `UTF-32BE`, `UTF-32LE`

There is additional notation (borrowed from GNU iconv) for specifying how illegal characters are handled:

- a suffix of `//IGNORE`, e.g. `UTF-8//IGNORE`, will cause all illegal sequences on input to be ignored, and on output will drop all code points that have no representation in the target encoding.
- a suffix of `//TRANSLIT` will choose a replacement character for illegal sequences or code points.
- a suffix of `//ROUNDTRIP` will use a PEP383-style escape mechanism to represent any invalid bytes in the input as Unicode codepoints (specifically, as lone surrogates, which are normally invalid in UTF-32). Upon output, these special codepoints are detected and turned back into the corresponding original byte.

In theory, this mechanism allows arbitrary data to be roundtripped via a `String` with no loss of data. In practice, there are two limitations to be aware of:

1. This only stands a chance of working for an encoding which is an ASCII superset, as for security reasons we refuse to escape any bytes smaller than 128. Many encodings of interest are ASCII supersets (in particular, you can assume that the locale encoding is an ASCII superset) but many (such as UTF-16) are not.
2. If the underlying encoding is not itself roundtrippable, this mechanism can fail. Roundtrippable encodings are those which have an injective mapping into Unicode. Almost all encodings meet this criteria, but some do not. Notably, Shift-JIS (CP932) and Big5 contain several different encodings of the same Unicode codepoint.

On Windows, you can access supported code pages with the prefix `CP`; for example, `"CP1250"`.

hSeek :: Handle -> SeekMode -> Integer -> IO () Source #

Computation `hSeek` `hdl mode i` sets the position of handle `hdl` depending on `mode`. The offset `i` is given in terms of 8-bit bytes.

If `hdl` is block- or line-buffered, then seeking to a position which is not in the current buffer will first cause any items in the output buffer to be written to the device, and then cause the input buffer to be discarded. Some handles may not be seekable (see `hIsSeekable`), or only support a subset of the possible positioning operations (for instance, it may only be possible to seek to the end of a tape, or to a positive offset from the beginning or current position). It is not possible to set a negative I/O position, or for a physical file, an I/O position beyond the current end-of-file.

This operation may fail with:

- `isIllegalOperationError` if the Handle is not seekable, or does not support the requested seek mode.
- `isPermissionError` if a system resource limit would be exceeded.

getDirectoryContents :: FilePath -> IO [FilePath] Source #

Similar to `listDirectory`, but always includes the special entries (`.` and `..`). (This applies to Windows as well.)

The operation may fail with the same exceptions as `listDirectory`.

hFlush :: Handle -> IO () Source #

The action `hFlush` `hdl` causes any items buffered for output in handle `hdl` to be sent immediately to the operating system.

This operation may fail with:

- `isFullError` if the device is full;
- `isPermissionError` if a system resource limit would be exceeded. It is unspecified whether the characters in the buffer are discarded or retained under these circumstances.

hLookAhead :: Handle -> IO Char Source #

Computation `hLookAhead` returns the next character from the handle without removing it from the input buffer, blocking until a character is available.

This operation may fail with:

- `isEOFError` if the end of file has been reached.

fixIO :: (a -> IO a) -> IO a Source #

The implementation of `mfix` for `IO`. If the function passed to `fixIO` inspects its argument, the resulting action will throw `FixIOException`.

killThread :: ThreadId -> IO () Source #

`killThread` raises the `ThreadKilled` exception in the given thread (GHC only).

    killThread tid = throwTo tid ThreadKilled

threadDelay :: Int -> IO () Source #

Suspends the current thread for a given number of microseconds (GHC only).

There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.

forkOS :: IO () -> IO ThreadId Source #

Like `forkIO`, this sparks off a new thread to run the `IO` computation passed as the first argument, and returns the `ThreadId` of the newly created thread.

However, `forkOS` creates a bound thread, which is necessary if you need to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent).

Using `forkOS` instead of `forkIO` makes no difference at all to the scheduling behaviour of the Haskell runtime system. It is a common misconception that you need to use `forkOS` instead of `forkIO` to avoid blocking all the Haskell threads when making a foreign call; this isn't the case. To allow foreign calls to be made without blocking all the Haskell threads (with GHC), it is only necessary to use the `-threaded` option when linking your program, and to make sure the foreign import is not marked `unsafe`.

readFile' :: FilePath -> IO String Source #

The `readFile'` function reads a file and returns the contents of the file as a string. The file is fully read before being returned, as with `getContents'`.

Since: base-4.15.0.0

writeFile :: FilePath -> String -> IO () Source #

The computation `writeFile` `file str` function writes the string `str`, to the file `file`.

getLine :: IO String Source #

Read a line from the standard input device (same as `hGetLine` `stdin`).

putStrLn :: String -> IO () Source #

The same as `putStr`, but adds a newline character.

isDoesNotExistError :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because one of its arguments does not exist.

getArgs :: IO [String] Source #

Computation `getArgs` returns a list of the program's command line arguments (not including the program name).

hClose :: Handle -> IO () Source #

Computation `hClose` `hdl` makes handle `hdl` closed. Before the computation finishes, if `hdl` is writable its buffer is flushed as for `hFlush`. Performing `hClose` on a handle that has already been closed has no effect; doing so is not an error. All other operations on a closed handle will fail. If `hClose` fails for any reason, any further operations (apart from `hClose`) on the handle will still fail as if `hdl` had been successfully closed.

`hClose` is an interruptible operation in the sense described in Control.Exception. If `hClose` is interrupted by an asynchronous exception in the process of flushing its buffers, then the I/O device (e.g., file) will be closed anyway.

isAlreadyInUseError :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because one of its arguments is a single-use resource, which is already being used (for example, opening the same file twice for writing might give this error).

isPermissionError :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because the user does not have sufficient operating system privilege to perform that operation.

hSetBinaryMode :: Handle -> Bool -> IO () Source #

Select binary mode (`True`) or text mode (`False`) on a open handle. (See also `openBinaryFile`.)

This has the same effect as calling `hSetEncoding` with `char8`, together with `hSetNewlineMode` with `noNewlineTranslation`.

isFullError :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because the device is full.

isEOFError :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because the end of file has been reached.

localeEncoding :: TextEncoding Source #

The Unicode encoding of the current locale

This is the initial locale encoding: if it has been subsequently changed by `setLocaleEncoding` this value will not reflect that change.

isIllegalOperation :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because the operation was not possible. Any computation which returns an `IO` result may fail with `isIllegalOperation`. In some cases, an implementation will not be able to distinguish between the possible error causes. In this case it should fail with `isIllegalOperation`.

liftM :: Monad m => (a1 -> r) -> m a1 -> m r Source #

Promote a function to a monad.

forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId Source #

Fork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked.

    forkFinally action and_then =
      mask $ \restore ->
        forkIO $ try (restore action) >>= and_then

This function is useful for informing the parent when a child terminates, for example.

Since: base-4.6.0.0

getEnv :: String -> IO String Source #

Computation `getEnv` `var` returns the value of the environment variable `var`. For the inverse, the `setEnv` function can be used.

This computation may fail with:

- `isDoesNotExistError` if the environment variable does not exist.

setEnv :: String -> String -> IO () Source #

`setEnv name value` sets the specified environment variable to `value`.

Early versions of this function operated under the mistaken belief that setting an environment variable to the empty string on Windows removes that environment variable from the environment. For the sake of compatibility, it adopted that behavior on POSIX. In particular

    setEnv name ""

has the same effect as

    unsetEnv name

If you'd like to be able to set environment variables to blank strings, use `setEnv`.

Throws `IOException` if `name` is the empty string or contains an equals sign.

Since: base-4.7.0.0

lookupEnv :: String -> IO (Maybe String) Source #

Return the value of the environment variable `var`, or `Nothing` if there is no such value.

For POSIX users, this is equivalent to `getEnv`.

Since: base-4.6.0.0

unsetEnv :: String -> IO () Source #

`unsetEnv name` removes the specified environment variable from the environment of the current process.

Throws `IOException` if `name` is the empty string or contains an equals sign.

Since: base-4.7.0.0

unfoldr :: (b -> Maybe (a, b)) -> b -> [a] Source #

The `unfoldr` function is a `dual' to `foldr`: while `foldr` reduces a list to a summary value, `unfoldr` builds a list from a seed value. The function takes the element and returns `Nothing` if it is done producing the list or returns `Just` `(a,b)`, in which case, `a` is a prepended to the list and `b` is used as the next element in a recursive call. For example,

    iterate f == unfoldr (\x -> Just (x, f x))

In some cases, `unfoldr` can undo a `foldr` operation:

    unfoldr f' (foldr f z xs) == xs

if the following holds:

    f' (f x y) = Just (x,y)
    f' z       = Nothing

A simple use of unfoldr:

    >>> unfoldr (\b -> if b == 0 then Nothing else Just (b, b-1)) 10
    [10,9,8,7,6,5,4,3,2,1]

transpose :: [[a]] -> [[a]] Source #

The `transpose` function transposes the rows and columns of its argument. For example,

    >>> transpose [[1,2,3],[4,5,6]]
    [[1,4],[2,5],[3,6]]

If some of the rows are shorter than the following rows, their elements are skipped:

    >>> transpose [[10,11],[20],[],[30,31,32]]
    [[10,20,30],[11,31],[32]]

exitWith :: ExitCode -> IO a Source #

Computation `exitWith` `code` throws `ExitCode` `code`. Normally this terminates the program, returning `code` to the program's caller.

On program termination, the standard `Handle`s `stdout` and `stderr` are flushed automatically; any other buffered `Handle`s need to be flushed manually, otherwise the buffered data will be discarded.

A program that fails in any other way is treated as if it had called `exitFailure`. A program that terminates successfully without calling `exitWith` explicitly is treated as if it had called `exitWith` `ExitSuccess`.

As an `ExitCode` is not an `IOException`, `exitWith` bypasses the error handling in the `IO` monad and cannot be intercepted by `catch` from the Prelude. However it is a `SomeException`, and can be caught using the functions of Control.Exception. This means that cleanup computations added with `bracket` (from Control.Exception) are also executed properly on `exitWith`.

Note: in GHC, `exitWith` should be called from the main program thread in order to exit the process. When called from another thread, `exitWith` will throw an `ExitException` as normal, but the exception will not cause the process itself to exit.

hGetBuf :: Handle -> Ptr a -> Int -> IO Int Source #

`hGetBuf` `hdl buf count` reads data from the handle `hdl` into the buffer `buf` until either EOF is reached or `count` 8-bit bytes have been read. It returns the number of bytes actually read. This may be zero if EOF was reached before any data was read (or if `count` is zero).

`hGetBuf` never raises an EOF exception, instead it returns a value smaller than `count`.

If the handle is a pipe or socket, and the writing end is closed, `hGetBuf` will behave as if EOF was reached.

`hGetBuf` ignores the prevailing `TextEncoding` and `NewlineMode` on the `Handle`, and reads bytes directly.

hPutBuf :: Handle -> Ptr a -> Int -> IO () Source #

`hPutBuf` `hdl buf count` writes `count` 8-bit bytes from the buffer `buf` to the handle `hdl`. It returns ().

`hPutBuf` ignores any text encoding that applies to the `Handle`, writing the bytes directly to the underlying file or device.

`hPutBuf` ignores the prevailing `TextEncoding` and `NewlineMode` on the `Handle`, and writes bytes directly.

This operation may fail with:

- `ResourceVanished` if the handle is a pipe or socket, and the reading end is closed. (If this is a POSIX system, and the program has not asked to ignore SIGPIPE, then a SIGPIPE may be delivered instead, whose default action is to terminate the program).

hWaitForInput :: Handle -> Int -> IO Bool Source #

Computation `hWaitForInput` `hdl t` waits until input is available on handle `hdl`. It returns `True` as soon as input is available on `hdl`, or `False` if no input is available within `t` milliseconds. Note that `hWaitForInput` waits until one or more full characters are available, which means that it needs to do decoding, and hence may fail with a decoding error.

If `t` is less than zero, then `hWaitForInput` waits indefinitely.

This operation may fail with:

- `isEOFError` if the end of file has been reached.
- a decoding error, if the input begins with an invalid byte sequence in this Handle's encoding.

NOTE for GHC users: unless you use the `-threaded` flag, `hWaitForInput hdl t` where `t >= 0` will block all other Haskell threads for the duration of the call. It behaves like a `safe` foreign call in this respect.

sortOn :: Ord b => (a -> b) -> [a] -> [a] Source #

Sort a list by comparing the results of a key function applied to each element. `sortOn f` is equivalent to `sortBy (comparing f)`, but has the performance advantage of only evaluating `f` once for each element in the input list. This is called the decorate-sort-undecorate paradigm, or Schwartzian transform.

Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.

    >>> sortOn fst [(2, "world"), (4, "!"), (1, "Hello")]
    [(1,"Hello"),(2,"world"),(4,"!")]

Since: base-4.8.0.0

cycle :: HasCallStack => [a] -> [a] Source #

`cycle` ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.

    >>> cycle []
    *** Exception: Prelude.cycle: empty list
    >>> take 20 $ cycle [42]
    [42,42,42,42,42,42,42,42,42,42...
    >>> take 20 $ cycle [2, 5, 7]
    [2,5,7,2,5,7,2,5,7,2,5,7...

concat :: Foldable t => t [a] -> [a] Source #

The concatenation of all the elements of a container of lists.

#### Examples

Expand

Basic usage:

    >>> concat (Just [1, 2, 3])
    [1,2,3]

    >>> concat (Left 42)
    []

    >>> concat [[1, 2, 3], [4, 5], [6], []]
    [1,2,3,4,5,6]

zip :: [a] -> [b] -> [(a, b)] Source #

\(\mathcal{O}(\min(m,n))\). `zip` takes two lists and returns a list of corresponding pairs.

    >>> zip [1, 2] ['a', 'b']
    [(1,'a'),(2,'b')]

If one input list is shorter than the other, excess elements of the longer list are discarded, even if one of the lists is infinite:

    >>> zip [1] ['a', 'b']
    [(1,'a')]
    >>> zip [1, 2] ['a']
    [(1,'a')]
    >>> zip [] [1..]
    []
    >>> zip [1..] []
    []

`zip` is right-lazy:

    >>> zip [] undefined
    []
    >>> zip undefined []
    *** Exception: Prelude.undefined
    ...

`zip` is capable of list fusion, but it is restricted to its first list argument and its resulting list.

print :: Show a => a -> IO () Source #

The `print` function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class `Show`; `print` converts values to strings for output using the `show` operation and adds a newline.

For example, a program to print the first 20 integers and their powers of 2 could be written as:

    main = print ([(n, 2^n) | n <- [0..19]])

trace :: String -> a -> a Source #

The `trace` function outputs the trace message given as its first argument, before returning the second argument as its result.

For example, this returns the value of `f x` and outputs the message to stderr. Depending on your terminal (settings), they may or may not be mixed.

    >>> let x = 123; f = show
    >>> trace ("calling f with x = " ++ show x) (f x)
    calling f with x = 123
    "123"

The `trace` function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.

guard :: Alternative f => Bool -> f () Source #

Conditional failure of `Alternative` computations. Defined by

    guard True  = pure ()
    guard False = empty

#### Examples

Expand

Common uses of `guard` include conditionally signaling an error in an error monad and conditionally rejecting the current choice in an `Alternative`-based parser.

As an example of signaling an error in the error monad `Maybe`, consider a safe division function `safeDiv x y` that returns `Nothing` when the denominator `y` is zero and ``Just` (x `div` y)` otherwise. For example:

    >>> safeDiv 4 0
    Nothing

    >>> safeDiv 4 2
    Just 2

A definition of `safeDiv` using guards, but not `guard`:

    safeDiv :: Int -> Int -> Maybe Int
    safeDiv x y | y /= 0    = Just (x `div` y)
                | otherwise = Nothing

A definition of `safeDiv` using `guard` and `Monad` `do`-notation:

    safeDiv :: Int -> Int -> Maybe Int
    safeDiv x y = do
      guard (y /= 0)
      return (x `div` y)

(<**>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 Source #

A variant of `<*>` with the arguments reversed.

liftA :: Applicative f => (a -> b) -> f a -> f b Source #

Lift a function to actions. Equivalent to Functor's `fmap` but implemented using only `Applicative`'s methods: `liftA f a = pure f * a`

As such this function may be used to implement a `Functor` instance from an `Applicative` one.

liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #

Lift a ternary function to actions.

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 Source #

Same as `>>=`, but with the arguments interchanged.

when :: Applicative f => Bool -> f () -> f () Source #

Conditional execution of `Applicative` expressions. For example,

    when debug (putStrLn "Debugging")

will output the string `Debugging` if the Boolean value `debug` is `True`, and otherwise do nothing.

liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r Source #

Promote a function to a monad, scanning the monadic arguments from left to right. For example,

    liftM2 (+) [0,1] [0,2] = [0,2,1,3]
    liftM2 (+) (Just 1) Nothing = Nothing

liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r Source #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. `liftM2`).

liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r Source #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. `liftM2`).

liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r Source #

Promote a function to a monad, scanning the monadic arguments from left to right (cf. `liftM2`).

ap :: Monad m => m (a -> b) -> m a -> m b Source #

In many situations, the `liftM` operations can be replaced by uses of `ap`, which promotes function application.

    return f `ap` x1 `ap` ... `ap` xn

is equivalent to

    liftMn f x1 x2 ... xn

maybe :: b -> (a -> b) -> Maybe a -> b Source #

The `maybe` function takes a default value, a function, and a `Maybe` value. If the `Maybe` value is `Nothing`, the function returns the default value. Otherwise, it applies the function to the value inside the `Just` and returns the result.

#### Examples

Expand

Basic usage:

    >>> maybe False odd (Just 3)
    True

    >>> maybe False odd Nothing
    False

Read an integer from a string using `readMaybe`. If we succeed, return twice the integer; that is, apply `(*2)` to it. If instead we fail to parse an integer, return `0` by default:

    >>> import Text.Read ( readMaybe )
    >>> maybe 0 (*2) (readMaybe "5")
    10
    >>> maybe 0 (*2) (readMaybe "")
    0

Apply `show` to a `Maybe Int`. If we have `Just n`, we want to show the underlying `Int` `n`. But if we have `Nothing`, we return the empty string instead of (for example) "Nothing":

    >>> maybe "" show (Just 5)
    "5"
    >>> maybe "" show Nothing
    ""

isJust :: Maybe a -> Bool Source #

The `isJust` function returns `True` iff its argument is of the form `Just _`.

#### Examples

Expand

Basic usage:

    >>> isJust (Just 3)
    True

    >>> isJust (Just ())
    True

    >>> isJust Nothing
    False

Only the outer constructor is taken into consideration:

    >>> isJust (Just Nothing)
    True

isNothing :: Maybe a -> Bool Source #

The `isNothing` function returns `True` iff its argument is `Nothing`.

#### Examples

Expand

Basic usage:

    >>> isNothing (Just 3)
    False

    >>> isNothing (Just ())
    False

    >>> isNothing Nothing
    True

Only the outer constructor is taken into consideration:

    >>> isNothing (Just Nothing)
    False

fromJust :: HasCallStack => Maybe a -> a Source #

The `fromJust` function extracts the element out of a `Just` and throws an error if its argument is `Nothing`.

#### Examples

Expand

Basic usage:

    >>> fromJust (Just 1)
    1

    >>> 2 * (fromJust (Just 10))
    20

    >>> 2 * (fromJust Nothing)
    *** Exception: Maybe.fromJust: Nothing
    ...

WARNING: This function is partial. You can use case-matching instead.

fromMaybe :: a -> Maybe a -> a Source #

The `fromMaybe` function takes a default value and a `Maybe` value. If the `Maybe` is `Nothing`, it returns the default value; otherwise, it returns the value contained in the `Maybe`.

#### Examples

Expand

Basic usage:

    >>> fromMaybe "" (Just "Hello, World!")
    "Hello, World!"

    >>> fromMaybe "" Nothing
    ""

Read an integer from a string using `readMaybe`. If we fail to parse an integer, we want to return `0` by default:

    >>> import Text.Read ( readMaybe )
    >>> fromMaybe 0 (readMaybe "5")
    5
    >>> fromMaybe 0 (readMaybe "")
    0

maybeToList :: Maybe a -> [a] Source #

The `maybeToList` function returns an empty list when given `Nothing` or a singleton list when given `Just`.

#### Examples

Expand

Basic usage:

    >>> maybeToList (Just 7)
    [7]

    >>> maybeToList Nothing
    []

One can use `maybeToList` to avoid pattern matching when combined with a function that (safely) works on lists:

    >>> import Text.Read ( readMaybe )
    >>> sum $ maybeToList (readMaybe "3")
    3
    >>> sum $ maybeToList (readMaybe "")
    0

listToMaybe :: [a] -> Maybe a Source #

The `listToMaybe` function returns `Nothing` on an empty list or ``Just` a` where `a` is the first element of the list.

#### Examples

Expand

Basic usage:

    >>> listToMaybe []
    Nothing

    >>> listToMaybe [9]
    Just 9

    >>> listToMaybe [1,2,3]
    Just 1

Composing `maybeToList` with `listToMaybe` should be the identity on singleton/empty lists:

    >>> maybeToList $ listToMaybe [5]
    [5]
    >>> maybeToList $ listToMaybe []
    []

But not on lists with more than one element:

    >>> maybeToList $ listToMaybe [1,2,3]
    [1]

catMaybes :: [Maybe a] -> [a] Source #

The `catMaybes` function takes a list of `Maybe`s and returns a list of all the `Just` values.

#### Examples

Expand

Basic usage:

    >>> catMaybes [Just 1, Nothing, Just 3]
    [1,3]

When constructing a list of `Maybe` values, `catMaybes` can be used to return all of the "success" results (if the list is the result of a `map`, then `mapMaybe` would be more appropriate):

    >>> import Text.Read ( readMaybe )
    >>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
    [Just 1,Nothing,Just 3]
    >>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
    [1,3]

head :: HasCallStack => [a] -> a Source #

\(\mathcal{O}(1)\). Extract the first element of a list, which must be non-empty.

    >>> head [1, 2, 3]
    1
    >>> head [1..]
    1
    >>> head []
    *** Exception: Prelude.head: empty list

WARNING: This function is partial. You can use case-matching, `uncons` or `listToMaybe` instead.

uncons :: [a] -> Maybe (a, [a]) Source #

\(\mathcal{O}(1)\). Decompose a list into its head and tail.

- If the list is empty, returns `Nothing`.
- If the list is non-empty, returns ``Just` (x, xs)`, where `x` is the head of the list and `xs` its tail.

    >>> uncons []
    Nothing
    >>> uncons [1]
    Just (1,[])
    >>> uncons [1, 2, 3]
    Just (1,[2,3])

Since: base-4.8.0.0

tail :: HasCallStack => [a] -> [a] Source #

\(\mathcal{O}(1)\). Extract the elements after the head of a list, which must be non-empty.

    >>> tail [1, 2, 3]
    [2,3]
    >>> tail [1]
    []
    >>> tail []
    *** Exception: Prelude.tail: empty list

WARNING: This function is partial. You can use case-matching or `uncons` instead.

last :: HasCallStack => [a] -> a Source #

\(\mathcal{O}(n)\). Extract the last element of a list, which must be finite and non-empty.

    >>> last [1, 2, 3]
    3
    >>> last [1..]
    * Hangs forever *
    >>> last []
    *** Exception: Prelude.last: empty list

WARNING: This function is partial. You can use `reverse` with case-matching, `uncons` or `listToMaybe` instead.

init :: HasCallStack => [a] -> [a] Source #

\(\mathcal{O}(n)\). Return all the elements of a list except the last one. The list must be non-empty.

    >>> init [1, 2, 3]
    [1,2]
    >>> init [1]
    []
    >>> init []
    *** Exception: Prelude.init: empty list

WARNING: This function is partial. You can use `reverse` with case-matching or `uncons` instead.

foldl1' :: HasCallStack => (a -> a -> a) -> [a] -> a Source #

A strict version of `foldl1`.

scanl :: (b -> a -> b) -> b -> [a] -> [b] Source #

\(\mathcal{O}(n)\). `scanl` is similar to `foldl`, but returns a list of successive reduced values from the left:

    scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]

Note that

    last (scanl f z xs) == foldl f z xs

    >>> scanl (+) 0 [1..4]
    [0,1,3,6,10]
    >>> scanl (+) 42 []
    [42]
    >>> scanl (-) 100 [1..4]
    [100,99,97,94,90]
    >>> scanl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']
    ["foo","afoo","bafoo","cbafoo","dcbafoo"]
    >>> scanl (+) 0 [1..]
    * Hangs forever *

scanl1 :: (a -> a -> a) -> [a] -> [a] Source #

\(\mathcal{O}(n)\). `scanl1` is a variant of `scanl` that has no starting value argument:

    scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]

    >>> scanl1 (+) [1..4]
    [1,3,6,10]
    >>> scanl1 (+) []
    []
    >>> scanl1 (-) [1..4]
    [1,-1,-4,-8]
    >>> scanl1 (&&) [True, False, True, True]
    [True,False,False,False]
    >>> scanl1 (||) [False, False, True, True]
    [False,False,True,True]
    >>> scanl1 (+) [1..]
    * Hangs forever *

scanl' :: (b -> a -> b) -> b -> [a] -> [b] Source #

\(\mathcal{O}(n)\). A strict version of `scanl`.

scanr :: (a -> b -> b) -> b -> [a] -> [b] Source #

\(\mathcal{O}(n)\). `scanr` is the right-to-left dual of `scanl`. Note that the order of parameters on the accumulating function are reversed compared to `scanl`. Also note that

    head (scanr f z xs) == foldr f z xs.

    >>> scanr (+) 0 [1..4]
    [10,9,7,4,0]
    >>> scanr (+) 42 []
    [42]
    >>> scanr (-) 100 [1..4]
    [98,-97,99,-96,100]
    >>> scanr (\nextChar reversedString -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']
    ["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]
    >>> force $ scanr (+) 0 [1..]
    *** Exception: stack overflow

scanr1 :: (a -> a -> a) -> [a] -> [a] Source #

\(\mathcal{O}(n)\). `scanr1` is a variant of `scanr` that has no starting value argument.

    >>> scanr1 (+) [1..4]
    [10,9,7,4]
    >>> scanr1 (+) []
    []
    >>> scanr1 (-) [1..4]
    [-2,3,-1,4]
    >>> scanr1 (&&) [True, False, True, True]
    [False,False,True,True]
    >>> scanr1 (||) [True, True, False, False]
    [True,True,False,False]
    >>> force $ scanr1 (+) [1..]
    *** Exception: stack overflow

iterate :: (a -> a) -> a -> [a] Source #

`iterate` `f x` returns an infinite list of repeated applications of `f` to `x`:

    iterate f x == [x, f x, f (f x), ...]

Note that `iterate` is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See `iterate'` for a strict variant of this function.

    >>> take 10 $ iterate not True
    [True,False,True,False...
    >>> take 10 $ iterate (+3) 42
    [42,45,48,51,54,57,60,63...

iterate' :: (a -> a) -> a -> [a] Source #

`iterate'` is the strict version of `iterate`.

It forces the result of each application of the function to weak head normal form (WHNF) before proceeding.

repeat :: a -> [a] Source #

`repeat` `x` is an infinite list, with `x` the value of every element.

    >>> take 20 $ repeat 17
    [17,17,17,17,17,17,17,17,17...

replicate :: Int -> a -> [a] Source #

`replicate` `n x` is a list of length `n` with `x` the value of every element. It is an instance of the more general `genericReplicate`, in which `n` may be of any integral type.

    >>> replicate 0 True
    []
    >>> replicate (-1) True
    []
    >>> replicate 4 True
    [True,True,True,True]

takeWhile :: (a -> Bool) -> [a] -> [a] Source #

`takeWhile`, applied to a predicate `p` and a list `xs`, returns the longest prefix (possibly empty) of `xs` of elements that satisfy `p`.

    >>> takeWhile (< 3) [1,2,3,4,1,2,3,4]
    [1,2]
    >>> takeWhile (< 9) [1,2,3]
    [1,2,3]
    >>> takeWhile (< 0) [1,2,3]
    []

dropWhile :: (a -> Bool) -> [a] -> [a] Source #

`dropWhile` `p xs` returns the suffix remaining after `takeWhile` `p xs`.

    >>> dropWhile (< 3) [1,2,3,4,5,1,2,3]
    [3,4,5,1,2,3]
    >>> dropWhile (< 9) [1,2,3]
    []
    >>> dropWhile (< 0) [1,2,3]
    [1,2,3]

take :: Int -> [a] -> [a] Source #

`take` `n`, applied to a list `xs`, returns the prefix of `xs` of length `n`, or `xs` itself if `n >= `length` xs`.

    >>> take 5 "Hello World!"
    "Hello"
    >>> take 3 [1,2,3,4,5]
    [1,2,3]
    >>> take 3 [1,2]
    [1,2]
    >>> take 3 []
    []
    >>> take (-1) [1,2]
    []
    >>> take 0 [1,2]
    []

It is an instance of the more general `genericTake`, in which `n` may be of any integral type.

drop :: Int -> [a] -> [a] Source #

`drop` `n xs` returns the suffix of `xs` after the first `n` elements, or `[]` if `n >= `length` xs`.

    >>> drop 6 "Hello World!"
    "World!"
    >>> drop 3 [1,2,3,4,5]
    [4,5]
    >>> drop 3 [1,2]
    []
    >>> drop 3 []
    []
    >>> drop (-1) [1,2]
    [1,2]
    >>> drop 0 [1,2]
    [1,2]

It is an instance of the more general `genericDrop`, in which `n` may be of any integral type.

splitAt :: Int -> [a] -> ([a], [a]) Source #

`splitAt` `n xs` returns a tuple where first element is `xs` prefix of length `n` and second element is the remainder of the list:

    >>> splitAt 6 "Hello World!"
    ("Hello ","World!")
    >>> splitAt 3 [1,2,3,4,5]
    ([1,2,3],[4,5])
    >>> splitAt 1 [1,2,3]
    ([1],[2,3])
    >>> splitAt 3 [1,2,3]
    ([1,2,3],[])
    >>> splitAt 4 [1,2,3]
    ([1,2,3],[])
    >>> splitAt 0 [1,2,3]
    ([],[1,2,3])
    >>> splitAt (-1) [1,2,3]
    ([],[1,2,3])

It is equivalent to `(`take` n xs, `drop` n xs)` when `n` is not `_|_` (`splitAt _|_ xs = _|_`). `splitAt` is an instance of the more general `genericSplitAt`, in which `n` may be of any integral type.

span :: (a -> Bool) -> [a] -> ([a], [a]) Source #

`span`, applied to a predicate `p` and a list `xs`, returns a tuple where first element is longest prefix (possibly empty) of `xs` of elements that satisfy `p` and second element is the remainder of the list:

    >>> span (< 3) [1,2,3,4,1,2,3,4]
    ([1,2],[3,4,1,2,3,4])
    >>> span (< 9) [1,2,3]
    ([1,2,3],[])
    >>> span (< 0) [1,2,3]
    ([],[1,2,3])

`span` `p xs` is equivalent to `(`takeWhile` p xs, `dropWhile` p xs)`

break :: (a -> Bool) -> [a] -> ([a], [a]) Source #

`break`, applied to a predicate `p` and a list `xs`, returns a tuple where first element is longest prefix (possibly empty) of `xs` of elements that do not satisfy `p` and second element is the remainder of the list:

    >>> break (> 3) [1,2,3,4,1,2,3,4]
    ([1,2,3],[4,1,2,3,4])
    >>> break (< 9) [1,2,3]
    ([],[1,2,3])
    >>> break (> 9) [1,2,3]
    ([1,2,3],[])

`break` `p` is equivalent to ``span` (`not` . p)`.

reverse :: [a] -> [a] Source #

`reverse` `xs` returns the elements of `xs` in reverse order. `xs` must be finite.

    >>> reverse []
    []
    >>> reverse [42]
    [42]
    >>> reverse [2,5,7]
    [7,5,2]
    >>> reverse [1..]
    * Hangs forever *

and :: Foldable t => t Bool -> Bool Source #

`and` returns the conjunction of a container of Bools. For the result to be `True`, the container must be finite; `False`, however, results from a `False` value finitely far from the left end.

#### Examples

Expand

Basic usage:

    >>> and []
    True

    >>> and [True]
    True

    >>> and [False]
    False

    >>> and [True, True, False]
    False

    >>> and (False : repeat True) -- Infinite list [False,True,True,True,...
    False

    >>> and (repeat True)
    * Hangs forever *

or :: Foldable t => t Bool -> Bool Source #

`or` returns the disjunction of a container of Bools. For the result to be `False`, the container must be finite; `True`, however, results from a `True` value finitely far from the left end.

#### Examples

Expand

Basic usage:

    >>> or []
    False

    >>> or [True]
    True

    >>> or [False]
    False

    >>> or [True, True, False]
    True

    >>> or (True : repeat False) -- Infinite list [True,False,False,False,...
    True

    >>> or (repeat False)
    * Hangs forever *

any :: Foldable t => (a -> Bool) -> t a -> Bool Source #

Determines whether any element of the structure satisfies the predicate.

#### Examples

Expand

Basic usage:

    >>> any (> 3) []
    False

    >>> any (> 3) [1,2]
    False

    >>> any (> 3) [1,2,3,4,5]
    True

    >>> any (> 3) [1..]
    True

    >>> any (> 3) [0, -1..]
    * Hangs forever *

all :: Foldable t => (a -> Bool) -> t a -> Bool Source #

Determines whether all elements of the structure satisfy the predicate.

#### Examples

Expand

Basic usage:

    >>> all (> 3) []
    True

    >>> all (> 3) [1,2]
    False

    >>> all (> 3) [1,2,3,4,5]
    False

    >>> all (> 3) [1..]
    False

    >>> all (> 3) [4..]
    * Hangs forever *

notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 Source #

`notElem` is the negation of `elem`.

#### Examples

Expand

Basic usage:

    >>> 3 `notElem` []
    True

    >>> 3 `notElem` [1,2]
    True

    >>> 3 `notElem` [1,2,3,4,5]
    False

For infinite structures, `notElem` terminates if the value exists at a finite distance from the left side of the structure:

    >>> 3 `notElem` [1..]
    False

    >>> 3 `notElem` ([4..] ++ [3])
    * Hangs forever *

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] Source #

Map a function over all the elements of a container and concatenate the resulting lists.

#### Examples

Expand

Basic usage:

    >>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]
    [1,2,3,10,11,12,100,101,102,1000,1001,1002]

    >>> concatMap (take 3) (Just [1..])
    [1,2,3]

(!!) :: HasCallStack => [a] -> Int -> a infixl 9 Source #

List index (subscript) operator, starting from 0. It is an instance of the more general `genericIndex`, which takes an index of any integral type.

    >>> ['a', 'b', 'c'] !! 0
    'a'
    >>> ['a', 'b', 'c'] !! 2
    'c'
    >>> ['a', 'b', 'c'] !! 3
    *** Exception: Prelude.!!: index too large
    >>> ['a', 'b', 'c'] !! (-1)
    *** Exception: Prelude.!!: negative index

WARNING: This function is partial. You can use <`atMay` https://hackage.haskell.org/package/safe-0.3.19/docs/Safe.html#v:atMay> instead.

zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] Source #

`zip3` takes three lists and returns a list of triples, analogous to `zip`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] Source #

The `zipWith3` function takes a function which combines three elements, as well as three lists and returns a list of the function applied to corresponding elements, analogous to `zipWith`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

    zipWith3 (,,) xs ys zs == zip3 xs ys zs
    zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..]

unzip :: [(a, b)] -> ([a], [b]) Source #

`unzip` transforms a list of pairs into a list of first components and a list of second components.

    >>> unzip []
    ([],[])
    >>> unzip [(1, 'a'), (2, 'b')]
    ([1,2],"ab")

unzip3 :: [(a, b, c)] -> ([a], [b], [c]) Source #

The `unzip3` function takes a list of triples and returns three lists, analogous to `unzip`.

    >>> unzip3 []
    ([],[],[])
    >>> unzip3 [(1, 'a', True), (2, 'b', False)]
    ([1,2],"ab",[True,False])

showLitChar :: Char -> ShowS Source #

Convert a character to a string using only printable characters, using Haskell source-language escape conventions. For example:

    showLitChar '\n' s  =  "\\n" ++ s

intToDigit :: Int -> Char Source #

Convert an `Int` in the range `0`..`15` to the corresponding single digit `Char`. This function fails on other inputs, and generates lower-case hexadecimal digits.

generalCategory :: Char -> GeneralCategory Source #

The Unicode general category of the character. This relies on the `Enum` instance of `GeneralCategory`, which must remain in the same order as the categories are presented in the Unicode standard.

#### Examples

Expand

Basic usage:

    >>> generalCategory 'a'
    LowercaseLetter
    >>> generalCategory 'A'
    UppercaseLetter
    >>> generalCategory '0'
    DecimalNumber
    >>> generalCategory '%'
    OtherPunctuation
    >>> generalCategory '♥'
    OtherSymbol
    >>> generalCategory '\31'
    Control
    >>> generalCategory ' '
    Space

isAscii :: Char -> Bool Source #

Selects the first 128 characters of the Unicode character set, corresponding to the ASCII character set.

isLatin1 :: Char -> Bool Source #

Selects the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set.

isAsciiLower :: Char -> Bool Source #

Selects ASCII lower-case letters, i.e. characters satisfying both `isAscii` and `isLower`.

isAsciiUpper :: Char -> Bool Source #

Selects ASCII upper-case letters, i.e. characters satisfying both `isAscii` and `isUpper`.

isSpace :: Char -> Bool Source #

Returns `True` for any Unicode space character, and the control characters `\t`, `\n`, `\r`, `\f`, `\v`.

isDigit :: Char -> Bool Source #

Selects ASCII digits, i.e. `'0'`..`'9'`.

isOctDigit :: Char -> Bool Source #

Selects ASCII octal digits, i.e. `'0'`..`'7'`.

isHexDigit :: Char -> Bool Source #

Selects ASCII hexadecimal digits, i.e. `'0'`..`'9'`, `'a'`..`'f'`, `'A'`..`'F'`.

isPunctuation :: Char -> Bool Source #

Selects Unicode punctuation characters, including various kinds of connectors, brackets and quotes.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `ConnectorPunctuation`
- `DashPunctuation`
- `OpenPunctuation`
- `ClosePunctuation`
- `InitialQuote`
- `FinalQuote`
- `OtherPunctuation`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Punctuation".

#### Examples

Expand

Basic usage:

    >>> isPunctuation 'a'
    False
    >>> isPunctuation '7'
    False
    >>> isPunctuation '♥'
    False
    >>> isPunctuation '"'
    True
    >>> isPunctuation '?'
    True
    >>> isPunctuation '—'
    True

isSymbol :: Char -> Bool Source #

Selects Unicode symbol characters, including mathematical and currency symbols.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `MathSymbol`
- `CurrencySymbol`
- `ModifierSymbol`
- `OtherSymbol`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Symbol".

#### Examples

Expand

Basic usage:

    >>> isSymbol 'a'
    False
    >>> isSymbol '6'
    False
    >>> isSymbol '='
    True

The definition of "math symbol" may be a little counter-intuitive depending on one's background:

    >>> isSymbol '+'
    True
    >>> isSymbol '-'
    False

isAlphaNum :: Char -> Bool Source #

Selects alphabetic or numeric Unicode characters.

Note that numeric digits outside the ASCII range, as well as numeric characters which aren't digits, are selected by this function but not by `isDigit`. Such characters may be part of identifiers but are not used by the printer and reader to represent numbers.

isControl :: Char -> Bool Source #

Selects control characters, which are the non-printing characters of the Latin-1 subset of Unicode.

isPrint :: Char -> Bool Source #

Selects printable Unicode characters (letters, numbers, marks, punctuation, symbols and spaces).

isUpper :: Char -> Bool Source #

Selects upper-case or title-case alphabetic Unicode characters (letters). Title case is used by a small number of letter ligatures like the single-character form of Lj.

isLower :: Char -> Bool Source #

Selects lower-case alphabetic Unicode characters (letters).

toTitle :: Char -> Char Source #

Convert a letter to the corresponding title-case or upper-case letter, if any. (Title case differs from upper case only for a small number of ligature letters.) Any other character is returned unchanged.

optional :: Alternative f => f a -> f (Maybe a) Source #

One or none.

It is useful for modelling any computation that is allowed to fail.

#### Examples

Expand

Using the `Alternative` instance of Control.Monad.Except, the following functions:

    >>> import Control.Monad.Except

    >>> canFail = throwError "it failed" :: Except String Int
    >>> final = return 42                :: Except String Int

Can be combined by allowing the first function to fail:

    >>> runExcept $ canFail *> final
    Left "it failed"
    >>> runExcept $ optional canFail *> final
    Right 42

formatRealFloat :: RealFloat a => a -> FieldFormatter Source #

Formatter for `RealFloat` values.

Since: base-4.7.0.0

clamp :: Ord a => (a, a) -> a -> a Source #

    clamp (low, high) a = min high (max a low)

Function for ensursing the value `a` is within the inclusive bounds given by `low` and `high`. If it is, `a` is returned unchanged. The result is otherwise `low` if `a <= low`, or `high` if `high <= a`.

When clamp is used at Double and Float, it has NaN propagating semantics in its second argument. That is, `clamp (l,h) NaN = NaN`, but `clamp (NaN, NaN) x = x`.

    >>> clamp (0, 10) 2
    2

    >>> clamp ('a', 'm') 'x'
    'm'

lexLitChar :: ReadS String Source #

Read a string representation of a character, using Haskell source-language escape conventions. For example:

    lexLitChar  "\\nHello"  =  [("\\n", "Hello")]

readLitChar :: ReadS Char Source #

Read a string representation of a character, using Haskell source-language escape conventions, and convert it to the character that it encodes. For example:

    readLitChar "\\nHello"  =  [('\n', "Hello")]

myThreadId :: IO ThreadId Source #

Returns the `ThreadId` of the calling thread (GHC only).

either :: (a -> c) -> (b -> c) -> Either a b -> c Source #

Case analysis for the `Either` type. If the value is ``Left` a`, apply the first function to `a`; if it is ``Right` b`, apply the second function to `b`.

#### Examples

Expand

We create two values of type ``Either` `String` `Int``, one using the `Left` constructor and another using the `Right` constructor. Then we apply "either" the `length` function (if we have a `String`) or the "times-two" function (if we have an `Int`):

    >>> let s = Left "foo" :: Either String Int
    >>> let n = Right 3 :: Either String Int
    >>> either length (*2) s
    3
    >>> either length (*2) n
    6

lefts :: [Either a b] -> [a] Source #

Extracts from a list of `Either` all the `Left` elements. All the `Left` elements are extracted in order.

#### Examples

Expand

Basic usage:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> lefts list
    ["foo","bar","baz"]

rights :: [Either a b] -> [b] Source #

Extracts from a list of `Either` all the `Right` elements. All the `Right` elements are extracted in order.

#### Examples

Expand

Basic usage:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> rights list
    [3,7]

partitionEithers :: [Either a b] -> ([a], [b]) Source #

Partitions a list of `Either` into two lists. All the `Left` elements are extracted, in order, to the first component of the output. Similarly the `Right` elements are extracted to the second component of the output.

#### Examples

Expand

Basic usage:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> partitionEithers list
    (["foo","bar","baz"],[3,7])

The pair returned by ``partitionEithers` x` should be the same pair as `(`lefts` x, `rights` x)`:

    >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
    >>> partitionEithers list == (lefts list, rights list)
    True

isLeft :: Either a b -> Bool Source #

Return `True` if the given value is a `Left`-value, `False` otherwise.

#### Examples

Expand

Basic usage:

    >>> isLeft (Left "foo")
    True
    >>> isLeft (Right 3)
    False

Assuming a `Left` value signifies some sort of error, we can use `isLeft` to write a very simple error-reporting function that does absolutely nothing in the case of success, and outputs "ERROR" if any error occurred.

This example shows how `isLeft` might be used to avoid pattern matching when one does not care about the value contained in the constructor:

    >>> import Control.Monad ( when )
    >>> let report e = when (isLeft e) $ putStrLn "ERROR"
    >>> report (Right 1)
    >>> report (Left "parse error")
    ERROR

Since: base-4.7.0.0

isRight :: Either a b -> Bool Source #

Return `True` if the given value is a `Right`-value, `False` otherwise.

#### Examples

Expand

Basic usage:

    >>> isRight (Left "foo")
    False
    >>> isRight (Right 3)
    True

Assuming a `Left` value signifies some sort of error, we can use `isRight` to write a very simple reporting function that only outputs "SUCCESS" when a computation has succeeded.

This example shows how `isRight` might be used to avoid pattern matching when one does not care about the value contained in the constructor:

    >>> import Control.Monad ( when )
    >>> let report e = when (isRight e) $ putStrLn "SUCCESS"
    >>> report (Left "parse error")
    >>> report (Right 1)
    SUCCESS

Since: base-4.7.0.0

fromLeft :: a -> Either a b -> a Source #

Return the contents of a `Left`-value or a default value otherwise.

#### Examples

Expand

Basic usage:

    >>> fromLeft 1 (Left 3)
    3
    >>> fromLeft 1 (Right "foo")
    1

Since: base-4.10.0.0

fromRight :: b -> Either a b -> b Source #

Return the contents of a `Right`-value or a default value otherwise.

#### Examples

Expand

Basic usage:

    >>> fromRight 1 (Right 3)
    3
    >>> fromRight 1 (Left "foo")
    1

Since: base-4.10.0.0

comparing :: Ord a => (b -> a) -> b -> b -> Ordering Source #

    comparing p x y = compare (p x) (p y)

Useful combinator for use in conjunction with the `xxxBy` family of functions from Data.List, for example:

      ... sortBy (comparing fst) ...

digitToInt :: Char -> Int Source #

Convert a single digit `Char` to the corresponding `Int`. This function fails unless its argument satisfies `isHexDigit`, but recognises both upper- and lower-case hexadecimal digits (that is, `'0'`..`'9'`, `'a'`..`'f'`, `'A'`..`'F'`).

#### Examples

Expand

Characters `'0'` through `'9'` are converted properly to `0..9`:

    >>> map digitToInt ['0'..'9']
    [0,1,2,3,4,5,6,7,8,9]

Both upper- and lower-case `'A'` through `'F'` are converted as well, to `10..15`.

    >>> map digitToInt ['a'..'f']
    [10,11,12,13,14,15]
    >>> map digitToInt ['A'..'F']
    [10,11,12,13,14,15]

Anything else throws an exception:

    >>> digitToInt 'G'
    *** Exception: Char.digitToInt: not a digit 'G'
    >>> digitToInt '♥'
    *** Exception: Char.digitToInt: not a digit '\9829'

isMark :: Char -> Bool Source #

Selects Unicode mark characters, for example accents and the like, which combine with preceding characters.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `NonSpacingMark`
- `SpacingCombiningMark`
- `EnclosingMark`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Mark".

#### Examples

Expand

Basic usage:

    >>> isMark 'a'
    False
    >>> isMark '0'
    False

Combining marks such as accent characters usually need to follow another character before they become printable:

    >>> map isMark "ò"
    [False,True]

Puns are not necessarily supported:

    >>> isMark '✓'
    False

isNumber :: Char -> Bool Source #

Selects Unicode numeric characters, including digits from various scripts, Roman numerals, et cetera.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `DecimalNumber`
- `LetterNumber`
- `OtherNumber`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Number".

#### Examples

Expand

Basic usage:

    >>> isNumber 'a'
    False
    >>> isNumber '%'
    False
    >>> isNumber '3'
    True

ASCII `'0'` through `'9'` are all numbers:

    >>> and $ map isNumber ['0'..'9']
    True

Unicode Roman numerals are "numbers" as well:

    >>> isNumber 'Ⅸ'
    True

isSeparator :: Char -> Bool Source #

Selects Unicode space and separator characters.

This function returns `True` if its argument has one of the following `GeneralCategory`s, or `False` otherwise:

- `Space`
- `LineSeparator`
- `ParagraphSeparator`

These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Separator".

#### Examples

Expand

Basic usage:

    >>> isSeparator 'a'
    False
    >>> isSeparator '6'
    False
    >>> isSeparator ' '
    True

Warning: newlines and tab characters are not considered separators.

    >>> isSeparator '\n'
    False
    >>> isSeparator '\t'
    False

But some more exotic characters are (like HTML's `&nbsp;`):

    >>> isSeparator '\160'
    True

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () Source #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see `mapM`.

`mapM_` is just like `traverse_`, but specialised to monadic actions.

forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () Source #

`forM_` is `mapM_` with its arguments flipped. For a version that doesn't ignore the results see `forM`.

`forM_` is just like `for_`, but specialised to monadic actions.

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () Source #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see `sequence`.

`sequence_` is just like `sequenceA_`, but specialised to monadic actions.

asum :: (Foldable t, Alternative f) => t (f a) -> f a Source #

The sum of a collection of actions, generalizing `concat`.

`asum` is just like `msum`, but generalised to `Alternative`.

#### Examples

Expand

Basic usage:

    >>> asum [Just "Hello", Nothing, Just "World"]
    Just "Hello"

msum :: (Foldable t, MonadPlus m) => t (m a) -> m a Source #

The sum of a collection of actions, generalizing `concat`.

`msum` is just like `asum`, but specialised to `MonadPlus`.

find :: Foldable t => (a -> Bool) -> t a -> Maybe a Source #

The `find` function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or `Nothing` if there is no such element.

#### Examples

Expand

Basic usage:

    >>> find (> 42) [0, 5..]
    Just 45

    >>> find (> 12) [1..7]
    Nothing

dropWhileEnd :: (a -> Bool) -> [a] -> [a] Source #

The `dropWhileEnd` function drops the largest suffix of a list in which the given predicate holds for all elements. For example:

    >>> dropWhileEnd isSpace "foo\n"
    "foo"

    >>> dropWhileEnd isSpace "foo bar"
    "foo bar"

    dropWhileEnd isSpace ("foo\n" ++ undefined) == "foo" ++ undefined

Since: base-4.5.0.0

stripPrefix :: Eq a => [a] -> [a] -> Maybe [a] Source #

\(\mathcal{O}(\min(m,n))\). The `stripPrefix` function drops the given prefix from a list. It returns `Nothing` if the list did not start with the prefix given, or `Just` the list after the prefix, if it does.

    >>> stripPrefix "foo" "foobar"
    Just "bar"

    >>> stripPrefix "foo" "foo"
    Just ""

    >>> stripPrefix "foo" "barfoo"
    Nothing

    >>> stripPrefix "foo" "barfoobaz"
    Nothing

elemIndex :: Eq a => a -> [a] -> Maybe Int Source #

The `elemIndex` function returns the index of the first element in the given list which is equal (by `==`) to the query element, or `Nothing` if there is no such element.

    >>> elemIndex 4 [0..]
    Just 4

elemIndices :: Eq a => a -> [a] -> [Int] Source #

The `elemIndices` function extends `elemIndex`, by returning the indices of all elements equal to the query element, in ascending order.

    >>> elemIndices 'o' "Hello World"
    [4,7]

findIndex :: (a -> Bool) -> [a] -> Maybe Int Source #

The `findIndex` function takes a predicate and a list and returns the index of the first element in the list satisfying the predicate, or `Nothing` if there is no such element.

    >>> findIndex isSpace "Hello World!"
    Just 5

findIndices :: (a -> Bool) -> [a] -> [Int] Source #

The `findIndices` function extends `findIndex`, by returning the indices of all elements satisfying the predicate, in ascending order.

    >>> findIndices (`elem` "aeiou") "Hello World!"
    [1,4,7]

isPrefixOf :: Eq a => [a] -> [a] -> Bool Source #

\(\mathcal{O}(\min(m,n))\). The `isPrefixOf` function takes two lists and returns `True` iff the first list is a prefix of the second.

    >>> "Hello" `isPrefixOf` "Hello World!"
    True

    >>> "Hello" `isPrefixOf` "Wello Horld!"
    False

isSuffixOf :: Eq a => [a] -> [a] -> Bool Source #

The `isSuffixOf` function takes two lists and returns `True` iff the first list is a suffix of the second. The second list must be finite.

    >>> "ld!" `isSuffixOf` "Hello World!"
    True

    >>> "World" `isSuffixOf` "Hello World!"
    False

isInfixOf :: Eq a => [a] -> [a] -> Bool Source #

The `isInfixOf` function takes two lists and returns `True` iff the first list is contained, wholly and intact, anywhere within the second.

    >>> isInfixOf "Haskell" "I really like Haskell."
    True

    >>> isInfixOf "Ial" "I really like Haskell."
    False

nub :: Eq a => [a] -> [a] Source #

\(\mathcal{O}(n^2)\). The `nub` function removes duplicate elements from a list. In particular, it keeps only the first occurrence of each element. (The name `nub` means `essence'.) It is a special case of `nubBy`, which allows the programmer to supply their own equality test.

    >>> nub [1,2,3,4,3,2,1,2,4,3,5]
    [1,2,3,4,5]

nubBy :: (a -> a -> Bool) -> [a] -> [a] Source #

The `nubBy` function behaves just like `nub`, except it uses a user-supplied equality predicate instead of the overloaded `==` function.

    >>> nubBy (\x y -> mod x 3 == mod y 3) [1,2,4,5,6]
    [1,2,6]

deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a] Source #

\(\mathcal{O}(n)\). The `deleteBy` function behaves like `delete`, but takes a user-supplied equality predicate.

    >>> deleteBy (<=) 4 [1..10]
    [1,2,3,5,6,7,8,9,10]

(\\) :: Eq a => [a] -> [a] -> [a] infix 5 Source #

The `\\` function is list difference (non-associative). In the result of `xs` `\\` `ys`, the first occurrence of each element of `ys` in turn (if any) has been removed from `xs`. Thus

    (xs ++ ys) \\ xs == ys.

    >>> "Hello World!" \\ "ell W"
    "Hoorld!"

It is a special case of `deleteFirstsBy`, which allows the programmer to supply their own equality test.

unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] Source #

The `unionBy` function is the non-overloaded version of `union`.

intersect :: Eq a => [a] -> [a] -> [a] Source #

The `intersect` function takes the list intersection of two lists. For example,

    >>> [1,2,3,4] `intersect` [2,4,6,8]
    [2,4]

If the first list contains duplicates, so will the result.

    >>> [1,2,2,3,4] `intersect` [6,4,4,2]
    [2,2,4]

It is a special case of `intersectBy`, which allows the programmer to supply their own equality test. If the element is found in both the first and the second list, the element from the first list will be used.

intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] Source #

The `intersectBy` function is the non-overloaded version of `intersect`.

intersperse :: a -> [a] -> [a] Source #

\(\mathcal{O}(n)\). The `intersperse` function takes an element and a list and `intersperses' that element between the elements of the list. For example,

    >>> intersperse ',' "abcde"
    "a,b,c,d,e"

intercalate :: [a] -> [[a]] -> [a] Source #

`intercalate` `xs xss` is equivalent to `(`concat` (`intersperse` xs xss))`. It inserts the list `xs` in between the lists in `xss` and concatenates the result.

    >>> intercalate ", " ["Lorem", "ipsum", "dolor"]
    "Lorem, ipsum, dolor"

partition :: (a -> Bool) -> [a] -> ([a], [a]) Source #

The `partition` function takes a predicate and a list, and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e.,

    partition p xs == (filter p xs, filter (not . p) xs)

    >>> partition (`elem` "aeiou") "Hello World!"
    ("eoo","Hll Wrld!")

mapAccumL :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b) Source #

The `mapAccumL` function behaves like a combination of `fmap` and `foldl`; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.

#### Examples

Expand

Basic usage:

    >>> mapAccumL (\a b -> (a + b, a)) 0 [1..10]
    (55,[0,1,3,6,10,15,21,28,36,45])

    >>> mapAccumL (\a b -> (a <> show b, a)) "0" [1..5]
    ("012345",["0","01","012","0123","01234"])

mapAccumR :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b) Source #

The `mapAccumR` function behaves like a combination of `fmap` and `foldr`; it applies a function to each element of a structure, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new structure.

#### Examples

Expand

Basic usage:

    >>> mapAccumR (\a b -> (a + b, a)) 0 [1..10]
    (55,[54,52,49,45,40,34,27,19,10,0])

    >>> mapAccumR (\a b -> (a <> show b, a)) "0" [1..5]
    ("054321",["05432","0543","054","05","0"])

insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a] Source #

\(\mathcal{O}(n)\). The non-overloaded version of `insert`.

zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)] Source #

The `zip4` function takes four lists and returns a list of quadruples, analogous to `zip`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)] Source #

The `zip5` function takes five lists and returns a list of five-tuples, analogous to `zip`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)] Source #

The `zip6` function takes six lists and returns a list of six-tuples, analogous to `zip`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)] Source #

The `zip7` function takes seven lists and returns a list of seven-tuples, analogous to `zip`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e] Source #

The `zipWith4` function takes a function which combines four elements, as well as four lists and returns a list of their point-wise combination, analogous to `zipWith`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] Source #

The `zipWith5` function takes a function which combines five elements, as well as five lists and returns a list of their point-wise combination, analogous to `zipWith`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] Source #

The `zipWith6` function takes a function which combines six elements, as well as six lists and returns a list of their point-wise combination, analogous to `zipWith`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h] Source #

The `zipWith7` function takes a function which combines seven elements, as well as seven lists and returns a list of their point-wise combination, analogous to `zipWith`. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d]) Source #

The `unzip4` function takes a list of quadruples and returns four lists, analogous to `unzip`.

unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e]) Source #

The `unzip5` function takes a list of five-tuples and returns five lists, analogous to `unzip`.

unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f]) Source #

The `unzip6` function takes a list of six-tuples and returns six lists, analogous to `unzip`.

unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g]) Source #

The `unzip7` function takes a list of seven-tuples and returns seven lists, analogous to `unzip`.

deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] Source #

The `deleteFirstsBy` function takes a predicate and two lists and returns the first list with the first occurrence of each element of the second list removed.

group :: Eq a => [a] -> [[a]] Source #

The `group` function takes a list and returns a list of lists such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,

    >>> group "Mississippi"
    ["M","i","ss","i","ss","i","pp","i"]

It is a special case of `groupBy`, which allows the programmer to supply their own equality test.

groupBy :: (a -> a -> Bool) -> [a] -> [[a]] Source #

The `groupBy` function is the non-overloaded version of `group`.

inits :: [a] -> [[a]] Source #

The `inits` function returns all initial segments of the argument, shortest first. For example,

    >>> inits "abc"
    ["","a","ab","abc"]

Note that `inits` has the following strictness property: `inits (xs ++ _|_) = inits xs ++ _|_`

In particular, `inits _|_ = [] : _|_`

tails :: [a] -> [[a]] Source #

\(\mathcal{O}(n)\). The `tails` function returns all final segments of the argument, longest first. For example,

    >>> tails "abc"
    ["abc","bc","c",""]

Note that `tails` has the following strictness property: `tails _|_ = _|_ : _|_`

subsequences :: [a] -> [[a]] Source #

The `subsequences` function returns the list of all subsequences of the argument.

    >>> subsequences "abc"
    ["","a","b","ab","c","ac","bc","abc"]

permutations :: [a] -> [[a]] Source #

The `permutations` function returns the list of all permutations of the argument.

    >>> permutations "abc"
    ["abc","bac","cba","bca","cab","acb"]

sort :: Ord a => [a] -> [a] Source #

The `sort` function implements a stable sorting algorithm. It is a special case of `sortBy`, which allows the programmer to supply their own comparison function.

Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.

    >>> sort [1,6,4,3,2,5]
    [1,2,3,4,5,6]

lines :: String -> [String] Source #

Splits the argument into a list of lines stripped of their terminating `n` characters. The `n` terminator is optional in a final non-empty line of the argument string.

For example:

    >>> lines ""           -- empty input contains no lines
    []

    >>> lines "\n"         -- single empty line
    [""]

    >>> lines "one"        -- single unterminated line
    ["one"]

    >>> lines "one\n"      -- single non-empty line
    ["one"]

    >>> lines "one\n\n"    -- second line is empty
    ["one",""]

    >>> lines "one\ntwo"   -- second line is unterminated
    ["one","two"]

    >>> lines "one\ntwo\n" -- two non-empty lines
    ["one","two"]

When the argument string is empty, or ends in a `n` character, it can be recovered by passing the result of `lines` to the `unlines` function. Otherwise, `unlines` appends the missing terminating `n`. This makes `unlines . lines` idempotent:

    (unlines . lines) . (unlines . lines) = (unlines . lines)

unlines :: [String] -> String Source #

Appends a `n` character to each input string, then concatenates the results. Equivalent to ``foldMap` (s -> s `++` "n")`.

    >>> unlines ["Hello", "World", "!"]
    "Hello\nWorld\n!\n"

# Note

``unlines` `.` `lines` `/=` `id`` when the input is not `n`-terminated:

    >>> unlines . lines $ "foo\nbar"
    "foo\nbar\n"

words :: String -> [String] Source #

`words` breaks a string up into a list of words, which were delimited by white space.

    >>> words "Lorem ipsum\ndolor"
    ["Lorem","ipsum","dolor"]

unwords :: [String] -> String Source #

`unwords` is an inverse operation to `words`. It joins words with separating spaces.

    >>> unwords ["Lorem", "ipsum", "dolor"]
    "Lorem ipsum dolor"

newEmptyMVar :: IO (MVar a) Source #

Create an `MVar` which is initially empty.

newMVar :: a -> IO (MVar a) Source #

Create an `MVar` which contains the supplied value.

takeMVar :: MVar a -> IO a Source #

Return the contents of the `MVar`. If the `MVar` is currently empty, `takeMVar` will wait until it is full. After a `takeMVar`, the `MVar` is left empty.

There are two further important properties of `takeMVar`:

- `takeMVar` is single-wakeup. That is, if there are multiple threads blocked in `takeMVar`, and the `MVar` becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its `takeMVar` operation.
- When multiple threads are blocked on an `MVar`, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using `MVar`s.

readMVar :: MVar a -> IO a Source #

Atomically read the contents of an `MVar`. If the `MVar` is currently empty, `readMVar` will wait until it is full. `readMVar` is guaranteed to receive the next `putMVar`.

`readMVar` is multiple-wakeup, so when multiple readers are blocked on an `MVar`, all of them are woken up at the same time.

Compatibility note: Prior to base 4.7, `readMVar` was a combination of `takeMVar` and `putMVar`. This mean that in the presence of other threads attempting to `putMVar`, `readMVar` could block. Furthermore, `readMVar` would not receive the next `putMVar` if there was already a pending thread blocked on `takeMVar`. The old behavior can be recovered by implementing 'readMVar as follows:

     readMVar :: MVar a -> IO a
     readMVar m =
       mask_ $ do
         a <- takeMVar m
         putMVar m a
         return a

putMVar :: MVar a -> a -> IO () Source #

Put a value into an `MVar`. If the `MVar` is currently full, `putMVar` will wait until it becomes empty.

There are two further important properties of `putMVar`:

- `putMVar` is single-wakeup. That is, if there are multiple threads blocked in `putMVar`, and the `MVar` becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its `putMVar` operation.
- When multiple threads are blocked on an `MVar`, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using `MVar`s.

tryTakeMVar :: MVar a -> IO (Maybe a) Source #

A non-blocking version of `takeMVar`. The `tryTakeMVar` function returns immediately, with `Nothing` if the `MVar` was empty, or ``Just` a` if the `MVar` was full with contents `a`. After `tryTakeMVar`, the `MVar` is left empty.

tryPutMVar :: MVar a -> a -> IO Bool Source #

A non-blocking version of `putMVar`. The `tryPutMVar` function attempts to put the value `a` into the `MVar`, returning `True` if it was successful, or `False` otherwise.

tryReadMVar :: MVar a -> IO (Maybe a) Source #

A non-blocking version of `readMVar`. The `tryReadMVar` function returns immediately, with `Nothing` if the `MVar` was empty, or ``Just` a` if the `MVar` was full with contents `a`.

Since: base-4.7.0.0

isEmptyMVar :: MVar a -> IO Bool Source #

Check whether a given `MVar` is empty.

Notice that the boolean value returned is just a snapshot of the state of the MVar. By the time you get to react on its result, the MVar may have been filled (or emptied) - so be extremely careful when using this operation. Use `tryTakeMVar` instead if possible.

addMVarFinalizer :: MVar a -> IO () -> IO () Source #

userError :: String -> IOError Source #

Construct an `IOException` value with a string describing the error. The `fail` method of the `IO` instance of the `Monad` class raises a `userError`, thus:

    instance Monad IO where
      ...
      fail s = ioError (userError s)

close :: CliOpts -> Journal -> IO () Source #

nativeNewline :: Newline Source #

The native newline representation for the current platform: `LF` on Unix systems, `CRLF` on Windows.

universalNewlineMode :: NewlineMode Source #

Map `'\r\n'` into `'\n'` on input, and `'\n'` to the native newline representation on output. This mode can be used on any platform, and works with text files using any newline convention. The downside is that `readFile >>= writeFile` might yield a different file.

    universalNewlineMode  = NewlineMode { inputNL  = CRLF,
                                          outputNL = nativeNewline }

nativeNewlineMode :: NewlineMode Source #

Use the native newline representation on both input and output

    nativeNewlineMode  = NewlineMode { inputNL  = nativeNewline
                                       outputNL = nativeNewline }

noNewlineTranslation :: NewlineMode Source #

Do no newline translation at all.

    noNewlineTranslation  = NewlineMode { inputNL  = LF, outputNL = LF }

ioError :: IOError -> IO a Source #

Raise an `IOException` in the `IO` monad.

void :: Functor f => f a -> f () Source #

``void` value` discards or ignores the result of evaluation, such as the return value of an `IO` action.

#### Examples

Expand

Replace the contents of a ``Maybe` `Int`` with unit:

    >>> void Nothing
    Nothing
    >>> void (Just 3)
    Just ()

Replace the contents of an ``Either` `Int` `Int`` with unit, resulting in an ``Either` `Int` `()``:

    >>> void (Left 8675309)
    Left 8675309
    >>> void (Right 8675309)
    Right ()

Replace every element of a list with unit:

    >>> void [1,2,3]
    [(),(),()]

Replace the second element of a pair with unit:

    >>> void (1,2)
    (1,())

Discard the result of an `IO` action:

    >>> mapM print [1,2]
    1
    2
    [(),()]
    >>> void $ mapM print [1,2]
    1
    2

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 Source #

Flipped version of `<$>`.

    (<&>) = flip fmap

#### Examples

Expand

Apply `(+1)` to a list, a `Just` and a `Right`:

    >>> Just 2 <&> (+1)
    Just 3

    >>> [1,2,3] <&> (+1)
    [2,3,4]

    >>> Right 3 <&> (+1)
    Right 4

Since: base-4.11.0.0

($>) :: Functor f => f a -> b -> f b infixl 4 Source #

Flipped version of `<$`.

#### Examples

Expand

Replace the contents of a ``Maybe` `Int`` with a constant `String`:

    >>> Nothing $> "foo"
    Nothing
    >>> Just 90210 $> "foo"
    Just "foo"

Replace the contents of an ``Either` `Int` `Int`` with a constant `String`, resulting in an ``Either` `Int` `String``:

    >>> Left 8675309 $> "foo"
    Left 8675309
    >>> Right 8675309 $> "foo"
    Right "foo"

Replace each element of a list with a constant `String`:

    >>> [1,2,3] $> "foo"
    ["foo","foo","foo"]

Replace the second element of a pair with a constant `String`:

    >>> (1,2) $> "foo"
    (1,"foo")

Since: base-4.7.0.0

utf8_bom :: TextEncoding Source #

The UTF-8 Unicode encoding, with a byte-order-mark (BOM; the byte sequence 0xEF 0xBB 0xBF). This encoding behaves like `utf8`, except that on input, the BOM sequence is ignored at the beginning of the stream, and on output, the BOM sequence is prepended.

The byte-order-mark is strictly unnecessary in UTF-8, but is sometimes used to identify the encoding of a file.

forkOn :: Int -> IO () -> IO ThreadId Source #

Like `forkIO`, but lets you specify on which capability the thread should run. Unlike a `forkIO` thread, a thread created by `forkOn` will stay on the same capability for its entire lifetime (`forkIO` threads can migrate between capabilities according to the scheduling policy). `forkOn` is useful for overriding the scheduling policy when you know in advance how best to distribute the threads.

The `Int` argument specifies a capability number (see `getNumCapabilities`). Typically capabilities correspond to physical processors, but the exact behaviour is implementation-dependent. The value passed to `forkOn` is interpreted modulo the total number of capabilities as returned by `getNumCapabilities`.

GHC note: the number of capabilities is specified by the `+RTS -N` option when the program is started. Capabilities can be fixed to actual processor cores with `+RTS -qa` if the underlying operating system supports that, although in practice this is usually unnecessary (and may actually degrade performance in some cases - experimentation is recommended).

Since: base-4.4.0.0

forkOnWithUnmask :: Int -> ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId Source #

Like `forkIOWithUnmask`, but the child thread is pinned to the given CPU, as with `forkOn`.

Since: base-4.4.0.0

getNumCapabilities :: IO Int Source #

Returns the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time. To change this value, use `setNumCapabilities`.

Since: base-4.4.0.0

setNumCapabilities :: Int -> IO () Source #

Set the number of Haskell threads that can run truly simultaneously (on separate physical processors) at any given time. The number passed to `forkOn` is interpreted modulo this value. The initial value is given by the `+RTS -N` runtime flag.

This is also the number of threads that will participate in parallel garbage collection. It is strongly recommended that the number of capabilities is not set larger than the number of physical processor cores, and it may often be beneficial to leave one or more cores free to avoid contention with other processes in the machine.

Since: base-4.5.0.0

yield :: IO () Source #

The `yield` action allows (forces, in a co-operative multitasking implementation) a context-switch to any other currently runnable threads (if any), and is occasionally useful when implementing concurrency abstractions.

threadCapability :: ThreadId -> IO (Int, Bool) Source #

Returns the number of the capability on which the thread is currently running, and a boolean indicating whether the thread is locked to that capability or not. A thread is locked to a capability if it was created with `forkOn`.

Since: base-4.4.0.0

mkWeakThreadId :: ThreadId -> IO (Weak ThreadId) Source #

Make a weak pointer to a `ThreadId`. It can be important to do this if you want to hold a reference to a `ThreadId` while still allowing the thread to receive the `BlockedIndefinitely` family of exceptions (e.g. `BlockedIndefinitelyOnMVar`). Holding a normal `ThreadId` reference will prevent the delivery of `BlockedIndefinitely` exceptions because the reference could be used as the target of `throwTo` at any time, which would unblock the thread.

Holding a `Weak ThreadId`, on the other hand, will not prevent the thread from receiving `BlockedIndefinitely` exceptions. It is still possible to throw an exception to a `Weak ThreadId`, but the caller must use `deRefWeak` first to determine whether the thread still exists.

Since: base-4.6.0.0

withMVar :: MVar a -> (a -> IO b) -> IO b Source #

`withMVar` is an exception-safe wrapper for operating on the contents of an `MVar`. This operation is exception-safe: it will replace the original contents of the `MVar` if an exception is raised (see Control.Exception). However, it is only atomic if there are no other producers for this `MVar`. In other words, it cannot guarantee that, by the time `withMVar` gets the chance to write to the MVar, the value of the MVar has not been altered by a write operation from another thread.

modifyMVar_ :: MVar a -> (a -> IO a) -> IO () Source #

An exception-safe wrapper for modifying the contents of an `MVar`. Like `withMVar`, `modifyMVar` will replace the original contents of the `MVar` if an exception is raised during the operation. This function is only atomic if there are no other producers for this `MVar`. In other words, it cannot guarantee that, by the time `modifyMVar_` gets the chance to write to the MVar, the value of the MVar has not been altered by a write operation from another thread.

swapMVar :: MVar a -> a -> IO a Source #

Take a value from an `MVar`, put a new value into the `MVar` and return the value taken. This function is atomic only if there are no other producers for this `MVar`. In other words, it cannot guarantee that, by the time `swapMVar` gets the chance to write to the MVar, the value of the MVar has not been altered by a write operation from another thread.

withMVarMasked :: MVar a -> (a -> IO b) -> IO b Source #

Like `withMVar`, but the `IO` action in the second argument is executed with asynchronous exceptions masked.

Since: base-4.7.0.0

modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b Source #

A slight variation on `modifyMVar_` that allows a value to be returned (`b`) in addition to the modified value of the `MVar`.

modifyMVarMasked_ :: MVar a -> (a -> IO a) -> IO () Source #

Like `modifyMVar_`, but the `IO` action in the second argument is executed with asynchronous exceptions masked.

Since: base-4.6.0.0

modifyMVarMasked :: MVar a -> (a -> IO (a, b)) -> IO b Source #

Like `modifyMVar`, but the `IO` action in the second argument is executed with asynchronous exceptions masked.

Since: base-4.6.0.0

mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a)) Source #

Make a `Weak` pointer to an `MVar`, using the second argument as a finalizer to run when `MVar` is garbage-collected

Since: base-4.6.0.0

tryIOError :: IO a -> IO (Either IOError a) Source #

The construct `tryIOError` `comp` exposes IO errors which occur within a computation, and which are not fully handled.

Non-I/O exceptions are not caught by this variant; to catch all exceptions, use `try` from Control.Exception.

Since: base-4.4.0.0

mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError Source #

Construct an `IOException` of the given type where the second argument describes the error location and the third and fourth argument contain the file handle and file path of the file involved in the error if applicable.

isAlreadyExistsError :: IOError -> Bool Source #

An error indicating that an `IO` operation failed because one of its arguments already exists.

isUserError :: IOError -> Bool Source #

A programmer-defined error value constructed using `userError`.

isResourceVanishedError :: IOError -> Bool Source #

An error indicating that the operation failed because the resource vanished. See `resourceVanishedErrorType`.

Since: base-4.14.0.0

alreadyExistsErrorType :: IOErrorType Source #

I/O error where the operation failed because one of its arguments already exists.

doesNotExistErrorType :: IOErrorType Source #

I/O error where the operation failed because one of its arguments does not exist.

alreadyInUseErrorType :: IOErrorType Source #

I/O error where the operation failed because one of its arguments is a single-use resource, which is already being used.

fullErrorType :: IOErrorType Source #

I/O error where the operation failed because the device is full.

eofErrorType :: IOErrorType Source #

I/O error where the operation failed because the end of file has been reached.

illegalOperationErrorType :: IOErrorType Source #

I/O error where the operation is not possible.

permissionErrorType :: IOErrorType Source #

I/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation.

userErrorType :: IOErrorType Source #

I/O error that is programmer-defined.

resourceVanishedErrorType :: IOErrorType Source #

I/O error where the operation failed because the resource vanished. This happens when, for example, attempting to write to a closed socket or attempting to write to a named pipe that was deleted.

Since: base-4.14.0.0

isAlreadyExistsErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because one of its arguments already exists.

isDoesNotExistErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because one of its arguments does not exist.

isAlreadyInUseErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because one of its arguments is a single-use resource, which is already being used.

isFullErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because the device is full.

isEOFErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because the end of file has been reached.

isIllegalOperationErrorType :: IOErrorType -> Bool Source #

I/O error where the operation is not possible.

isPermissionErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation.

isUserErrorType :: IOErrorType -> Bool Source #

I/O error that is programmer-defined.

isResourceVanishedErrorType :: IOErrorType -> Bool Source #

I/O error where the operation failed because the resource vanished. See `resourceVanishedErrorType`.

Since: base-4.14.0.0

ioeGetErrorType :: IOError -> IOErrorType Source #

ioeGetErrorString :: IOError -> String Source #

ioeGetLocation :: IOError -> String Source #

ioeGetHandle :: IOError -> Maybe Handle Source #

ioeGetFileName :: IOError -> Maybe FilePath Source #

ioeSetErrorType :: IOError -> IOErrorType -> IOError Source #

ioeSetErrorString :: IOError -> String -> IOError Source #

ioeSetLocation :: IOError -> String -> IOError Source #

ioeSetHandle :: IOError -> Handle -> IOError Source #

ioeSetFileName :: IOError -> FilePath -> IOError Source #

modifyIOError :: (IOError -> IOError) -> IO a -> IO a Source #

Catch any `IOException` that occurs in the computation and throw a modified version.

annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError Source #

Adds a location description and maybe a file path and file handle to an `IOException`. If any of the file handle or file path is not given the corresponding value in the `IOException` remains unaltered.

catchIOError :: IO a -> (IOError -> IO a) -> IO a Source #

The `catchIOError` function establishes a handler that receives any `IOException` raised in the action protected by `catchIOError`. An `IOException` is caught by the most recent handler established by one of the exception handling functions. These handlers are not selective: all `IOException`s are caught. Exception propagation must be explicitly provided in a handler by re-raising any unwanted exceptions. For example, in

    f = catchIOError g (\e -> if IO.isEOFError e then return [] else ioError e)

the function `f` returns `[]` when an end-of-file exception (cf. `isEOFError`) occurs in `g`; otherwise, the exception is propagated to the next outer handler.

When an exception propagates outside the main program, the Haskell system prints the associated `IOException` value and exits the program.

Non-I/O exceptions are not caught by this variant; to catch all exceptions, use `catch` from Control.Exception.

Since: base-4.4.0.0

threadWaitRead :: Fd -> IO () Source #

Block the current thread until data is available to read on the given file descriptor (GHC only).

This will throw an `IOError` if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with `threadWaitRead`, use `closeFdWith`.

threadWaitWrite :: Fd -> IO () Source #

Block the current thread until data can be written to the given file descriptor (GHC only).

This will throw an `IOError` if the file descriptor was closed while this thread was blocked. To safely close a file descriptor that has been used with `threadWaitWrite`, use `closeFdWith`.

threadWaitReadSTM :: Fd -> IO (STM (), IO ()) Source #

Returns an STM action that can be used to wait for data to read from a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.

Since: base-4.7.0.0

threadWaitWriteSTM :: Fd -> IO (STM (), IO ()) Source #

Returns an STM action that can be used to wait until data can be written to a file descriptor. The second returned value is an IO action that can be used to deregister interest in the file descriptor.

Since: base-4.7.0.0

utf32 :: TextEncoding Source #

The UTF-32 Unicode encoding (a byte-order-mark should be used to indicate endianness).

utf32be :: TextEncoding Source #

The UTF-32 Unicode encoding (big-endian)

utf32le :: TextEncoding Source #

The UTF-32 Unicode encoding (little-endian)

utf16 :: TextEncoding Source #

The UTF-16 Unicode encoding (a byte-order-mark should be used to indicate endianness).

utf16be :: TextEncoding Source #

The UTF-16 Unicode encoding (big-endian)

utf16le :: TextEncoding Source #

The UTF-16 Unicode encoding (little-endian)

latin1 :: TextEncoding Source #

The Latin1 (ISO8859-1) encoding. This encoding maps bytes directly to the first 256 Unicode code points, and is thus not a complete Unicode encoding. An attempt to write a character greater than `'\255'` to a `Handle` using the `latin1` encoding will result in an error.

char8 :: TextEncoding Source #

An encoding in which Unicode code points are translated to bytes by taking the code point modulo 256. When decoding, bytes are translated directly into the equivalent code point.

This encoding never fails in either direction. However, encoding discards information, so encode followed by decode is not the identity.

Since: base-4.4.0.0

traceIO :: String -> IO () Source #

The `traceIO` function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions.

Since: base-4.5.0.0

withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r Source #

openBinaryFile :: FilePath -> IOMode -> IO Handle Source #

withBinaryFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r Source #

hGetChar :: Handle -> IO Char Source #

Computation `hGetChar` `hdl` reads a character from the file or channel managed by `hdl`, blocking until a character is available.

This operation may fail with:

- `isEOFError` if the end of file has been reached.

hGetLine :: Handle -> IO String Source #

Computation `hGetLine` `hdl` reads a line from the file or channel managed by `hdl`.

This operation may fail with:

- `isEOFError` if the end of file is encountered when reading the first character of the line.

If `hGetLine` encounters end-of-file at any other point while reading in a line, it is treated as a line terminator and the (partial) line is returned.

hGetContents' :: Handle -> IO String Source #

The `hGetContents'` operation reads all input on the given handle before returning it as a `String` and closing the handle.

Since: base-4.15.0.0

hPutChar :: Handle -> Char -> IO () Source #

Computation `hPutChar` `hdl ch` writes the character `ch` to the file or channel managed by `hdl`. Characters may be buffered if buffering is enabled for `hdl`.

This operation may fail with:

- `isFullError` if the device is full; or
- `isPermissionError` if another system resource limit would be exceeded.

hPutStr :: Handle -> String -> IO () Source #

Computation `hPutStr` `hdl s` writes the string `s` to the file or channel managed by `hdl`.

This operation may fail with:

- `isFullError` if the device is full; or
- `isPermissionError` if another system resource limit would be exceeded.

hPutStrLn :: Handle -> String -> IO () Source #

The same as `hPutStr`, but adds a newline character.

hPutBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int Source #

hGetBufSome :: Handle -> Ptr a -> Int -> IO Int Source #

`hGetBufSome` `hdl buf count` reads data from the handle `hdl` into the buffer `buf`. If there is any data available to read, then `hGetBufSome` returns it immediately; it only blocks if there is no data to be read.

It returns the number of bytes actually read. This may be zero if EOF was reached before any data was read (or if `count` is zero).

`hGetBufSome` never raises an EOF exception, instead it returns a value smaller than `count`.

If the handle is a pipe or socket, and the writing end is closed, `hGetBufSome` will behave as if EOF was reached.

`hGetBufSome` ignores the prevailing `TextEncoding` and `NewlineMode` on the `Handle`, and reads bytes directly.

hGetBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int Source #

`hGetBufNonBlocking` `hdl buf count` reads data from the handle `hdl` into the buffer `buf` until either EOF is reached, or `count` 8-bit bytes have been read, or there is no more data available to read immediately.

`hGetBufNonBlocking` is identical to `hGetBuf`, except that it will never block waiting for data to become available, instead it returns only whatever data is available. To wait for data to arrive before calling `hGetBufNonBlocking`, use `hWaitForInput`.

If the handle is a pipe or socket, and the writing end is closed, `hGetBufNonBlocking` will behave as if EOF was reached.

`hGetBufNonBlocking` ignores the prevailing `TextEncoding` and `NewlineMode` on the `Handle`, and reads bytes directly.

NOTE: on Windows, this function does not work correctly; it behaves identically to `hGetBuf`.

hFileSize :: Handle -> IO Integer Source #

For a handle `hdl` which attached to a physical file, `hFileSize` `hdl` returns the size of that file in 8-bit bytes.

hSetFileSize :: Handle -> Integer -> IO () Source #

`hSetFileSize` `hdl` `size` truncates the physical file with handle `hdl` to `size` bytes.

hIsEOF :: Handle -> IO Bool Source #

For a readable handle `hdl`, `hIsEOF` `hdl` returns `True` if no further input can be taken from `hdl` or for a physical file, if the current I/O position is equal to the length of the file. Otherwise, it returns `False`.

NOTE: `hIsEOF` may block, because it has to attempt to read from the stream to determine whether there is any more data to be read.

isEOF :: IO Bool Source #

The computation `isEOF` is identical to `hIsEOF`, except that it works only on `stdin`.

hSetBuffering :: Handle -> BufferMode -> IO () Source #

Computation `hSetBuffering` `hdl mode` sets the mode of buffering for handle `hdl` on subsequent reads and writes.

If the buffer mode is changed from `BlockBuffering` or `LineBuffering` to `NoBuffering`, then

- if `hdl` is writable, the buffer is flushed as for `hFlush`;
- if `hdl` is not writable, the contents of the buffer is discarded.

This operation may fail with:

- `isPermissionError` if the handle has already been used for reading or writing and the implementation does not allow the buffering mode to be changed.

hSetEncoding :: Handle -> TextEncoding -> IO () Source #

The action `hSetEncoding` `hdl` `encoding` changes the text encoding for the handle `hdl` to `encoding`. The default encoding when a `Handle` is created is `localeEncoding`, namely the default encoding for the current locale.

To create a `Handle` with no encoding at all, use `openBinaryFile`. To stop further encoding or decoding on an existing `Handle`, use `hSetBinaryMode`.

`hSetEncoding` may need to flush buffered data in order to change the encoding.

hGetEncoding :: Handle -> IO (Maybe TextEncoding) Source #

Return the current `TextEncoding` for the specified `Handle`, or `Nothing` if the `Handle` is in binary mode.

Note that the `TextEncoding` remembers nothing about the state of the encoder/decoder in use on this `Handle`. For example, if the encoding in use is UTF-16, then using `hGetEncoding` and `hSetEncoding` to save and restore the encoding may result in an extra byte-order-mark being written to the file.

hGetPosn :: Handle -> IO HandlePosn Source #

Computation `hGetPosn` `hdl` returns the current I/O position of `hdl` as a value of the abstract type `HandlePosn`.

hSetPosn :: HandlePosn -> IO () Source #

If a call to `hGetPosn` `hdl` returns a position `p`, then computation `hSetPosn` `p` sets the position of `hdl` to the position it held at the time of the call to `hGetPosn`.

This operation may fail with:

- `isPermissionError` if a system resource limit would be exceeded.

hTell :: Handle -> IO Integer Source #

Computation `hTell` `hdl` returns the current position of the handle `hdl`, as the number of bytes from the beginning of the file. The value returned may be subsequently passed to `hSeek` to reposition the handle to the current position.

This operation may fail with:

- `isIllegalOperationError` if the Handle is not seekable.

hIsOpen :: Handle -> IO Bool Source #

hIsClosed :: Handle -> IO Bool Source #

hIsReadable :: Handle -> IO Bool Source #

hGetBuffering :: Handle -> IO BufferMode Source #

Computation `hGetBuffering` `hdl` returns the current buffering mode for `hdl`.

hIsSeekable :: Handle -> IO Bool Source #

hSetEcho :: Handle -> Bool -> IO () Source #

Set the echoing status of a handle connected to a terminal.

hGetEcho :: Handle -> IO Bool Source #

Get the echoing status of a handle connected to a terminal.

hSetNewlineMode :: Handle -> NewlineMode -> IO () Source #

Set the `NewlineMode` on the specified `Handle`. All buffered data is flushed first.

hShow :: Handle -> IO String Source #

`hShow` is in the `IO` monad, and gives more comprehensive output than the (pure) instance of `Show` for `Handle`.

putChar :: Char -> IO () Source #

Write a character to the standard output device (same as `hPutChar` `stdout`).

putStr :: String -> IO () Source #

Write a string to the standard output device (same as `hPutStr` `stdout`).

getChar :: IO Char Source #

Read a character from the standard input device (same as `hGetChar` `stdin`).

getContents :: IO String Source #

The `getContents` operation returns all user input as a single string, which is read lazily as it is needed (same as `hGetContents` `stdin`).

getContents' :: IO String Source #

The `getContents'` operation returns all user input as a single string, which is fully read before being returned (same as `hGetContents'` `stdin`).

Since: base-4.15.0.0

interact :: (String -> String) -> IO () Source #

The `interact` function takes a function of type `String->String` as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

readFile :: FilePath -> IO String Source #

The `readFile` function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with `getContents`.

appendFile :: FilePath -> String -> IO () Source #

The computation `appendFile` `file str` function appends the string `str`, to the file `file`.

Note that `writeFile` and `appendFile` write a literal string to a file. To write a value of any printable type, as with `print`, use the `show` function to convert the value to a string first.

    main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])

readLn :: Read a => IO a Source #

The `readLn` function combines `getLine` and `readIO`.

readIO :: Read a => String -> IO a Source #

The `readIO` function is similar to `read` except that it signals parse failure to the `IO` monad instead of terminating the program.

hReady :: Handle -> IO Bool Source #

Computation `hReady` `hdl` indicates whether at least one item is available for input from handle `hdl`.

This operation may fail with:

- `isEOFError` if the end of file has been reached.

hPrint :: Show a => Handle -> a -> IO () Source #

Computation `hPrint` `hdl t` writes the string representation of `t` given by the `shows` function to the file or channel managed by `hdl` and appends a newline.

This operation may fail with:

- `isFullError` if the device is full; or
- `isPermissionError` if another system resource limit would be exceeded.

openTempFile Source #

Arguments

:: FilePath | Directory in which to create the file
-> String | File name template. If the template is "foo.ext" then the created file will be "fooXXX.ext" where XXX is some random number. Note that this should not contain any path separator characters. On Windows, the template prefix may be truncated to 3 chars, e.g. "foobar.ext" will be "fooXXX.ext".
-> IO (FilePath, Handle) |

The function creates a temporary file in ReadWrite mode. The created file isn't deleted automatically, so you need to delete it manually.

The file is created with permissions such that only the current user can read/write it.

With some exceptions (see below), the file will be created securely in the sense that an attacker should not be able to cause openTempFile to overwrite another file on the filesystem using your credentials, by putting symbolic links (on Unix) in the place where the temporary file is to be created. On Unix the `O_CREAT` and `O_EXCL` flags are used to prevent this attack, but note that `O_EXCL` is sometimes not supported on NFS filesystems, so if you rely on this behaviour it is best to use local filesystems only.

openBinaryTempFile :: FilePath -> String -> IO (FilePath, Handle) Source #

Like `openTempFile`, but opens the file in binary mode. See `openBinaryFile` for more comments.

openTempFileWithDefaultPermissions :: FilePath -> String -> IO (FilePath, Handle) Source #

Like `openTempFile`, but uses the default file permissions

openBinaryTempFileWithDefaultPermissions :: FilePath -> String -> IO (FilePath, Handle) Source #

Like `openBinaryTempFile`, but uses the default file permissions

isSubsequenceOf :: Eq a => [a] -> [a] -> Bool Source #

The `isSubsequenceOf` function takes two lists and returns `True` if all the elements of the first list occur, in order, in the second. The elements do not have to occur consecutively.

``isSubsequenceOf` x y` is equivalent to ``elem` x (`subsequences` y)`.

#### Examples

Expand

    >>> isSubsequenceOf "GHC" "The Glorious Haskell Compiler"
    True
    >>> isSubsequenceOf ['a','d'..'z'] ['a'..'z']
    True
    >>> isSubsequenceOf [1..10] [10,9..0]
    False

Since: base-4.8.0.0

traceShowId :: Show a => a -> a Source #

Like `traceShow` but returns the shown value instead of a third value.

    >>> traceShowId (1+2+3, "hello" ++ "world")
    (6,"helloworld")
    (6,"helloworld")

Since: base-4.7.0.0

filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] Source #

This generalizes the list-based `filter` function.

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 Source #

Left-to-right composition of Kleisli arrows.

'`(bs `>=>` cs) a`' can be understood as the `do` expression

    do b <- bs a
       cs b

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 Source #

Right-to-left composition of Kleisli arrows. `(`>=>`)`, with the arguments flipped.

Note how this operator resembles function composition `(`.`)`:

    (.)   ::            (b ->   c) -> (a ->   b) -> a ->   c
    (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c

mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) Source #

The `mapAndUnzipM` function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state monad.

zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] Source #

The `zipWithM` function generalizes `zipWith` to arbitrary applicative functors.

zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () Source #

`zipWithM_` is the extension of `zipWithM` which ignores the final result.

foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b Source #

The `foldM` function is analogous to `foldl`, except that its result is encapsulated in a monad. Note that `foldM` works from left-to-right over the list arguments. This could be an issue where `(`>>`)` and the `folded function' are not commutative.

    foldM f a1 [x1, x2, ..., xm]

    ==

    do
      a2 <- f a1 x1
      a3 <- f a2 x2
      ...
      f am xm

If right-to-left evaluation is required, the input list should be reversed.

Note: `foldM` is the same as `foldlM`

foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () Source #

Like `foldM`, but discards the result.

replicateM :: Applicative m => Int -> m a -> m [a] Source #

``replicateM` n act` performs the action `act` `n` times, and then returns the list of results:

#### Examples

Expand

    >>> import Control.Monad.State
    >>> runState (replicateM 3 $ state $ \s -> (s, s + 1)) 1
    ([1,2,3],4)

replicateM_ :: Applicative m => Int -> m a -> m () Source #

Like `replicateM`, but discards the result.

#### Examples

Expand

    >>> replicateM_ 3 (putStrLn "a")
    a
    a
    a

unless :: Applicative f => Bool -> f () -> f () Source #

The reverse of `when`.

(<$!>) :: Monad m => (a -> b) -> m a -> m b infixl 4 Source #

Strict version of `<$>`.

Since: base-4.8.0.0

mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a Source #

Direct `MonadPlus` equivalent of `filter`.

#### Examples

Expand

The `filter` function is just `mfilter` specialized to the list monad:

    filter = ( mfilter :: (a -> Bool) -> [a] -> [a] )

An example using `mfilter` with the `Maybe` monad:

    >>> mfilter odd (Just 1)
    Just 1
    >>> mfilter odd (Just 2)
    Nothing

printf :: PrintfType r => String -> r Source #

Format a variable number of arguments with the C-style formatting string.

    >>> printf "%s, %d, %.4f" "hello" 123 pi
    hello, 123, 3.1416

The return value is either `String` or `(`IO` a)` (which should be `(`IO` ())`, but Haskell's type system makes this hard).

The format string consists of ordinary characters and conversion specifications, which specify how to format one of the arguments to `printf` in the output string. A format specification is introduced by the `%` character; this character can be self-escaped into the format string using `%%`. A format specification ends with a format character that provides the primary information about how to format the value. The rest of the conversion specification is optional. In order, one may have flag characters, a width specifier, a precision specifier, and type-specific modifier characters.

Unlike C `printf(3)`, the formatting of this `printf` is driven by the argument type; formatting is type specific. The types formatted by `printf` "out of the box" are:

- `Integral` types, including `Char`
- `String`
- `RealFloat` types

`printf` is also extensible to support other types: see below.

A conversion specification begins with the character `%`, followed by zero or more of the following flags:

    -      left adjust (default is right adjust)
    +      always use a sign (+ or -) for signed conversions
    space  leading space for positive numbers in signed conversions
    0      pad with zeros rather than spaces
    #      use an \"alternate form\": see below

When both flags are given, `-` overrides `0` and `+` overrides space. A negative width specifier in a `*` conversion is treated as positive but implies the left adjust flag.

The "alternate form" for unsigned radix conversions is as in C `printf(3)`:

    %o           prefix with a leading 0 if needed
    %x           prefix with a leading 0x if nonzero
    %X           prefix with a leading 0X if nonzero
    %b           prefix with a leading 0b if nonzero
    %[eEfFgG]    ensure that the number contains a decimal point

Any flags are followed optionally by a field width:

    num    field width
    *      as num, but taken from argument list

The field width is a minimum, not a maximum: it will be expanded as needed to avoid mutilating a value.

Any field width is followed optionally by a precision:

    .num   precision
    .      same as .0
    .*     as num, but taken from argument list

Negative precision is taken as 0. The meaning of the precision depends on the conversion type.

    Integral    minimum number of digits to show
    RealFloat   number of digits after the decimal point
    String      maximum number of characters

The precision for Integral types is accomplished by zero-padding. If both precision and zero-pad are given for an Integral field, the zero-pad is ignored.

Any precision is followed optionally for Integral types by a width modifier; the only use of this modifier being to set the implicit size of the operand for conversion of a negative operand to unsigned:

    hh     Int8
    h      Int16
    l      Int32
    ll     Int64
    L      Int64

The specification ends with a format character:

    c      character               Integral
    d      decimal                 Integral
    o      octal                   Integral
    x      hexadecimal             Integral
    X      hexadecimal             Integral
    b      binary                  Integral
    u      unsigned decimal        Integral
    f      floating point          RealFloat
    F      floating point          RealFloat
    g      general format float    RealFloat
    G      general format float    RealFloat
    e      exponent format float   RealFloat
    E      exponent format float   RealFloat
    s      string                  String
    v      default format          any type

The "%v" specifier is provided for all built-in types, and should be provided for user-defined type formatters as well. It picks a "best" representation for the given type. For the built-in types the "%v" specifier is converted as follows:

    c      Char
    u      other unsigned Integral
    d      other signed Integral
    g      RealFloat
    s      String

Mismatch between the argument types and the format string, as well as any other syntactic or semantic errors in the format string, will cause an exception to be thrown at runtime.

Note that the formatting for `RealFloat` types is currently a bit different from that of C `printf(3)`, conforming instead to `showEFloat`, `showFFloat` and `showGFloat` (and their alternate versions `showFFloatAlt` and `showGFloatAlt`). This is hard to fix: the fixed versions would format in a backward-incompatible way. In any case the Haskell behavior is generally more sensible than the C behavior. A brief summary of some key differences:

- Haskell `printf` never uses the default "6-digit" precision used by C printf.
- Haskell `printf` treats the "precision" specifier as indicating the number of digits after the decimal point.
- Haskell `printf` prints the exponent of e-format numbers without a gratuitous plus sign, and with the minimum possible number of digits.
- Haskell `printf` will place a zero after a decimal point when possible.

hPrintf :: HPrintfType r => Handle -> String -> r Source #

Similar to `printf`, except that output is via the specified `Handle`. The return type is restricted to `(`IO` a)`.

vFmt :: Char -> FieldFormat -> FieldFormat Source #

Substitute a 'v' format character with the given default format character in the `FieldFormat`. A convenience for user-implemented types, which should support "%v".

Since: base-4.7.0.0

formatChar :: Char -> FieldFormatter Source #

Formatter for `Char` values.

Since: base-4.7.0.0

formatString :: Bool -> Maybe Int -> Maybe Int -> String -> String Source #

Clip and pad a string to a minimum & maximum width, andor leftright justify it. Works on multi-line strings too (but will rewrite non-unix line endings).

formatInt :: (Integral a, Bounded a) => a -> FieldFormatter Source #

Formatter for `Int` values.

Since: base-4.7.0.0

formatInteger :: Integer -> FieldFormatter Source #

Formatter for `Integer` values.

Since: base-4.7.0.0

perror :: String -> a Source #

Raises an `error` with a printf-specific prefix on the message string.

Since: base-4.7.0.0

errorBadFormat :: Char -> a Source #

Calls `perror` to indicate an unknown format letter for a given type.

Since: base-4.7.0.0

errorShortFormat :: a Source #

Calls `perror` to indicate that the format string ended early.

Since: base-4.7.0.0

errorMissingArgument :: a Source #

Calls `perror` to indicate that there is a missing argument in the argument list.

Since: base-4.7.0.0

errorBadArgument :: a Source #

Calls `perror` to indicate that there is a type error or similar in the given argument.

Since: base-4.7.0.0

exitFailure :: IO a Source #

The computation `exitFailure` is equivalent to `exitWith` `(``ExitFailure` exitfail`)`, where exitfail is implementation-dependent.

exitSuccess :: IO a Source #

The computation `exitSuccess` is equivalent to `exitWith` `ExitSuccess`, It terminates the program successfully.

die :: String -> IO a Source #

Write given error message to `stderr` and terminate with `exitFailure`.

Since: base-4.8.0.0

getExecutablePath :: IO FilePath Source #

Returns the absolute pathname of the current executable, or `argv[0]` if the operating system does not provide a reliable way query the current executable.

Note that for scripts and interactive sessions, this is the path to the interpreter (e.g. ghci.)

Since base 4.11.0.0, `getExecutablePath` resolves symlinks on Windows. If an executable is launched through a symlink, `getExecutablePath` returns the absolute path of the original executable.

If the executable has been deleted, behaviour is ill-defined and varies by operating system. See `executablePath` for a more reliable way to query the current executable.

Since: base-4.6.0.0

executablePath :: Maybe (IO (Maybe FilePath)) Source #

Get an action to query the absolute pathname of the current executable.

If the operating system provides a reliable way to determine the current executable, return the query action, otherwise return `Nothing`. The action is defined on FreeBSD, Linux, MacOS, NetBSD, and Windows.

Even where the query action is defined, there may be situations where no result is available, e.g. if the executable file was deleted while the program is running. Therefore the result of the query action is a `Maybe FilePath`.

Note that for scripts and interactive sessions, the result is the path to the interpreter (e.g. ghci.)

Since: base-4.17.0.0

getProgName :: IO String Source #

Computation `getProgName` returns the name of the program as it was invoked.

However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum portability, we just return the leafname of the program as invoked. Even then there are some differences between platforms: on Windows, for example, a program invoked as foo is probably really `FOO.EXE`, and that is what `getProgName` will return.

withArgs :: [String] -> IO a -> IO a Source #

`withArgs` `args act` - while executing action `act`, have `getArgs` return `args`.

withProgName :: String -> IO a -> IO a Source #

`withProgName` `name act` - while executing action `act`, have `getProgName` return `name`.

getEnvironment :: IO [(String, String)] Source #

`getEnvironment` retrieves the entire environment as a list of `(key,value)` pairs.

If an environment entry does not contain an `'='` character, the `key` is the whole entry and the `value` is the empty string.

newQSemN :: Int -> IO QSemN Source #

Build a new `QSemN` with a supplied initial quantity. The initial quantity must be at least 0.

waitQSemN :: QSemN -> Int -> IO () Source #

Wait for the specified quantity to become available

signalQSemN :: QSemN -> Int -> IO () Source #

Signal that a given quantity is now available from the `QSemN`.

newQSem :: Int -> IO QSem Source #

Build a new `QSem` with a supplied initial quantity. The initial quantity must be at least 0.

waitQSem :: QSem -> IO () Source #

Wait for a unit to become available

signalQSem :: QSem -> IO () Source #

Signal that a unit of the `QSem` is available

newChan :: IO (Chan a) Source #

Build and returns a new instance of `Chan`.

writeChan :: Chan a -> a -> IO () Source #

Write a value to a `Chan`.

readChan :: Chan a -> IO a Source #

Read the next value from the `Chan`. Blocks when the channel is empty. Since the read end of a channel is an `MVar`, this operation inherits fairness guarantees of `MVar`s (e.g. threads blocked in this operation are woken up in FIFO order).

Throws `BlockedIndefinitelyOnMVar` when the channel is empty and no other thread holds a reference to the channel.

dupChan :: Chan a -> IO (Chan a) Source #

Duplicate a `Chan`: the duplicate channel begins empty, but data written to either channel from then on will be available from both. Hence this creates a kind of broadcast channel, where data written by anyone is seen by everyone else.

(Note that a duplicated channel is not equal to its original. So: `fmap (c /=) $ dupChan c` returns `True` for all `c`.)

getChanContents :: Chan a -> IO [a] Source #

Return a lazy list representing the contents of the supplied `Chan`, much like `hGetContents`.

writeList2Chan :: Chan a -> [a] -> IO () Source #

Write an entire list of items to a `Chan`.

rtsSupportsBoundThreads :: Bool Source #

`True` if bound threads are supported. If `rtsSupportsBoundThreads` is `False`, `isCurrentThreadBound` will always return `False` and both `forkOS` and `runInBoundThread` will fail.

forkOSWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId Source #

Like `forkIOWithUnmask`, but the child thread is a bound thread, as with `forkOS`.

isCurrentThreadBound :: IO Bool Source #

Returns `True` if the calling thread is bound, that is, if it is safe to use foreign libraries that rely on thread-local state from the calling thread.

runInBoundThread :: IO a -> IO a Source #

Run the `IO` computation passed as the first argument. If the calling thread is not bound, a bound thread is created temporarily. `runInBoundThread` doesn't finish until the `IO` computation finishes.

You can wrap a series of foreign function calls that rely on thread-local state with `runInBoundThread` so that you can use them without knowing whether the current thread is bound.

runInUnboundThread :: IO a -> IO a Source #

Run the `IO` computation passed as the first argument. If the calling thread is bound, an unbound thread is created temporarily using `forkIO`. `runInBoundThread` doesn't finish until the `IO` computation finishes.

Use this function only in the rare case that you have actually observed a performance loss due to the use of bound threads. A program that doesn't need its main thread to be bound and makes heavy use of concurrency (e.g. a web server), might want to wrap its `main` action in `runInUnboundThread`.

Note that exceptions which are thrown to the current thread are thrown in turn to the thread that is executing the given computation. This ensures there's always a way of killing the forked thread.

diff :: CliOpts -> Journal -> IO () Source #

The diff command.

pack :: String -> Text Source #

O(n) Convert a `String` into a `Text`. Performs replacement on invalid scalar values, so ``unpack` . `pack`` is not `id`:

    >>> Data.Text.unpack (pack "\55555")
    "\65533"

unpack :: Text -> String Source #

O(n) Convert a `Text` into a `String`.

takeEnd :: Int -> [a] -> [a] Source #

Take elements from the end of a list.

spanEnd :: DateSpan -> Maybe Day Source #

strip :: String -> String Source #

Remove leading and trailing whitespace.

expandArgsAt :: [String] -> IO [String] Source #

Expand `@` directives in a list of arguments, usually obtained from `getArgs`. As an example, given the file `test.txt` with the lines `hello` and `world`:

    expandArgsAt ["@test.txt","!"] == ["hello","world","!"]

Any `@` directives in the files will be recursively expanded (raising an error if there is infinite recursion).

To supress `@` expansion, pass any `@` arguments after `--`.

joinArgs :: [String] -> String Source #

Given a sequence of arguments, join them together in a manner that could be used on the command line, giving preference to the Windows `cmd` shell quoting conventions.

For an alternative version, intended for actual running the result in a shell, see "System.Process.showCommandForUser"

splitArgs :: String -> [String] Source #

Given a string, split into the available arguments. The inverse of `joinArgs`.

parseBool :: String -> Maybe Bool Source #

Parse a boolean, accepts as True: true yes on enabled 1.

fromGroup :: Group a -> [a] Source #

Convert a group into a list.

toGroup :: [a] -> Group a Source #

Convert a list into a group, placing all fields in `groupUnnamed`.

modeModes :: Mode a -> [Mode a] Source #

Extract the modes from a `Mode`

modeFlags :: Mode a -> [Flag a] Source #

Extract the flags from a `Mode`

fromFlagOpt :: FlagInfo -> String Source #

Extract the value from inside a `FlagOpt` or `FlagOptRare`, or raises an error.

checkMode :: Mode a -> Maybe String Source #

Check that a mode is well formed.

remap2 :: Remap m => (a -> b) -> (b -> a) -> m a -> m b Source #

Restricted version of `remap` where the values are isomorphic.

remapUpdate :: (a -> b) -> (b -> (a, a -> b)) -> Update a -> Update b Source #

Version of `remap` for the `Update` type alias.

modeEmpty :: a -> Mode a Source #

Create an empty mode specifying only `modeValue`. All other fields will usually be populated using record updates.

mode :: Name -> a -> Help -> Arg a -> [Flag a] -> Mode a Source #

Create a mode with a name, an initial value, some help text, a way of processing arguments and a list of flags.

modes :: String -> a -> Help -> [Mode a] -> Mode a Source #

Create a list of modes, with a program name, an initial value, some help text and the child modes.

flagNone :: [Name] -> (a -> a) -> Help -> Flag a Source #

Create a flag taking no argument value, with a list of flag names, an update function and some help text.

flagOpt :: String -> [Name] -> Update a -> FlagHelp -> Help -> Flag a Source #

Create a flag taking an optional argument value, with an optional value, a list of flag names, an update function, the type of the argument and some help text.

flagReq :: [Name] -> Update a -> FlagHelp -> Help -> Flag a Source #

Create a flag taking a required argument value, with a list of flag names, an update function, the type of the argument and some help text.

flagArg :: Update a -> FlagHelp -> Arg a Source #

Create an argument flag, with an update function and the type of the argument.

flagBool :: [Name] -> (Bool -> a -> a) -> Help -> Flag a Source #

Create a boolean flag, with a list of flag names, an update function and some help text.

complete Source #

Arguments

:: Mode a | Mode specifying which arguments are allowed
-> [String] | Arguments the user has already typed
-> (Int, Int) | 0-based index of the argument they are currently on, and the position in that argument
-> [Complete] |

Given a current state, return the set of commands you could type now, in preference order.

helpText :: [String] -> HelpFormat -> Mode a -> [Text] Source #

Generate a help message from a mode. The first argument is a prefix, which is prepended when not using `HelpFormatBash` or `HelpFormatZsh`.

processArgs :: Mode a -> IO a Source #

Process the flags obtained by ``getArgs`` and ``expandArgsAt`` with a mode. Displays an error and exits with failure if the command line fails to parse, or returns the associated value. Implemented in terms of `process`. This function makes use of the following environment variables:

- `$CMDARGS_COMPLETE` - causes the program to produce completions using `complete`, then exit. Completions are based on the result of `getArgs`, the index of the current argument is taken from `$CMDARGS_COMPLETE` (set it to `-` to complete the last argument), and the index within that argument is taken from `$CMDARGS_COMPLETE_POS` (if set).
- `$CMDARGS_HELPER`/`$CMDARGS_HELPER_PROG` - uses the helper mechanism for entering command line programs as described in System.Console.CmdArgs.Helper.

processValue :: Mode a -> [String] -> a Source #

Process a list of flags (usually obtained from ``getArgs`` and ``expandArgsAt``) with a mode. Throws an error if the command line fails to parse, or returns the associated value. Implemeneted in terms of `process`. This function does not take account of any environment variables that may be set (see `processArgs`).

If you are in `IO` you will probably get a better user experience by calling `processValueIO`.

processValueIO :: Mode a -> [String] -> IO a Source #

Like `processValue` but on failure prints to stderr and exits the program.

flagHelpSimple :: (a -> a) -> Flag a Source #

Create a help flag triggered by `-?`/`--help`.

flagHelpFormat :: (HelpFormat -> TextFormat -> a -> a) -> Flag a Source #

Create a help flag triggered by `-?`/`--help`. The user may optionally modify help by specifying the format, such as:

    --help=all          - help for all modes
    --help=html         - help in HTML format
    --help=100          - wrap the text at 100 characters
    --help=100,one      - full text wrapped at 100 characters

flagVersion :: (a -> a) -> Flag a Source #

Create a version flag triggered by `-V`/`--version`.

flagNumericVersion :: (a -> a) -> Flag a Source #

Create a version flag triggered by `--numeric-version`.

flagsVerbosity :: (Verbosity -> a -> a) -> [Flag a] Source #

Create verbosity flags triggered by `-v`/`--verbose` and `-q`/`--quiet`

wrap :: Text -> Text -> Text -> Text Source #

Wrap a Text with the surrounding Text.

balance :: CliOpts -> Journal -> IO () Source #

The balance command, prints a balance report.

searchPathSeparator :: Char Source #

The character that is used to separate the entries in the $PATH environment variable.

    Windows: searchPathSeparator == ';'
    Posix:   searchPathSeparator == ':'

removeDirectory :: FilePath -> IO () Source #

``removeDirectory` dir` removes an existing directory dir. The implementation may specify additional constraints which must be satisfied before a directory can be removed (e.g. the directory has to be empty, or may not be in use by other processes). It is not legal for an implementation to partially remove a directory unless the entire directory is removed. A conformant implementation need not support directory removal in all situations (e.g. removal of the root directory).

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` The operand is not a valid directory name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The directory does not exist. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EROFS, EACCES, EPERM]`
- `UnsatisfiedConstraints` Implementation-dependent constraints are not satisfied. `[EBUSY, ENOTEMPTY, EEXIST]`
- `UnsupportedOperation` The implementation does not support removal in this situation. `[EINVAL]`
- `InappropriateType` The operand refers to an existing non-directory object. `[ENOTDIR]`

removeFile :: FilePath -> IO () Source #

`removeFile` file removes the directory entry for an existing file file, where file is not itself a directory. The implementation may specify additional constraints which must be satisfied before a file can be removed (e.g. the file may not be in use by other processes).

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` The operand is not a valid file name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The file does not exist. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EROFS, EACCES, EPERM]`
- `UnsatisfiedConstraints` Implementation-dependent constraints are not satisfied. `[EBUSY]`
- `InappropriateType` The operand refers to an existing directory. `[EPERM, EINVAL]`

normalise :: FilePath -> FilePath Source #

Normalise a file

- // outside of the drive can be made blank
- / -> `pathSeparator`
- ./ -> ""

Does not remove `".."`, because of symlinks.

    Posix:   normalise "/file/\\test////" == "/file/\\test/"
    Posix:   normalise "/file/./test" == "/file/test"
    Posix:   normalise "/test/file/../bob/fred/" == "/test/file/../bob/fred/"
    Posix:   normalise "../bob/fred/" == "../bob/fred/"
    Posix:   normalise "/a/../c" == "/a/../c"
    Posix:   normalise "./bob/fred/" == "bob/fred/"
    Windows: normalise "c:\\file/bob\\" == "C:\\file\\bob\\"
    Windows: normalise "c:\\" == "C:\\"
    Windows: normalise "C:.\\" == "C:"
    Windows: normalise "\\\\server\\test" == "\\\\server\\test"
    Windows: normalise "//server/test" == "\\\\server\\test"
    Windows: normalise "c:/file" == "C:\\file"
    Windows: normalise "/file" == "\\file"
    Windows: normalise "\\" == "\\"
    Windows: normalise "/./" == "\\"
             normalise "." == "."
    Posix:   normalise "./" == "./"
    Posix:   normalise "./." == "./"
    Posix:   normalise "/./" == "/"
    Posix:   normalise "/" == "/"
    Posix:   normalise "bob/fred/." == "bob/fred/"
    Posix:   normalise "//home" == "/home"

emptyPermissions :: Permissions Source #

setOwnerReadable :: Bool -> Permissions -> Permissions Source #

setOwnerWritable :: Bool -> Permissions -> Permissions Source #

setOwnerExecutable :: Bool -> Permissions -> Permissions Source #

setOwnerSearchable :: Bool -> Permissions -> Permissions Source #

getPermissions :: FilePath -> IO Permissions Source #

Get the permissions of a file or directory.

On Windows, the `writable` permission corresponds to the "read-only" attribute. The `executable` permission is set if the file extension is of an executable file type. The `readable` permission is always set.

On POSIX systems, this returns the result of `access`.

The operation may fail with:

- `isPermissionError` if the user is not permitted to access the permissions, or
- `isDoesNotExistError` if the file or directory does not exist.

setPermissions :: FilePath -> Permissions -> IO () Source #

Set the permissions of a file or directory.

On Windows, this is only capable of changing the `writable` permission, which corresponds to the "read-only" attribute. Changing the other permissions has no effect.

On POSIX systems, this sets the owner permissions.

The operation may fail with:

- `isPermissionError` if the user is not permitted to set the permissions, or
- `isDoesNotExistError` if the file or directory does not exist.

copyPermissions :: FilePath -> FilePath -> IO () Source #

Copy the permissions of one file to another. This reproduces the permissions more accurately than using `getPermissions` followed by `setPermissions`.

On Windows, this copies only the read-only attribute.

On POSIX systems, this is equivalent to `stat` followed by `chmod`.

createDirectory :: FilePath -> IO () Source #

``createDirectory` dir` creates a new directory `dir` which is initially empty, or as near to empty as the operating system allows.

The operation may fail with:

- `isPermissionError` The process has insufficient privileges to perform the operation. `[EROFS, EACCES]`
- `isAlreadyExistsError` The operand refers to a directory that already exists. `[EEXIST]`
- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` The operand is not a valid directory name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` There is no path to the directory. `[ENOENT, ENOTDIR]`
- `isFullError` Insufficient resources (virtual memory, process file descriptors, physical disk space, etc.) are available to perform the operation. `[EDQUOT, ENOSPC, ENOMEM, EMLINK]`
- `InappropriateType` The path refers to an existing non-directory object. `[EEXIST]`

createDirectoryIfMissing Source #

Arguments

:: Bool | Create its parents too?
-> FilePath | The path to the directory you want to make
-> IO () |

``createDirectoryIfMissing` parents dir` creates a new directory `dir` if it doesn't exist. If the first argument is `True` the function will also create all parent directories if they are missing.

removeDirectoryRecursive :: FilePath -> IO () Source #

``removeDirectoryRecursive` dir` removes an existing directory dir together with its contents and subdirectories. Within this directory, symbolic links are removed without affecting their targets.

On Windows, the operation fails if dir is a directory symbolic link.

This operation is reported to be flaky on Windows so retry logic may be advisable. See: https://github.com/haskell/directory/pull/108

removePathForcibly :: FilePath -> IO () Source #

Removes a file or directory at path together with its contents and subdirectories. Symbolic links are removed without affecting their targets. If the path does not exist, nothing happens.

Unlike other removal functions, this function will also attempt to delete files marked as read-only or otherwise made unremovable due to permissions. As a result, if the removal is incomplete, the permissions or attributes on the remaining files may be altered. If there are hard links in the directory, then permissions on all related hard links may be altered.

If an entry within the directory vanishes while `removePathForcibly` is running, it is silently ignored.

If an exception occurs while removing an entry, `removePathForcibly` will still try to remove as many entries as it can before failing with an exception. The first exception that it encountered is re-thrown.

Since: directory-1.2.7.0

renameDirectory :: FilePath -> FilePath -> IO () Source #

``renameDirectory` old new` changes the name of an existing directory from old to new. If the new directory already exists, it is atomically replaced by the old directory. If the new directory is neither the old directory nor an alias of the old directory, it is removed as if by `removeDirectory`. A conformant implementation need not support renaming directories in all situations (e.g. renaming to an existing directory, or across different physical devices), but the constraints must be documented.

On Win32 platforms, `renameDirectory` fails if the new directory already exists.

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` Either operand is not a valid directory name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The original directory does not exist, or there is no path to the target. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EROFS, EACCES, EPERM]`
- `isFullError` Insufficient resources are available to perform the operation. `[EDQUOT, ENOSPC, ENOMEM, EMLINK]`
- `UnsatisfiedConstraints` Implementation-dependent constraints are not satisfied. `[EBUSY, ENOTEMPTY, EEXIST]`
- `UnsupportedOperation` The implementation does not support renaming in this situation. `[EINVAL, EXDEV]`
- `InappropriateType` Either path refers to an existing non-directory object. `[ENOTDIR, EISDIR]`

renameFile :: FilePath -> FilePath -> IO () Source #

``renameFile` old new` changes the name of an existing file system object from old to new. If the new object already exists, it is replaced by the old object. Neither path may refer to an existing directory. A conformant implementation need not support renaming files in all situations (e.g. renaming across different physical devices), but the constraints must be documented.

On Windows, this calls `MoveFileEx` with `MOVEFILE_REPLACE_EXISTING` set, which is not guaranteed to be atomic (https://github.com/haskell/directory/issues/109).

On other platforms, this operation is atomic.

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` Either operand is not a valid file name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The original file does not exist, or there is no path to the target. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EROFS, EACCES, EPERM]`
- `isFullError` Insufficient resources are available to perform the operation. `[EDQUOT, ENOSPC, ENOMEM, EMLINK]`
- `UnsatisfiedConstraints` Implementation-dependent constraints are not satisfied. `[EBUSY]`
- `UnsupportedOperation` The implementation does not support renaming in this situation. `[EXDEV]`
- `InappropriateType` Either path refers to an existing directory. `[ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]`

renamePath Source #

Arguments

:: FilePath | Old path
-> FilePath | New path
-> IO () |

Rename a file or directory. If the destination path already exists, it is replaced atomically. The destination path must not point to an existing directory. A conformant implementation need not support renaming files in all situations (e.g. renaming across different physical devices), but the constraints must be documented.

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` Either operand is not a valid file name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The original file does not exist, or there is no path to the target. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EROFS, EACCES, EPERM]`
- `isFullError` Insufficient resources are available to perform the operation. `[EDQUOT, ENOSPC, ENOMEM, EMLINK]`
- `UnsatisfiedConstraints` Implementation-dependent constraints are not satisfied. `[EBUSY]`
- `UnsupportedOperation` The implementation does not support renaming in this situation. `[EXDEV]`
- `InappropriateType` Either the destination path refers to an existing directory, or one of the parent segments in the destination path is not a directory. `[ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]`

Since: directory-1.2.7.0

copyFile Source #

Arguments

:: FilePath | Source filename
-> FilePath | Destination filename
-> IO () |

Copy a file with its permissions. If the destination file already exists, it is replaced atomically. Neither path may refer to an existing directory. No exceptions are thrown if the permissions could not be copied.

copyFileWithMetadata Source #

Arguments

:: FilePath | Source file
-> FilePath | Destination file
-> IO () |

Copy a file with its associated metadata. If the destination file already exists, it is overwritten. There is no guarantee of atomicity in the replacement of the destination file. Neither path may refer to an existing directory. If the source and/or destination are symbolic links, the copy is performed on the targets of the links.

On Windows, it behaves like the Win32 function CopyFile, which copies various kinds of metadata including file attributes and security resource properties.

On Unix-like systems, permissions, access time, and modification time are preserved. If possible, the owner and group are also preserved. Note that the very act of copying can change the access time of the source file, hence the access times of the two files may differ after the operation completes.

Since: directory-1.2.6.0

canonicalizePath :: FilePath -> IO FilePath Source #

Make a path absolute, normalize the path, and remove as many indirections from it as possible. Any trailing path separators are discarded via `dropTrailingPathSeparator`. Additionally, on Windows the letter case of the path is canonicalized.

Note: This function is a very big hammer. If you only need an absolute path, `makeAbsolute` is sufficient for removing dependence on the current working directory.

Indirections include the two special directories `.` and `..`, as well as any symbolic links (and junction points on Windows). The input path need not point to an existing file or directory. Canonicalization is performed on the longest prefix of the path that points to an existing file or directory. The remaining portion of the path that does not point to an existing file or directory will still be normalized, but case canonicalization and indirection removal are skipped as they are impossible to do on a nonexistent path.

Most programs should not worry about the canonicity of a path. In particular, despite the name, the function does not truly guarantee canonicity of the returned path due to the presence of hard links, mount points, etc.

If the path points to an existing file or directory, then the output path shall also point to the same file or directory, subject to the condition that the relevant parts of the file system do not change while the function is still running. In other words, the function is definitively not atomic. The results can be utterly wrong if the portions of the path change while this function is running.

Since some indirections (symbolic links on all systems, `..` on non-Windows systems, and junction points on Windows) are dependent on the state of the existing filesystem, the function can only make a conservative attempt by removing such indirections from the longest prefix of the path that still points to an existing file or directory.

Note that on Windows parent directories `..` are always fully expanded before the symbolic links, as consistent with the rest of the Windows API (such as `GetFullPathName`). In contrast, on POSIX systems parent directories `..` are expanded alongside symbolic links from left to right. To put this more concretely: if `L` is a symbolic link for `R/P`, then on Windows `L\..` refers to `.`, whereas on other operating systems `L/..` refers to `R`.

Similar to `normalise`, passing an empty path is equivalent to passing the current directory.

`canonicalizePath` can resolve at least 64 indirections in a single path, more than what is supported by most operating systems. Therefore, it may return the fully resolved path even though the operating system itself would have long given up.

On Windows XP or earlier systems, junction expansion is not performed due to their lack of `GetFinalPathNameByHandle`.

Changes since 1.2.3.0: The function has been altered to be more robust and has the same exception behavior as `makeAbsolute`.

Changes since 1.3.0.0: The function no longer preserves the trailing path separator. File symbolic links that appear in the middle of a path are properly dereferenced. Case canonicalization and symbolic link expansion are now performed on Windows.

makeAbsolute :: FilePath -> IO FilePath Source #

Convert a path into an absolute path. If the given path is relative, the current directory is prepended and then the combined result is normalized. If the path is already absolute, the path is simply normalized. The function preserves the presence or absence of the trailing path separator unless the path refers to the root directory `/`.

If the path is already absolute, the operation never fails. Otherwise, the operation may fail with the same exceptions as `getCurrentDirectory`.

Since: directory-1.2.2.0

makeRelativeToCurrentDirectory :: FilePath -> IO FilePath Source #

Construct a path relative to the current directory, similar to `makeRelative`.

The operation may fail with the same exceptions as `getCurrentDirectory`.

findExecutable :: String -> IO (Maybe FilePath) Source #

Given the name or path of an executable file, `findExecutable` searches for such a file in a list of system-defined locations, which generally includes `PATH` and possibly more. The full path to the executable is returned if found. For example, `(findExecutable "ghc")` would normally give you the path to GHC.

The path returned by ``findExecutable` name` corresponds to the program that would be executed by `createProcess` when passed the same string (as a `RawCommand`, not a `ShellCommand`), provided that `name` is not a relative path with more than one segment.

On Windows, `findExecutable` calls the Win32 function `SearchPath`, which may search other places before checking the directories in the `PATH` environment variable. Where it actually searches depends on registry settings, but notably includes the directory containing the current executable.

On non-Windows platforms, the behavior is equivalent to `findFileWith` using the search directories from the `PATH` environment variable and testing each file for executable permissions. Details can be found in the documentation of `findFileWith`.

findExecutables :: String -> IO [FilePath] Source #

Search for executable files in a list of system-defined locations, which generally includes `PATH` and possibly more.

On Windows, this only returns the first occurrence, if any. Its behavior is therefore equivalent to `findExecutable`.

On non-Windows platforms, the behavior is equivalent to `findExecutablesInDirectories` using the search directories from the `PATH` environment variable. Details can be found in the documentation of `findExecutablesInDirectories`.

Since: directory-1.2.2.0

findExecutablesInDirectories :: [FilePath] -> String -> IO [FilePath] Source #

Given a name or path, `findExecutable` appends the `exeExtension` to the query and searches for executable files in the list of given search directories and returns all occurrences.

The behavior is equivalent to `findFileWith` using the given search directories and testing each file for executable permissions. Details can be found in the documentation of `findFileWith`.

Unlike other similarly named functions, `findExecutablesInDirectories` does not use `SearchPath` from the Win32 API. The behavior of this function on Windows is therefore equivalent to those on non-Windows platforms.

Since: directory-1.2.4.0

findFile :: [FilePath] -> String -> IO (Maybe FilePath) Source #

Search through the given list of directories for the given file.

The behavior is equivalent to `findFileWith`, returning only the first occurrence. Details can be found in the documentation of `findFileWith`.

findFiles :: [FilePath] -> String -> IO [FilePath] Source #

Search through the given list of directories for the given file and returns all paths where the given file exists.

The behavior is equivalent to `findFilesWith`. Details can be found in the documentation of `findFilesWith`.

Since: directory-1.2.1.0

findFileWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO (Maybe FilePath) Source #

Search through a given list of directories for a file that has the given name and satisfies the given predicate and return the path of the first occurrence. The directories are checked in a left-to-right order.

This is essentially a more performant version of `findFilesWith` that always returns the first result, if any. Details can be found in the documentation of `findFilesWith`.

Since: directory-1.2.6.0

findFilesWith :: (FilePath -> IO Bool) -> [FilePath] -> String -> IO [FilePath] Source #

`findFilesWith predicate dirs name` searches through the list of directories (`dirs`) for files that have the given `name` and satisfy the given `predicate` and returns the paths of those files. The directories are checked in a left-to-right order and the paths are returned in the same order.

If the `name` is a relative path, then for every search directory `dir`, the function checks whether `dir `</>` name` exists and satisfies the predicate. If so, `dir `</>` name` is returned as one of the results. In other words, the returned paths can be either relative or absolute depending on the search directories were used. If there are no search directories, no results are ever returned.

If the `name` is an absolute path, then the function will return a single result if the file exists and satisfies the predicate and no results otherwise. This is irrespective of what search directories were given.

Since: directory-1.2.1.0

exeExtension :: String Source #

Filename extension for executable files (including the dot if any) (usually `""` on POSIX systems and `".exe"` on Windows or OS/2).

Since: directory-1.2.4.0

listDirectory :: FilePath -> IO [FilePath] Source #

``listDirectory` dir` returns a list of all entries in dir without the special entries (`.` and `..`).

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` The operand is not a valid directory name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The directory does not exist. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EACCES]`
- `isFullError` Insufficient resources are available to perform the operation. `[EMFILE, ENFILE]`
- `InappropriateType` The path refers to an existing non-directory object. `[ENOTDIR]`

Since: directory-1.2.5.0

getCurrentDirectory :: IO FilePath Source #

Obtain the current working directory as an absolute path.

In a multithreaded program, the current working directory is a global state shared among all threads of the process. Therefore, when performing filesystem operations from multiple threads, it is highly recommended to use absolute rather than relative paths (see: `makeAbsolute`).

Note that `getCurrentDirectory` is not guaranteed to return the same path received by `setCurrentDirectory`. On POSIX systems, the path returned will always be fully dereferenced (not contain any symbolic links). For more information, refer to the documentation of getcwd.

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `isDoesNotExistError` There is no path referring to the working directory. `[EPERM, ENOENT, ESTALE...]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EACCES]`
- `isFullError` Insufficient resources are available to perform the operation.
- `UnsupportedOperation` The operating system has no notion of current working directory.

setCurrentDirectory :: FilePath -> IO () Source #

Change the working directory to the given path.

In a multithreaded program, the current working directory is a global state shared among all threads of the process. Therefore, when performing filesystem operations from multiple threads, it is highly recommended to use absolute rather than relative paths (see: `makeAbsolute`).

The operation may fail with:

- `HardwareFault` A physical I/O error has occurred. `[EIO]`
- `InvalidArgument` The operand is not a valid directory name. `[ENAMETOOLONG, ELOOP]`
- `isDoesNotExistError` The directory does not exist. `[ENOENT, ENOTDIR]`
- `isPermissionError` The process has insufficient privileges to perform the operation. `[EACCES]`
- `UnsupportedOperation` The operating system has no notion of current working directory, or the working directory cannot be dynamically changed.
- `InappropriateType` The path refers to an existing non-directory object. `[ENOTDIR]`

withCurrentDirectory Source #

Arguments

:: FilePath | Directory to execute in
-> IO a | Action to be executed
-> IO a |

Run an `IO` action with the given working directory and restore the original working directory afterwards, even if the given action fails due to an exception.

The operation may fail with the same exceptions as `getCurrentDirectory` and `setCurrentDirectory`.

Since: directory-1.2.3.0

getFileSize :: FilePath -> IO Integer Source #

Obtain the size of a file in bytes.

Since: directory-1.2.7.0

doesPathExist :: FilePath -> IO Bool Source #

Test whether the given path points to an existing filesystem object. If the user lacks necessary permissions to search the parent directories, this function may return false even if the file does actually exist.

Since: directory-1.2.7.0

doesDirectoryExist :: FilePath -> IO Bool Source #

The operation `doesDirectoryExist` returns `True` if the argument file exists and is either a directory or a symbolic link to a directory, and `False` otherwise.

doesFileExist :: FilePath -> IO Bool Source #

The operation `doesFileExist` returns `True` if the argument file exists and is not a directory, and `False` otherwise.

createFileLink Source #

Arguments

:: FilePath | path to the target file
-> FilePath | path of the link to be created
-> IO () |

Create a file symbolic link. The target path can be either absolute or relative and need not refer to an existing file. The order of arguments follows the POSIX convention.

To remove an existing file symbolic link, use `removeFile`.

Although the distinction between file symbolic links and directory symbolic links does not exist on POSIX systems, on Windows this is an intrinsic property of every symbolic link and cannot be changed without recreating the link. A file symbolic link that actually points to a directory will fail to dereference and vice versa. Moreover, creating symbolic links on Windows may require privileges unavailable to users outside the Administrators group. Portable programs that use symbolic links should take both into consideration.

On Windows, the function is implemented using `CreateSymbolicLink`. Since 1.3.3.0, the `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` flag is included if supported by the operating system. On POSIX, the function uses `symlink` and is therefore atomic.

Windows-specific errors: This operation may fail with `permissionErrorType` if the user lacks the privileges to create symbolic links. It may also fail with `illegalOperationErrorType` if the file system does not support symbolic links.

Since: directory-1.3.1.0

createDirectoryLink Source #

Arguments

:: FilePath | path to the target directory
-> FilePath | path of the link to be created
-> IO () |

Create a directory symbolic link. The target path can be either absolute or relative and need not refer to an existing directory. The order of arguments follows the POSIX convention.

To remove an existing directory symbolic link, use `removeDirectoryLink`.

Although the distinction between file symbolic links and directory symbolic links does not exist on POSIX systems, on Windows this is an intrinsic property of every symbolic link and cannot be changed without recreating the link. A file symbolic link that actually points to a directory will fail to dereference and vice versa. Moreover, creating symbolic links on Windows may require privileges unavailable to users outside the Administrators group. Portable programs that use symbolic links should take both into consideration.

On Windows, the function is implemented using `CreateSymbolicLink` with `SYMBOLIC_LINK_FLAG_DIRECTORY`. Since 1.3.3.0, the `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` flag is also included if supported by the operating system. On POSIX, this is an alias for `createFileLink` and is therefore atomic.

Windows-specific errors: This operation may fail with `permissionErrorType` if the user lacks the privileges to create symbolic links. It may also fail with `illegalOperationErrorType` if the file system does not support symbolic links.

Since: directory-1.3.1.0

removeDirectoryLink :: FilePath -> IO () Source #

Remove an existing directory symbolic link.

On Windows, this is an alias for `removeDirectory`. On POSIX systems, this is an alias for `removeFile`.

See also: `removeFile`, which can remove an existing file symbolic link.

Since: directory-1.3.1.0

pathIsSymbolicLink :: FilePath -> IO Bool Source #

Check whether an existing `path` is a symbolic link. If `path` is a regular file or directory, `False` is returned. If `path` does not exist or is otherwise inaccessible, an exception is thrown (see below).

On Windows, this checks for `FILE_ATTRIBUTE_REPARSE_POINT`. In addition to symbolic links, the function also returns true on junction points. On POSIX systems, this checks for `S_IFLNK`.

The operation may fail with:

- `isDoesNotExistError` if the symbolic link does not exist; or
- `isPermissionError` if the user is not permitted to read the symbolic link.

Since: directory-1.3.0.0

isSymbolicLink :: FilePath -> IO Bool Source #

getSymbolicLinkTarget :: FilePath -> IO FilePath Source #

Retrieve the target path of either a file or directory symbolic link. The returned path may not be absolute, may not exist, and may not even be a valid path.

On Windows systems, this calls `DeviceIoControl` with `FSCTL_GET_REPARSE_POINT`. In addition to symbolic links, the function also works on junction points. On POSIX systems, this calls `readlink`.

Windows-specific errors: This operation may fail with `illegalOperationErrorType` if the file system does not support symbolic links.

Since: directory-1.3.1.0

getAccessTime :: FilePath -> IO UTCTime Source #

Obtain the time at which the file or directory was last accessed.

The operation may fail with:

- `isPermissionError` if the user is not permitted to read the access time; or
- `isDoesNotExistError` if the file or directory does not exist.

Caveat for POSIX systems: This function returns a timestamp with sub-second resolution only if this package is compiled against `unix-2.6.0.0` or later and the underlying filesystem supports them.

Since: directory-1.2.3.0

getModificationTime :: FilePath -> IO UTCTime Source #

Obtain the time at which the file or directory was last modified.

The operation may fail with:

- `isPermissionError` if the user is not permitted to read the modification time; or
- `isDoesNotExistError` if the file or directory does not exist.

Caveat for POSIX systems: This function returns a timestamp with sub-second resolution only if this package is compiled against `unix-2.6.0.0` or later and the underlying filesystem supports them.

setAccessTime :: FilePath -> UTCTime -> IO () Source #

Change the time at which the file or directory was last accessed.

The operation may fail with:

- `isPermissionError` if the user is not permitted to alter the access time; or
- `isDoesNotExistError` if the file or directory does not exist.

Some caveats for POSIX systems:

- Not all systems support `utimensat`, in which case the function can only emulate the behavior by reading the modification time and then setting both the access and modification times together. On systems where `utimensat` is supported, the access time is set atomically with nanosecond precision.
- If compiled against a version of `unix` prior to `2.7.0.0`, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the modification time.

Since: directory-1.2.3.0

setModificationTime :: FilePath -> UTCTime -> IO () Source #

Change the time at which the file or directory was last modified.

The operation may fail with:

- `isPermissionError` if the user is not permitted to alter the modification time; or
- `isDoesNotExistError` if the file or directory does not exist.

Some caveats for POSIX systems:

- Not all systems support `utimensat`, in which case the function can only emulate the behavior by reading the access time and then setting both the access and modification times together. On systems where `utimensat` is supported, the modification time is set atomically with nanosecond precision.
- If compiled against a version of `unix` prior to `2.7.0.0`, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the access time.

Since: directory-1.2.3.0

getHomeDirectory :: IO FilePath Source #

Returns the current user's home directory.

The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use `getXdgDirectory` or `getAppUserDataDirectory` instead.

On Unix, `getHomeDirectory` behaves as follows:

- Returns $HOME env variable if set (including to an empty string).
- Otherwise uses home directory returned by `getpwuid_r` using the UID of the current proccesses user. This basically reads the etcpasswd file. An empty home directory field is considered valid.

On Windows, the system is queried for a suitable path; a typical path might be `C:/Users/<user>`.

The operation may fail with:

- `UnsupportedOperation` The operating system has no notion of home directory.
- `isDoesNotExistError` The home directory for the current user does not exist, or cannot be found.

getXdgDirectory Source #

Arguments

:: XdgDirectory | which special directory
-> FilePath | a relative path that is appended to the path; if empty, the base path is returned
-> IO FilePath |

Obtain the paths to special directories for storing user-specific application data, configuration, and cache files, conforming to the XDG Base Directory Specification. Compared with `getAppUserDataDirectory`, this function provides a more fine-grained hierarchy as well as greater flexibility for the user.

On Windows, `XdgData` and `XdgConfig` usually map to the same directory unless overridden.

Refer to the docs of `XdgDirectory` for more details.

The second argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters. Note: if the second argument is an absolute path, it will just return the second argument.

Note: The directory may not actually exist, in which case you would need to create it with file mode `700` (i.e. only accessible by the owner).

As of 1.3.5.0, the environment variable is ignored if set to a relative path, per revised XDG Base Directory Specification. See #100.

Since: directory-1.2.3.0

getXdgDirectoryList Source #

Arguments

:: XdgDirectoryList | which special directory list
-> IO [FilePath] |

Similar to `getXdgDirectory` but retrieves the entire list of XDG directories.

On Windows, `XdgDataDirs` and `XdgConfigDirs` usually map to the same list of directories unless overridden.

Refer to the docs of `XdgDirectoryList` for more details.

getAppUserDataDirectory Source #

Arguments

:: FilePath | a relative path that is appended to the path
-> IO FilePath |

Obtain the path to a special directory for storing user-specific application data (traditional Unix location). Newer applications may prefer the the XDG-conformant location provided by `getXdgDirectory` (migration guide).

The argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters.

- On Unix-like systems, the path is `~/.<app>`.
- On Windows, the path is `%APPDATA%/<app>` (e.g. `C:/Users/<user>/AppData/Roaming/<app>`)

Note: the directory may not actually exist, in which case you would need to create it. It is expected that the parent directory exists and is writable.

The operation may fail with:

- `UnsupportedOperation` The operating system has no notion of application-specific data directory.
- `isDoesNotExistError` The home directory for the current user does not exist, or cannot be found.

getUserDocumentsDirectory :: IO FilePath Source #

Returns the current user's document directory.

The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use `getXdgDirectory` or `getAppUserDataDirectory` instead.

On Unix, `getUserDocumentsDirectory` returns the value of the `HOME` environment variable. On Windows, the system is queried for a suitable path; a typical path might be `C:/Users/<user>/Documents`.

The operation may fail with:

- `UnsupportedOperation` The operating system has no notion of document directory.
- `isDoesNotExistError` The document directory for the current user does not exist, or cannot be found.

getTemporaryDirectory :: IO FilePath Source #

Returns the current directory for temporary files.

On Unix, `getTemporaryDirectory` returns the value of the `TMPDIR` environment variable or "/tmp" if the variable isn't defined. On Windows, the function checks for the existence of environment variables in the following order and uses the first path found:

- TMP environment variable.
- TEMP environment variable.
- USERPROFILE environment variable.
- The Windows directory

The operation may fail with:

- `UnsupportedOperation` The operating system has no notion of temporary directory.

The function doesn't verify whether the path exists.

dropTrailingPathSeparator :: FilePath -> FilePath Source #

Remove any trailing path separators

    dropTrailingPathSeparator "file/test/" == "file/test"
              dropTrailingPathSeparator "/" == "/"
    Windows:  dropTrailingPathSeparator "\\" == "\\"
    Posix:    not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x

makeRelative :: FilePath -> FilePath -> FilePath Source #

Contract a filename, based on a relative path. Note that the resulting path will never introduce `..` paths, as the presence of symlinks means `../b` may not reach `a/b` if it starts from `a/c`. For a worked example see this blog post.

The corresponding `makeAbsolute` function can be found in `System.Directory`.

             makeRelative "/directory" "/directory/file.ext" == "file.ext"
             Valid x => makeRelative (takeDirectory x) x `equalFilePath` takeFileName x
             makeRelative x x == "."
             Valid x y => equalFilePath x y || (isRelative x && makeRelative y x == x) || equalFilePath (y </> makeRelative y x) x
    Windows: makeRelative "C:\\Home" "c:\\home\\bob" == "bob"
    Windows: makeRelative "C:\\Home" "c:/home/bob" == "bob"
    Windows: makeRelative "C:\\Home" "D:\\Home\\Bob" == "D:\\Home\\Bob"
    Windows: makeRelative "C:\\Home" "C:Home\\Bob" == "C:Home\\Bob"
    Windows: makeRelative "/Home" "/home/bob" == "bob"
    Windows: makeRelative "/" "//" == "//"
    Posix:   makeRelative "/Home" "/home/bob" == "/home/bob"
    Posix:   makeRelative "/home/" "/home/bob/foo/bar" == "bob/foo/bar"
    Posix:   makeRelative "/fred" "bob" == "bob"
    Posix:   makeRelative "/file/test" "/file/test/fred" == "fred"
    Posix:   makeRelative "/file/test" "/file/test/fred/" == "fred/"
    Posix:   makeRelative "some/path" "some/path/a/b/c" == "a/b/c"

(</>) :: FilePath -> FilePath -> FilePath infixr 5 Source #

Combine two paths with a path separator. If the second path starts with a path separator or a drive letter, then it returns the second. The intention is that `readFile (dir `</>` file)` will access the same file as `setCurrentDirectory dir; readFile file`.

    Posix:   "/directory" </> "file.ext" == "/directory/file.ext"
    Windows: "/directory" </> "file.ext" == "/directory\\file.ext"
             "directory" </> "/file.ext" == "/file.ext"
    Valid x => (takeDirectory x </> takeFileName x) `equalFilePath` x

Combined:

    Posix:   "/" </> "test" == "/test"
    Posix:   "home" </> "bob" == "home/bob"
    Posix:   "x:" </> "foo" == "x:/foo"
    Windows: "C:\\foo" </> "bar" == "C:\\foo\\bar"
    Windows: "home" </> "bob" == "home\\bob"

Not combined:

    Posix:   "home" </> "/bob" == "/bob"
    Windows: "home" </> "C:\\bob" == "C:\\bob"

Not combined (tricky):

On Windows, if a filepath starts with a single slash, it is relative to the root of the current drive. In [1], this is (confusingly) referred to as an absolute path. The current behavior of `</>` is to never combine these forms.

    Windows: "home" </> "/bob" == "/bob"
    Windows: "home" </> "\\bob" == "\\bob"
    Windows: "C:\\home" </> "\\bob" == "\\bob"

On Windows, from [1]: "If a file name begins with only a disk designator but not the backslash after the colon, it is interpreted as a relative path to the current directory on the drive with the specified letter." The current behavior of `</>` is to never combine these forms.

    Windows: "D:\\foo" </> "C:bar" == "C:bar"
    Windows: "C:\\foo" </> "C:bar" == "C:bar"

curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d Source #

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

first3 :: (a, b, c) -> a Source #

second3 :: (a, b, c) -> b Source #

third3 :: (a, b, c) -> c Source #

headDef :: a -> [a] -> a Source #

lastDef :: a -> [a] -> a Source #

system :: String -> IO ExitCode Source #

Computation `system cmd` returns the exit code produced when the operating system runs the shell command `cmd`.

This computation may fail with one of the following `IOErrorType` exceptions:

`PermissionDenied`
  The process has insufficient privileges to perform the operation.
`ResourceExhausted`
  Insufficient resources are available to perform the operation.
`UnsupportedOperation`
  The implementation does not support system calls.

On Windows, `system` passes the command to the Windows command interpreter (`CMD.EXE` or `COMMAND.COM`), hence Unixy shell tricks will not work.

On Unix systems, see `waitForProcess` for the meaning of exit codes when the process died as the result of a signal.

waitForProcess :: ProcessHandle -> IO ExitCode Source #

Waits for the specified process to terminate, and returns its exit code. On Unix systems, may throw `UserInterrupt` when using `delegate_ctlc`.

GHC Note: in order to call `waitForProcess` without blocking all the other threads in the system, you must compile the program with `-threaded`.

Note that it is safe to call `waitForProcess` for the same process in multiple threads. When the process ends, threads blocking on this call will wake in FIFO order. When using `delegate_ctlc` and the process is interrupted, only the first waiting thread will throw `UserInterrupt`.

(Since: 1.2.0.0) On Unix systems, a negative value ``ExitFailure` -signum` indicates that the child was terminated by signal `signum`. The signal numbers are platform-specific, so to test for a specific signal use the constants provided by System.Posix.Signals in the `unix` package. Note: core dumps are not reported, use System.Posix.Process if you need this detail.

createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) Source #

This is the most general way to spawn an external process. The process can be a command line to be executed by a shell or a raw command with a list of arguments. The stdin, stdout, and stderr streams of the new process may individually be attached to new pipes, to existing `Handle`s, or just inherited from the parent (the default.)

The details of how to create the process are passed in the `CreateProcess` record. To make it easier to construct a `CreateProcess`, the functions `proc` and `shell` are supplied that fill in the fields with default values which can be overriden as needed.

`createProcess` returns `(mb_stdin_hdl, mb_stdout_hdl, mb_stderr_hdl, ph)`, where

- if ``std_in` == `CreatePipe``, then `mb_stdin_hdl` will be `Just h`, where `h` is the write end of the pipe connected to the child process's `stdin`.
- otherwise, `mb_stdin_hdl == Nothing`

Similarly for `mb_stdout_hdl` and `mb_stderr_hdl`.

For example, to execute a simple `ls` command:

      r <- createProcess (proc "ls" [])

To create a pipe from which to read the output of `ls`:

      (_, Just hout, _, _) <-
          createProcess (proc "ls" []){ std_out = CreatePipe }

To also set the directory in which to run `ls`:

      (_, Just hout, _, _) <-
          createProcess (proc "ls" []){ cwd = Just "/home/bob",
                                        std_out = CreatePipe }

Note that `Handle`s provided for `std_in`, `std_out`, or `std_err` via the `UseHandle` constructor will be closed by calling this function. This is not always the desired behavior. In cases where you would like to leave the `Handle` open after spawning the child process, please use `createProcess_` instead. All created `Handle`s are initially in text mode; if you need them to be in binary mode then use `hSetBinaryMode`.

`ph` contains a handle to the running process. On Windows `use_process_jobs` can be set in CreateProcess in order to create a Win32 Job object to monitor a process tree's progress. If it is set then that job is also returned inside `ph`. `ph` can be used to kill all running sub-processes. This feature has been available since 1.5.0.0.

createProcess_ Source #

Arguments

:: String | Function name (for error messages). This can be any `String`, but will typically be the name of the caller. E.g., `spawnProcess` passes `"spawnProcess"` here when calling `createProcess_`.
-> CreateProcess |
-> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) |

This function is almost identical to `createProcess`. The only differences are:

- `Handle`s provided via `UseHandle` are not closed automatically.
- This function takes an extra `String` argument to be used in creating error messages.

This function has been available from the System.Process.Internals module for some time, and is part of the System.Process module since version 1.2.1.0.

Since: process-1.2.1.0

createPipe :: IO (Handle, Handle) Source #

Create a pipe for interprocess communication and return a `(readEnd, writeEnd)` `Handle` pair.

- WinIO Support

When this function is used with WinIO enabled it's the caller's responsibility to register the handles with the I/O manager. If this is not done the operation will deadlock. Association can be done as follows:

        #if defined(IO_MANAGER_WINIO)
        import GHC.IO.SubSystem ((!))
        import GHC.IO.Handle.Windows (handleToHANDLE)
        import GHC.Event.Windows (associateHandle')
        #endif

        ...

        #if defined (IO_MANAGER_WINIO)
        return () ! (do
          associateHandle' =handleToHANDLE <handle)
        #endif

Only associate handles that you are in charge of read/writing to. Do not associate handles passed to another process. It's the process's reponsibility to register the handle if it supports async access.

Since: process-1.2.1.0

createPipeFd :: IO (FD, FD) Source #

Create a pipe for interprocess communication and return a `(readEnd, writeEnd)` `FD` pair.

Since: process-1.4.2.0

interruptProcessGroupOf Source #

Arguments

:: ProcessHandle | A process in the process group
-> IO () |

Sends an interrupt signal to the process group of the given process.

On Unix systems, it sends the group the SIGINT signal.

On Windows systems, it generates a CTRL_BREAK_EVENT and will only work for processes created using `createProcess` and setting the `create_group` flag

proc :: FilePath -> [String] -> CreateProcess Source #

Construct a `CreateProcess` record for passing to `createProcess`, representing a raw command with arguments.

See `RawCommand` for precise semantics of the specified `FilePath`.

shell :: String -> CreateProcess Source #

Construct a `CreateProcess` record for passing to `createProcess`, representing a command to be passed to the shell.

withCreateProcess :: CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> ProcessHandle -> IO a) -> IO a Source #

A `bracket`-style resource handler for `createProcess`.

Does automatic cleanup when the action finishes. If there is an exception in the body then it ensures that the process gets terminated and any `CreatePipe` `Handle`s are closed. In particular this means that if the Haskell thread is killed (e.g. `killThread`), that the external process is also terminated.

e.g.

    withCreateProcess (proc cmd args) { ... }  $ \stdin stdout stderr ph -> do
      ...

Since: process-1.4.3.0

cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO () Source #

Cleans up the process.

This function is meant to be invoked from any application level cleanup handler. It terminates the process, and closes any `CreatePipe` `handle`s.

Since: process-1.6.4.0

spawnProcess :: FilePath -> [String] -> IO ProcessHandle Source #

Creates a new process to run the specified raw command with the given arguments. It does not wait for the program to finish, but returns the `ProcessHandle`.

Since: process-1.2.0.0

spawnCommand :: String -> IO ProcessHandle Source #

Creates a new process to run the specified shell command. It does not wait for the program to finish, but returns the `ProcessHandle`.

Since: process-1.2.0.0

callProcess :: FilePath -> [String] -> IO () Source #

Creates a new process to run the specified command with the given arguments, and wait for it to finish. If the command returns a non-zero exit code, an exception is raised.

If an asynchronous exception is thrown to the thread executing `callProcess`, the forked process will be terminated and `callProcess` will wait (block) until the process has been terminated.

Since: process-1.2.0.0

callCommand :: String -> IO () Source #

Creates a new process to run the specified shell command. If the command returns a non-zero exit code, an exception is raised.

If an asynchronous exception is thrown to the thread executing `callCommand`, the forked process will be terminated and `callCommand` will wait (block) until the process has been terminated.

Since: process-1.2.0.0

readProcess Source #

Arguments

:: FilePath | Filename of the executable (see `RawCommand` for details)
-> [String] | any arguments
-> String | standard input
-> IO String | stdout

`readProcess` forks an external process, reads its standard output strictly, blocking until the process terminates, and returns the output string. The external process inherits the standard error.

If an asynchronous exception is thrown to the thread executing `readProcess`, the forked process will be terminated and `readProcess` will wait (block) until the process has been terminated.

Output is returned strictly, so this is not suitable for launching processes that require interaction over the standard file streams.

This function throws an `IOException` if the process `ExitCode` is anything other than `ExitSuccess`. If instead you want to get the `ExitCode` then use `readProcessWithExitCode`.

Users of this function should compile with `-threaded` if they want other Haskell threads to keep running while waiting on the result of readProcess.

     > readProcess "date" [] []
     "Thu Feb  7 10:03:39 PST 2008\n"

The arguments are:

- The command to run, which must be in the $PATH, or an absolute or relative path
- A list of separate command line arguments to the program
- A string to pass on standard input to the forked process.

readCreateProcess Source #

Arguments

:: CreateProcess |
-> String | standard input
-> IO String | stdout

`readCreateProcess` works exactly like `readProcess` except that it lets you pass `CreateProcess` giving better flexibility.

     > readCreateProcess ((shell "pwd") { cwd = Just "/etc/" }) ""
     "/etc\n"

Note that `Handle`s provided for `std_in` or `std_out` via the CreateProcess record will be ignored.

Since: process-1.2.3.0

readProcessWithExitCode Source #

Arguments

:: FilePath | Filename of the executable (see `RawCommand` for details)
-> [String] | any arguments
-> String | standard input
-> IO (ExitCode, String, String) | exitcode, stdout, stderr

`readProcessWithExitCode` is like `readProcess` but with two differences:

- it returns the `ExitCode` of the process, and does not throw any exception if the code is not `ExitSuccess`.
- it reads and returns the output from process' standard error handle, rather than the process inheriting the standard error handle.

On Unix systems, see `waitForProcess` for the meaning of exit codes when the process died as the result of a signal.

readCreateProcessWithExitCode Source #

Arguments

:: CreateProcess |
-> String | standard input
-> IO (ExitCode, String, String) | exitcode, stdout, stderr

`readCreateProcessWithExitCode` works exactly like `readProcessWithExitCode` except that it lets you pass `CreateProcess` giving better flexibility.

Note that `Handle`s provided for `std_in`, `std_out`, or `std_err` via the CreateProcess record will be ignored.

Since: process-1.2.3.0

showCommandForUser :: FilePath -> [String] -> String Source #

Given a program `p` and arguments `args`, `showCommandForUser p args` returns a string suitable for pasting into `/bin/sh` (on Unix systems) or `CMD.EXE` (on Windows).

getPid :: ProcessHandle -> IO (Maybe Pid) Source #

Returns the PID (process ID) of a subprocess.

`Nothing` is returned if the handle was already closed. Otherwise a PID is returned that remains valid as long as the handle is open. The operating system may reuse the PID as soon as the last handle to the process is closed.

Since: process-1.6.3.0

getCurrentPid :: IO Pid Source #

Returns the PID (process ID) of the current process. On POSIX systems, this calls `getProcessID` from System.Posix.Process in the `unix` package. On Windows, this calls `getCurrentProcessId` from System.Win32.Process in the `Win32` package.

Since: process-1.6.12.0

getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode) Source #

This is a non-blocking version of `waitForProcess`. If the process is still running, `Nothing` is returned. If the process has exited, then ``Just` e` is returned where `e` is the exit code of the process.

On Unix systems, see `waitForProcess` for the meaning of exit codes when the process died as the result of a signal. May throw `UserInterrupt` when using `delegate_ctlc`.

terminateProcess :: ProcessHandle -> IO () Source #

Attempts to terminate the specified process. This function should not be used under normal circumstances - no guarantees are given regarding how cleanly the process is terminated. To check whether the process has indeed terminated, use `getProcessExitCode`.

On Unix systems, `terminateProcess` sends the process the SIGTERM signal. On Windows systems, if `use_process_jobs` is `True` then the Win32 `TerminateJobObject` function is called to kill all processes associated with the job and passing the exit code of 1 to each of them. Otherwise if `use_process_jobs` is `False` then the Win32 `TerminateProcess` function is called, passing an exit code of 1.

Note: on Windows, if the process was a shell command created by `createProcess` with `shell`, or created by `runCommand` or `runInteractiveCommand`, then `terminateProcess` will only terminate the shell, not the command itself. On Unix systems, both processes are in a process group and will be terminated together.

runCommand :: String -> IO ProcessHandle Source #

Runs a command using the shell.

runProcess Source #

Arguments

:: FilePath | Filename of the executable (see `RawCommand` for details)
-> [String] | Arguments to pass to the executable
-> Maybe FilePath | Optional path to the working directory
-> Maybe [(String, String)] | Optional environment (otherwise inherit)
-> Maybe Handle | Handle to use for `stdin` (Nothing => use existing `stdin`)
-> Maybe Handle | Handle to use for `stdout` (Nothing => use existing `stdout`)
-> Maybe Handle | Handle to use for `stderr` (Nothing => use existing `stderr`)
-> IO ProcessHandle |

Runs a raw command, optionally specifying `Handle`s from which to take the `stdin`, `stdout` and `stderr` channels for the new process (otherwise these handles are inherited from the current process).

Any `Handle`s passed to `runProcess` are placed immediately in the closed state.

Note: consider using the more general `createProcess` instead of `runProcess`.

runInteractiveCommand :: String -> IO (Handle, Handle, Handle, ProcessHandle) Source #

Runs a command using the shell, and returns `Handle`s that may be used to communicate with the process via its `stdin`, `stdout`, and `stderr` respectively.

runInteractiveProcess Source #

Arguments

:: FilePath | Filename of the executable (see `RawCommand` for details)
-> [String] | Arguments to pass to the executable
-> Maybe FilePath | Optional path to the working directory
-> Maybe [(String, String)] | Optional environment (otherwise inherit)
-> IO (Handle, Handle, Handle, ProcessHandle) |

Runs a raw command, and returns `Handle`s that may be used to communicate with the process via its `stdin`, `stdout` and `stderr` respectively.

For example, to start a process and feed a string to its stdin:

      (inp,out,err,pid) <- runInteractiveProcess "..."
      forkIO (hPutStr inp str)

rawSystem :: String -> [String] -> IO ExitCode Source #

The computation ``rawSystem` cmd args` runs the operating system command `cmd` in such a way that it receives as arguments the `args` strings exactly as given, with no funny escaping or shell meta-syntax expansion. It will therefore behave more portably between operating systems than `system`.

The return codes and possible failures are the same as for `system`.

pathSeparator :: Char Source #

The character that separates directories. In the case where more than one character is possible, `pathSeparator` is the 'ideal' one.

    Windows: pathSeparator == '\\'
    Posix:   pathSeparator ==  '/'
    isPathSeparator pathSeparator

pathSeparators :: [Char] Source #

The list of all possible separators.

    Windows: pathSeparators == ['\\', '/']
    Posix:   pathSeparators == ['/']
    pathSeparator `elem` pathSeparators

isPathSeparator :: Char -> Bool Source #

Rather than using `(== `pathSeparator`)`, use this. Test if something is a path separator.

    isPathSeparator a == (a `elem` pathSeparators)

isSearchPathSeparator :: Char -> Bool Source #

Is the character a file separator?

    isSearchPathSeparator a == (a == searchPathSeparator)

extSeparator :: Char Source #

File extension character

    extSeparator == '.'

isExtSeparator :: Char -> Bool Source #

Is the character an extension character?

    isExtSeparator a == (a == extSeparator)

splitSearchPath :: String -> [FilePath] Source #

Take a string, split it on the `searchPathSeparator` character. Blank items are ignored on Windows, and converted to `.` on Posix. On Windows path elements are stripped of quotes.

Follows the recommendations in http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

    Posix:   splitSearchPath "File1:File2:File3"  == ["File1","File2","File3"]
    Posix:   splitSearchPath "File1::File2:File3" == ["File1",".","File2","File3"]
    Windows: splitSearchPath "File1;File2;File3"  == ["File1","File2","File3"]
    Windows: splitSearchPath "File1;;File2;File3" == ["File1","File2","File3"]
    Windows: splitSearchPath "File1;\"File2\";File3" == ["File1","File2","File3"]

getSearchPath :: IO [FilePath] Source #

Get a list of `FilePath`s in the $PATH variable.

splitExtension :: FilePath -> (String, String) Source #

Split on the extension. `addExtension` is the inverse.

    splitExtension "/directory/path.ext" == ("/directory/path",".ext")
    uncurry (++) (splitExtension x) == x
    Valid x => uncurry addExtension (splitExtension x) == x
    splitExtension "file.txt" == ("file",".txt")
    splitExtension "file" == ("file","")
    splitExtension "file/file.txt" == ("file/file",".txt")
    splitExtension "file.txt/boris" == ("file.txt/boris","")
    splitExtension "file.txt/boris.ext" == ("file.txt/boris",".ext")
    splitExtension "file/path.txt.bob.fred" == ("file/path.txt.bob",".fred")
    splitExtension "file/path.txt/" == ("file/path.txt/","")

takeExtension :: FilePath -> String Source #

Get the extension of a file, returns `""` for no extension, `.ext` otherwise.

    takeExtension "/directory/path.ext" == ".ext"
    takeExtension x == snd (splitExtension x)
    Valid x => takeExtension (addExtension x "ext") == ".ext"
    Valid x => takeExtension (replaceExtension x "ext") == ".ext"

(-<.>) :: FilePath -> String -> FilePath infixr 7 Source #

Remove the current extension and add another, equivalent to `replaceExtension`.

    "/directory/path.txt" -<.> "ext" == "/directory/path.ext"
    "/directory/path.txt" -<.> ".ext" == "/directory/path.ext"
    "foo.o" -<.> "c" == "foo.c"

replaceExtension :: FilePath -> String -> FilePath Source #

Set the extension of a file, overwriting one if already present, equivalent to `-<.>`.

    replaceExtension "/directory/path.txt" "ext" == "/directory/path.ext"
    replaceExtension "/directory/path.txt" ".ext" == "/directory/path.ext"
    replaceExtension "file.txt" ".bob" == "file.bob"
    replaceExtension "file.txt" "bob" == "file.bob"
    replaceExtension "file" ".bob" == "file.bob"
    replaceExtension "file.txt" "" == "file"
    replaceExtension "file.fred.bob" "txt" == "file.fred.txt"
    replaceExtension x y == addExtension (dropExtension x) y

(<.>) :: FilePath -> String -> FilePath infixr 7 Source #

Add an extension, even if there is already one there, equivalent to `addExtension`.

    "/directory/path" <.> "ext" == "/directory/path.ext"
    "/directory/path" <.> ".ext" == "/directory/path.ext"

dropExtension :: FilePath -> FilePath Source #

Remove last extension, and the "." preceding it.

    dropExtension "/directory/path.ext" == "/directory/path"
    dropExtension x == fst (splitExtension x)

addExtension :: FilePath -> String -> FilePath Source #

Add an extension, even if there is already one there, equivalent to `<.>`.

    addExtension "/directory/path" "ext" == "/directory/path.ext"
    addExtension "file.txt" "bib" == "file.txt.bib"
    addExtension "file." ".bib" == "file..bib"
    addExtension "file" ".bib" == "file.bib"
    addExtension "/" "x" == "/.x"
    addExtension x "" == x
    Valid x => takeFileName (addExtension (addTrailingPathSeparator x) "ext") == ".ext"
    Windows: addExtension "\\\\share" ".txt" == "\\\\share\\.txt"

hasExtension :: FilePath -> Bool Source #

Does the given filename have an extension?

    hasExtension "/directory/path.ext" == True
    hasExtension "/directory/path" == False
    null (takeExtension x) == not (hasExtension x)

isExtensionOf :: String -> FilePath -> Bool Source #

Does the given filename have the specified extension?

    "png" `isExtensionOf` "/directory/file.png" == True
    ".png" `isExtensionOf` "/directory/file.png" == True
    ".tar.gz" `isExtensionOf` "bar/foo.tar.gz" == True
    "ar.gz" `isExtensionOf` "bar/foo.tar.gz" == False
    "png" `isExtensionOf` "/directory/file.png.jpg" == False
    "csv/table.csv" `isExtensionOf` "/data/csv/table.csv" == False

stripExtension :: String -> FilePath -> Maybe FilePath Source #

Drop the given extension from a FilePath, and the `"."` preceding it. Returns `Nothing` if the FilePath does not have the given extension, or `Just` and the part before the extension if it does.

This function can be more predictable than `dropExtensions`, especially if the filename might itself contain `.` characters.

    stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x"
    stripExtension "hi.o" "foo.x.hs.o" == Nothing
    dropExtension x == fromJust (stripExtension (takeExtension x) x)
    dropExtensions x == fromJust (stripExtension (takeExtensions x) x)
    stripExtension ".c.d" "a.b.c.d"  == Just "a.b"
    stripExtension ".c.d" "a.b..c.d" == Just "a.b."
    stripExtension "baz"  "foo.bar"  == Nothing
    stripExtension "bar"  "foobar"   == Nothing
    stripExtension ""     x          == Just x

splitExtensions :: FilePath -> (FilePath, String) Source #

Split on all extensions.

    splitExtensions "/directory/path.ext" == ("/directory/path",".ext")
    splitExtensions "file.tar.gz" == ("file",".tar.gz")
    uncurry (++) (splitExtensions x) == x
    Valid x => uncurry addExtension (splitExtensions x) == x
    splitExtensions "file.tar.gz" == ("file",".tar.gz")

dropExtensions :: FilePath -> FilePath Source #

Drop all extensions.

    dropExtensions "/directory/path.ext" == "/directory/path"
    dropExtensions "file.tar.gz" == "file"
    not $ hasExtension $ dropExtensions x
    not $ any isExtSeparator $ takeFileName $ dropExtensions x

takeExtensions :: FilePath -> String Source #

Get all extensions.

    takeExtensions "/directory/path.ext" == ".ext"
    takeExtensions "file.tar.gz" == ".tar.gz"

replaceExtensions :: FilePath -> String -> FilePath Source #

Replace all extensions of a file with a new extension. Note that `replaceExtension` and `addExtension` both work for adding multiple extensions, so only required when you need to drop all extensions first.

    replaceExtensions "file.fred.bob" "txt" == "file.txt"
    replaceExtensions "file.fred.bob" "tar.gz" == "file.tar.gz"

splitDrive :: FilePath -> (FilePath, FilePath) Source #

Split a path into a drive and a path. On Posix, / is a Drive.

    uncurry (++) (splitDrive x) == x
    Windows: splitDrive "file" == ("","file")
    Windows: splitDrive "c:/file" == ("c:/","file")
    Windows: splitDrive "c:\\file" == ("c:\\","file")
    Windows: splitDrive "\\\\shared\\test" == ("\\\\shared\\","test")
    Windows: splitDrive "\\\\shared" == ("\\\\shared","")
    Windows: splitDrive "\\\\?\\UNC\\shared\\file" == ("\\\\?\\UNC\\shared\\","file")
    Windows: splitDrive "\\\\?\\UNCshared\\file" == ("\\\\?\\","UNCshared\\file")
    Windows: splitDrive "\\\\?\\d:\\file" == ("\\\\?\\d:\\","file")
    Windows: splitDrive "/d" == ("","/d")
    Posix:   splitDrive "/test" == ("/","test")
    Posix:   splitDrive "//test" == ("//","test")
    Posix:   splitDrive "test/file" == ("","test/file")
    Posix:   splitDrive "file" == ("","file")

joinDrive :: FilePath -> FilePath -> FilePath Source #

Join a drive and the rest of the path.

    Valid x => uncurry joinDrive (splitDrive x) == x
    Windows: joinDrive "C:" "foo" == "C:foo"
    Windows: joinDrive "C:\\" "bar" == "C:\\bar"
    Windows: joinDrive "\\\\share" "foo" == "\\\\share\\foo"
    Windows: joinDrive "/:" "foo" == "/:\\foo"

takeDrive :: FilePath -> FilePath Source #

Get the drive from a filepath.

    takeDrive x == fst (splitDrive x)

dropDrive :: FilePath -> FilePath Source #

Delete the drive, if it exists.

    dropDrive x == snd (splitDrive x)

hasDrive :: FilePath -> Bool Source #

Does a path have a drive.

    not (hasDrive x) == null (takeDrive x)
    Posix:   hasDrive "/foo" == True
    Windows: hasDrive "C:\\foo" == True
    Windows: hasDrive "C:foo" == True
             hasDrive "foo" == False
             hasDrive "" == False

isDrive :: FilePath -> Bool Source #

Is an element a drive

    Posix:   isDrive "/" == True
    Posix:   isDrive "/foo" == False
    Windows: isDrive "C:\\" == True
    Windows: isDrive "C:\\foo" == False
             isDrive "" == False

splitFileName :: FilePath -> (String, String) Source #

Split a filename into directory and file. `</>` is the inverse. The first component will often end with a trailing slash.

    splitFileName "/directory/file.ext" == ("/directory/","file.ext")
    Valid x => uncurry (</>) (splitFileName x) == x || fst (splitFileName x) == "./"
    Valid x => isValid (fst (splitFileName x))
    splitFileName "file/bob.txt" == ("file/", "bob.txt")
    splitFileName "file/" == ("file/", "")
    splitFileName "bob" == ("./", "bob")
    Posix:   splitFileName "/" == ("/","")
    Windows: splitFileName "c:" == ("c:","")

replaceFileName :: FilePath -> String -> FilePath Source #

Set the filename.

    replaceFileName "/directory/other.txt" "file.ext" == "/directory/file.ext"
    Valid x => replaceFileName x (takeFileName x) == x

dropFileName :: FilePath -> FilePath Source #

Drop the filename. Unlike `takeDirectory`, this function will leave a trailing path separator on the directory.

    dropFileName "/directory/file.ext" == "/directory/"
    dropFileName x == fst (splitFileName x)

takeFileName :: FilePath -> FilePath Source #

Get the file name.

    takeFileName "/directory/file.ext" == "file.ext"
    takeFileName "test/" == ""
    takeFileName x `isSuffixOf` x
    takeFileName x == snd (splitFileName x)
    Valid x => takeFileName (replaceFileName x "fred") == "fred"
    Valid x => takeFileName (x </> "fred") == "fred"
    Valid x => isRelative (takeFileName x)

takeBaseName :: FilePath -> String Source #

Get the base name, without an extension or path.

    takeBaseName "/directory/file.ext" == "file"
    takeBaseName "file/test.txt" == "test"
    takeBaseName "dave.ext" == "dave"
    takeBaseName "" == ""
    takeBaseName "test" == "test"
    takeBaseName (addTrailingPathSeparator x) == ""
    takeBaseName "file/file.tar.gz" == "file.tar"

replaceBaseName :: FilePath -> String -> FilePath Source #

Set the base name.

    replaceBaseName "/directory/other.ext" "file" == "/directory/file.ext"
    replaceBaseName "file/test.txt" "bob" == "file/bob.txt"
    replaceBaseName "fred" "bill" == "bill"
    replaceBaseName "/dave/fred/bob.gz.tar" "new" == "/dave/fred/new.tar"
    Valid x => replaceBaseName x (takeBaseName x) == x

hasTrailingPathSeparator :: FilePath -> Bool Source #

Is an item either a directory or the last character a path separator?

    hasTrailingPathSeparator "test" == False
    hasTrailingPathSeparator "test/" == True

addTrailingPathSeparator :: FilePath -> FilePath Source #

Add a trailing file path separator if one is not already present.

    hasTrailingPathSeparator (addTrailingPathSeparator x)
    hasTrailingPathSeparator x ==> addTrailingPathSeparator x == x
    Posix:    addTrailingPathSeparator "test/rest" == "test/rest/"

takeDirectory :: FilePath -> FilePath Source #

Get the directory name, move up one level.

              takeDirectory "/directory/other.ext" == "/directory"
              takeDirectory x `isPrefixOf` x || takeDirectory x == "."
              takeDirectory "foo" == "."
              takeDirectory "/" == "/"
              takeDirectory "/foo" == "/"
              takeDirectory "/foo/bar/baz" == "/foo/bar"
              takeDirectory "/foo/bar/baz/" == "/foo/bar/baz"
              takeDirectory "foo/bar/baz" == "foo/bar"
    Windows:  takeDirectory "foo\\bar" == "foo"
    Windows:  takeDirectory "foo\\bar\\\\" == "foo\\bar"
    Windows:  takeDirectory "C:\\" == "C:\\"

replaceDirectory :: FilePath -> String -> FilePath Source #

Set the directory, keeping the filename the same.

    replaceDirectory "root/file.ext" "/directory/" == "/directory/file.ext"
    Valid x => replaceDirectory x (takeDirectory x) `equalFilePath` x

combine :: FilePath -> FilePath -> FilePath Source #

An alias for `</>`.

splitPath :: FilePath -> [FilePath] Source #

Split a path by the directory separator.

    splitPath "/directory/file.ext" == ["/","directory/","file.ext"]
    concat (splitPath x) == x
    splitPath "test//item/" == ["test//","item/"]
    splitPath "test/item/file" == ["test/","item/","file"]
    splitPath "" == []
    Windows: splitPath "c:\\test\\path" == ["c:\\","test\\","path"]
    Posix:   splitPath "/file/test" == ["/","file/","test"]

splitDirectories :: FilePath -> [FilePath] Source #

Just as `splitPath`, but don't add the trailing slashes to each element.

             splitDirectories "/directory/file.ext" == ["/","directory","file.ext"]
             splitDirectories "test/file" == ["test","file"]
             splitDirectories "/test/file" == ["/","test","file"]
    Windows: splitDirectories "C:\\test\\file" == ["C:\\", "test", "file"]
             Valid x => joinPath (splitDirectories x) `equalFilePath` x
             splitDirectories "" == []
    Windows: splitDirectories "C:\\test\\\\\\file" == ["C:\\", "test", "file"]
             splitDirectories "/test///file" == ["/","test","file"]

joinPath :: [FilePath] -> FilePath Source #

Join path elements back together.

    joinPath a == foldr (</>) "" a
    joinPath ["/","directory/","file.ext"] == "/directory/file.ext"
    Valid x => joinPath (splitPath x) == x
    joinPath [] == ""
    Posix: joinPath ["test","file","path"] == "test/file/path"

equalFilePath :: FilePath -> FilePath -> Bool Source #

Equality of two `FilePath`s. If you call `System.Directory.canonicalizePath` first this has a much better chance of working. Note that this doesn't follow symlinks or DOSNAM~1s.

Similar to `normalise`, this does not expand `".."`, because of symlinks.

             x == y ==> equalFilePath x y
             normalise x == normalise y ==> equalFilePath x y
             equalFilePath "foo" "foo/"
             not (equalFilePath "/a/../c" "/c")
             not (equalFilePath "foo" "/foo")
    Posix:   not (equalFilePath "foo" "FOO")
    Windows: equalFilePath "foo" "FOO"
    Windows: not (equalFilePath "C:" "C:/")

isValid :: FilePath -> Bool Source #

Is a FilePath valid, i.e. could you create a file like it? This function checks for invalid names, and invalid characters, but does not check if length limits are exceeded, as these are typically filesystem dependent.

             isValid "" == False
             isValid "\0" == False
    Posix:   isValid "/random_ path:*" == True
    Posix:   isValid x == not (null x)
    Windows: isValid "c:\\test" == True
    Windows: isValid "c:\\test:of_test" == False
    Windows: isValid "test*" == False
    Windows: isValid "c:\\test\\nul" == False
    Windows: isValid "c:\\test\\prn.txt" == False
    Windows: isValid "c:\\nul\\file" == False
    Windows: isValid "\\\\" == False
    Windows: isValid "\\\\\\foo" == False
    Windows: isValid "\\\\?\\D:file" == False
    Windows: isValid "foo\tbar" == False
    Windows: isValid "nul .txt" == False
    Windows: isValid " nul.txt" == True

makeValid :: FilePath -> FilePath Source #

Take a FilePath and make it valid; does not change already valid FilePaths.

    isValid (makeValid x)
    isValid x ==> makeValid x == x
    makeValid "" == "_"
    makeValid "file\0name" == "file_name"
    Windows: makeValid "c:\\already\\/valid" == "c:\\already\\/valid"
    Windows: makeValid "c:\\test:of_test" == "c:\\test_of_test"
    Windows: makeValid "test*" == "test_"
    Windows: makeValid "c:\\test\\nul" == "c:\\test\\nul_"
    Windows: makeValid "c:\\test\\prn.txt" == "c:\\test\\prn_.txt"
    Windows: makeValid "c:\\test/prn.txt" == "c:\\test/prn_.txt"
    Windows: makeValid "c:\\nul\\file" == "c:\\nul_\\file"
    Windows: makeValid "\\\\\\foo" == "\\\\drive"
    Windows: makeValid "\\\\?\\D:file" == "\\\\?\\D:\\file"
    Windows: makeValid "nul .txt" == "nul _.txt"

isRelative :: FilePath -> Bool Source #

Is a path relative, or is it fixed to the root?

    Windows: isRelative "path\\test" == True
    Windows: isRelative "c:\\test" == False
    Windows: isRelative "c:test" == True
    Windows: isRelative "c:\\" == False
    Windows: isRelative "c:/" == False
    Windows: isRelative "c:" == True
    Windows: isRelative "\\\\foo" == False
    Windows: isRelative "\\\\?\\foo" == False
    Windows: isRelative "\\\\?\\UNC\\foo" == False
    Windows: isRelative "/foo" == True
    Windows: isRelative "\\foo" == True
    Posix:   isRelative "test/path" == True
    Posix:   isRelative "/test" == False
    Posix:   isRelative "/" == False

According to [1]:

- "A UNC name of any format [is never relative]."
- "You cannot use the "\?" prefix with a relative path."

isAbsolute :: FilePath -> Bool Source #

    not . isRelative

    isAbsolute x == not (isRelative x)

takeWidth :: Int -> String -> String Source #

Double-width-character-aware string truncation. Take as many characters as possible from a string without exceeding the specified width. Eg takeWidth 3 "りんご" = "り".

charWidth :: Char -> Int #

mkPos :: Int -> Pos Source #

Construction of `Pos` from `Int`. The function throws `InvalidPosException` when given a non-positive argument.

Since: megaparsec-6.0.0

unPos :: Pos -> Int Source #

Extract `Int` from `Pos`.

Since: megaparsec-6.0.0

initialPos :: FilePath -> SourcePos Source #

Construct initial position (line 1, column 1) given name of source file.

sourcePosPretty :: SourcePos -> String Source #

Pretty-print a `SourcePos`.

Since: megaparsec-5.0.0

runExceptT :: ExceptT e m a -> m (Either e a) Source #

The inverse of `ExceptT`.

mkTimeout Source #

Arguments

:: Integer | microseconds
-> Timeout |

A shortcut for creating `Timeout` values

testGroup :: TestName -> [TestTree] -> TestTree Source #

Create a named group of test cases or other groups

after_ Source #

Arguments

:: DependencyType | whether to run the tests even if some of the dependencies fail
-> Expr | the pattern
-> TestTree | the subtree that depends on other tests
-> TestTree | the subtree annotated with dependency information

Like `after`, but accepts the pattern as a syntax tree instead of a string. Useful for generating a test tree programmatically.

#### Examples

Expand

Only match on the test's own name, ignoring the group names:

    after_ AllFinish (EQ (Field NF) (StringLit "Bar")) $

testCase`"A test that depends on Foo.Bar" $ ...`

Since: tasty-1.2

after Source #

Arguments

:: DependencyType | whether to run the tests even if some of the dependencies fail
-> String | the pattern
-> TestTree | the subtree that depends on other tests
-> TestTree | the subtree annotated with dependency information

The `after` combinator declares dependencies between tests.

If a `TestTree` is wrapped in `after`, the tests in this tree will not run until certain other tests («dependencies») have finished. These dependencies are specified using an AWK pattern (see the «Patterns» section in the README).

Moreover, if the `DependencyType` argument is set to `AllSucceed` and at least one dependency has failed, this test tree will not run at all.

Tasty does not check that the pattern matches any tests (let alone the correct set of tests), so it is on you to supply the right pattern.

#### Examples

Expand

The following test will be executed only after all tests that contain `Foo` anywhere in their path finish.

    after AllFinish "Foo" $

testCase`"A test that depends on Foo.Bar" $ ...`

Note, however, that our test also happens to contain `Foo` as part of its name, so it also matches the pattern and becomes a dependency of itself. This will result in a `DependencyLoop` exception. To avoid this, either change the test name so that it doesn't mention `Foo` or make the pattern more specific.

You can use AWK patterns, for instance, to specify the full path to the dependency.

    after AllFinish "$0 == \"Tests.Foo.Bar\"" $

testCase`"A test that depends on Foo.Bar" $ ...`

Or only specify the dependency's own name, ignoring the group names:

    after AllFinish "$NF == \"Bar\"" $

testCase`"A test that depends on Foo.Bar" $ ...`

Since: tasty-1.2

includingOptions :: [OptionDescription] -> Ingredient Source #

This ingredient doesn't do anything apart from registering additional options.

The option values can be accessed using `askOption`.

defaultMainWithIngredients :: [Ingredient] -> TestTree -> IO () Source #

Parse the command line arguments and run the tests using the provided ingredient list.

When the tests finish, this function calls `exitWith` with the exit code that indicates whether any tests have failed. See `defaultMain` for details.

defaultIngredients :: [Ingredient] Source #

List of the default ingredients. This is what `defaultMain` uses.

At the moment it consists of `listingTests` and `consoleTestReporter`.

adjustOption :: IsOption v => (v -> v) -> TestTree -> TestTree Source #

Locally adjust the option value for the given test subtree

localOption :: IsOption v => v -> TestTree -> TestTree Source #

Locally set the option value for the given test subtree

askOption :: IsOption v => (v -> TestTree) -> TestTree Source #

Customize the test tree based on the run-time options

withResource Source #

Arguments

:: IO a | initialize the resource
-> (a -> IO ()) | free the resource
-> (IO a -> TestTree) | ``IO` a` is an action which returns the acquired resource. Despite it being an `IO` action, the resource it returns will be acquired only once and shared across all the tests in the tree.
-> TestTree |

Acquire the resource to run this test (sub)tree and release it afterwards

toRegex :: Text -> Either RegexError Regexp Source #

toRegexCI :: Text -> Either RegexError Regexp Source #

toRegex' :: Text -> Regexp Source #

toRegexCI' :: Text -> Regexp Source #

regexMatch :: Regexp -> String -> Bool Source #

Test whether a Regexp matches a String. This is an alias for `matchTest` for consistent naming.

regexMatchText :: Regexp -> Text -> Bool Source #

Tests whether a Regexp matches a Text.

This currently unpacks the Text to a String an works on that. This is due to a performance bug in regex-tdfa (#9), which may or may not be relevant here.

regexReplace :: Regexp -> Replacement -> String -> Either RegexError String Source #

A memoising version of regexReplace. Caches the result for each search pattern, replacement pattern, target string tuple. This won't generate a regular expression parsing error since that is pre-compiled nowadays, but there can still be a runtime error from the replacement pattern, eg with a backreference referring to a nonexistent match group.

regexReplaceUnmemo :: Regexp -> Replacement -> String -> Either RegexError String Source #

regexReplaceAllBy :: Regexp -> (String -> String) -> String -> String Source #

fromEFDay :: EFDay -> Day Source #

modifyEFDay :: (Day -> Day) -> EFDay -> EFDay Source #

isBalanceSheetAccountType :: AccountType -> Bool Source #

isIncomeStatementAccountType :: AccountType -> Bool Source #

isAccountSubtypeOf :: AccountType -> AccountType -> Bool Source #

Check whether the first argument is a subtype of the second: either equal or one of the defined subtypes.

isDecimalMark :: Char -> Bool Source #

maCompare :: MixedAmount -> MixedAmount -> Ordering Source #

Compare two MixedAmounts, substituting 0 for the quantity of any missing commodities in either.

nulltransactionmodifier :: TransactionModifier Source #

nullperiodictransaction :: PeriodicTransaction Source #

nullpayeedeclarationinfo :: PayeeDeclarationInfo Source #

nulltagdeclarationinfo :: TagDeclarationInfo Source #

nullaccountdeclarationinfo :: AccountDeclarationInfo Source #

periodAsDateSpan :: Period -> DateSpan Source #

Convert Periods to exact DateSpans.

    >>> periodAsDateSpan (MonthPeriod 2000 1) == DateSpan (Just $ Flex $ fromGregorian 2000 1 1) (Just $ Flex $ fromGregorian 2000 2 1)
    True

dateSpanAsPeriod :: DateSpan -> Period Source #

Convert DateSpans to Periods.

    >>> dateSpanAsPeriod $ DateSpan (Just $ Exact $ fromGregorian 2000 1 1) (Just $ Exact $ fromGregorian 2000 2 1)
    MonthPeriod 2000 1

simplifyPeriod :: Period -> Period Source #

Convert PeriodBetweens to a more abstract period where possible.

    >>> simplifyPeriod $ PeriodBetween (fromGregorian 1 1 1) (fromGregorian 2 1 1)
    YearPeriod 1
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2000 10 1) (fromGregorian 2001 1 1)
    QuarterPeriod 2000 4
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2000 2 1) (fromGregorian 2000 3 1)
    MonthPeriod 2000 2
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2016 7 25) (fromGregorian 2016 8 1)
    WeekPeriod 2016-07-25
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2000 1 1) (fromGregorian 2000 1 2)
    DayPeriod 2000-01-01
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2000 2 28) (fromGregorian 2000 3 1)
    PeriodBetween 2000-02-28 2000-03-01
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2000 2 29) (fromGregorian 2000 3 1)
    DayPeriod 2000-02-29
    >>> simplifyPeriod $ PeriodBetween (fromGregorian 2000 12 31) (fromGregorian 2001 1 1)
    DayPeriod 2000-12-31

isLastDayOfMonth :: (Eq a1, Eq a2, Num a1, Num a2) => Year -> a1 -> a2 -> Bool Source #

isStandardPeriod :: Period -> Bool Source #

Is this period a "standard" period, referencing a particular day, week, month, quarter, or year ? Periods of other durations, or infinite duration, or not starting on a standard period boundary, are not.

periodTextWidth :: Period -> Int Source #

The width of a period of this type when displayed.

showPeriod :: Period -> Text Source #

Render a period as a compact display string suitable for user output.

    >>> showPeriod (WeekPeriod (fromGregorian 2016 7 25))
    "2016-07-25W30"

showPeriodMonthAbbrev :: Period -> Text Source #

Like showPeriod, but if it's a month period show just the 3 letter month name abbreviation for the current locale.

periodStart :: Period -> Maybe Day Source #

periodEnd :: Period -> Maybe Day Source #

periodNext :: Period -> Period Source #

Move a standard period to the following period of same duration. Non-standard periods are unaffected.

periodPrevious :: Period -> Period Source #

Move a standard period to the preceding period of same duration. Non-standard periods are unaffected.

periodNextIn :: DateSpan -> Period -> Period Source #

Move a standard period to the following period of same duration, staying within enclosing dates. Non-standard periods are unaffected.

periodPreviousIn :: DateSpan -> Period -> Period Source #

Move a standard period to the preceding period of same duration, staying within enclosing dates. Non-standard periods are unaffected.

periodMoveTo :: Day -> Period -> Period Source #

Move a standard period stepwise so that it encloses the given date. Non-standard periods are unaffected.

periodGrow :: Period -> Period Source #

Enlarge a standard period to the next larger enclosing standard period, if there is one. Eg, a day becomes the enclosing week. A week becomes whichever month the week's thursday falls into. A year becomes all (unlimited). Non-standard periods (arbitrary dates, or open-ended) are unaffected.

periodShrink :: Day -> Period -> Period Source #

Shrink a period to the next smaller standard period inside it, choosing the subperiod which contains today's date if possible, otherwise the first subperiod. It goes like this: unbounded periods and nonstandard periods (between two arbitrary dates) -> current year -> current quarter if it's in selected year, otherwise first quarter of selected year -> current month if it's in selected quarter, otherwise first month of selected quarter -> current week if it's in selected month, otherwise first week of selected month -> today if it's in selected week, otherwise first day of selected week, unless that's in previous month, in which case first day of month containing selected week. Shrinking a day has no effect.

mondayBefore :: Day -> Day Source #

yearMonthContainingWeekStarting :: Day -> (Year, MonthOfYear) Source #

quarterContainingMonth :: Integral a => a -> a Source #

firstMonthOfQuarter :: Num a => a -> a Source #

startOfFirstWeekInMonth :: Integer -> Int -> Day Source #

customErrorBundlePretty :: HledgerParseErrors -> String Source #

Pretty-print our custom parse errors. It is necessary to use this instead of `errorBundlePretty` when custom parse errors are thrown.

This function intercepts our custom parse errors and applies final adjustments (`finalizeCustomError`) before passing them to `errorBundlePretty`. These adjustments are part of the implementation of the behaviour of our custom parse errors.

Note: We must ensure that the offset of the `PosState` of the provided `ParseErrorBundle` is no larger than the offset specified by a `ErrorFailAt` constructor. This is guaranteed if this offset is set to 0 (that is, the beginning of the source file), which is the case for `ParseErrorBundle`s returned from `runParserT`.

wbToText :: WideBuilder -> Text Source #

Convert a WideBuilder to a strict Text.

wbFromText :: Text -> WideBuilder Source #

Convert a strict Text to a WideBuilder.

wbUnpack :: WideBuilder -> String Source #

Convert a WideBuilder to a String.

textElideRight :: Int -> Text -> Text Source #

textChomp :: Text -> Text Source #

Remove trailing newlines/carriage returns.

formatText :: Bool -> Maybe Int -> Maybe Int -> Text -> Text Source #

Clip and pad a string to a minimum & maximum width, andor leftright justify it. Works on multi-line strings too (but will rewrite non-unix line endings).

quoteIfSpaced :: Text -> Text Source #

Wrap a string in double quotes, and -prefix any embedded single quotes, if it contains whitespace and is not already single- or double-quoted.

textQuoteIfNeeded :: Text -> Text Source #

escapeDoubleQuotes :: Text -> Text Source #

stripquotes :: Text -> Text Source #

Strip one matching pair of single or double quotes on the ends of a string.

textUnbracket :: Text -> Text Source #

Remove all matching pairs of square brackets and parentheses from the text.

textConcatTopPadded :: [Text] -> Text Source #

Join several multi-line strings as side-by-side rectangular strings of the same height, top-padded. Treats wide characters as double width.

textConcatBottomPadded :: [Text] -> Text Source #

Join several multi-line strings as side-by-side rectangular strings of the same height, bottom-padded. Treats wide characters as double width.

fitText :: Maybe Int -> Maybe Int -> Bool -> Bool -> Text -> Text Source #

General-purpose wide-char-aware single-line text layout function. It can left- or right-pad a short string to a minimum width. It can left- or right-clip a long string to a maximum width, optionally inserting an ellipsis (the third argument). It clips and pads on the right when the fourth argument is true, otherwise on the left. It treats wide characters as double width.

textTakeWidth :: Int -> Text -> Text Source #

Double-width-character-aware string truncation. Take as many characters as possible from a string without exceeding the specified width. Eg textTakeWidth 3 "りんご" = "り".

linesPrepend :: Text -> Text -> Text Source #

Add a prefix to each line of a string.

linesPrepend2 :: Text -> Text -> Text -> Text Source #

Add a prefix to the first line of a string, and a different prefix to the remaining lines.

unlinesB :: [Builder] -> Builder Source #

Join a list of Text Builders with a newline after each item.

readDecimal :: Text -> Integer Source #

Read a decimal number from a Text. Assumes the input consists only of digit characters.

tests_Text :: TestTree Source #

pshow :: Show a => a -> String Source #

Pretty show. An easier alias for pretty-simple's pShow. This will probably show in colour if useColorOnStderr is true.

pshow' :: Show a => a -> String Source #

Monochrome version of pshow. This will never show in colour.

pprint :: Show a => a -> IO () Source #

Pretty print a showable value. An easier alias for pretty-simple's pPrint. This will print in colour if useColorOnStderr is true.

pprint' :: Show a => a -> IO () Source #

Monochrome version of pprint. This will never print in colour.

getTerminalHeightWidth :: IO (Maybe (Int, Int)) Source #

An alternative to ansi-terminal's getTerminalSize, based on the more robust-looking terminal-size package. Tries to get stdout's terminal's current height and width.

getTerminalHeight :: IO (Maybe Int) Source #

getTerminalWidth :: IO (Maybe Int) Source #

setupPager :: IO () Source #

Make sure our $LESS and $MORE environment variables contain R, to help ensure the common pager `less` will show our ANSI output properly. less uses $LESS by default, and $MORE when it is invoked as `more`. What the original `more` program does, I'm not sure. If $PAGER is configured to something else, this probably will have no effect.

progArgs :: [String] Source #

The command line arguments that were used at program startup. Uses unsafePerformIO.

outputFileOption :: Maybe String Source #

Read the value of the -o/--output-file command line option provided at program startup, if any, using unsafePerformIO.

hasOutputFile :: Bool Source #

Check whether the -o/--output-file option has been used at program startup with an argument other than "-", using unsafePerformIO.

bold' :: String -> String Source #

Versions of some of text-ansi's string colors/styles which are more careful to not print junk onscreen. These use our useColorOnStdout.

faint' :: String -> String Source #

black' :: String -> String Source #

red' :: String -> String Source #

green' :: String -> String Source #

yellow' :: String -> String Source #

blue' :: String -> String Source #

magenta' :: String -> String Source #

cyan' :: String -> String Source #

white' :: String -> String Source #

brightBlack' :: String -> String Source #

brightRed' :: String -> String Source #

brightGreen' :: String -> String Source #

brightYellow' :: String -> String Source #

brightBlue' :: String -> String Source #

brightMagenta' :: String -> String Source #

brightCyan' :: String -> String Source #

brightWhite' :: String -> String Source #

rgb' :: Word8 -> Word8 -> Word8 -> String -> String Source #

colorOption :: String Source #

Read the value of the --color or --colour command line option provided at program startup using unsafePerformIO. If this option was not provided, returns the empty string.

useColorOnStdout :: Bool Source #

Check the IO environment to see if ANSI colour codes should be used on stdout. This is done using unsafePerformIO so it can be used anywhere, eg in low-level debug utilities, which should be ok since we are just reading. The logic is: use color if the program was started with --color=yes|always or ( the program was not started with --color=no|never and a NO_COLOR environment variable is not defined and stdout supports ANSI color and -o/--output-file was not used, or its value is "-" ).

useColorOnStderr :: Bool Source #

Like useColorOnStdout, but checks for ANSI color support on stderr, and is not affected by -o/--output-file.

color :: ColorIntensity -> Color -> String -> String Source #

Wrap a string in ANSI codes to set and reset foreground colour. ColorIntensity is `Dull` or `Vivid` (ie normal and bold). Color is one of `Black`, `Red`, `Green`, `Yellow`, `Blue`, `Magenta`, `Cyan`, `White`. Eg: `color Dull Red "text"`.

bgColor :: ColorIntensity -> Color -> String -> String Source #

Wrap a string in ANSI codes to set and reset background colour.

colorB :: ColorIntensity -> Color -> WideBuilder -> WideBuilder Source #

Wrap a WideBuilder in ANSI codes to set and reset foreground colour.

bgColorB :: ColorIntensity -> Color -> WideBuilder -> WideBuilder Source #

Wrap a WideBuilder in ANSI codes to set and reset background colour.

terminalIsLight :: Maybe Bool Source #

Detect whether the terminal currently has a light background colour, if possible, using unsafePerformIO. If the terminal is transparent, its apparent light/darkness may be different.

terminalLightness :: Maybe Float Source #

Detect the terminal's current background lightness (0..1), if possible, using unsafePerformIO. If the terminal is transparent, its apparent lightness may be different.

terminalBgColor :: Maybe (RGB Float) Source #

Detect the terminal's current background colour, if possible, using unsafePerformIO.

terminalFgColor :: Maybe (RGB Float) Source #

Detect the terminal's current foreground colour, if possible, using unsafePerformIO.

error' :: String -> a Source #

Simpler alias for errorWithoutStackTrace

usageError :: String -> a Source #

A version of errorWithoutStackTrace that adds a usage hint.

expandHomePath :: FilePath -> IO FilePath Source #

Expand a tilde (representing home directory) at the start of a file path. ~username is not supported. Can raise an error.

expandPath :: FilePath -> FilePath -> IO FilePath Source #

Given a current directory, convert a possibly relative, possibly tilde-containing file path to an absolute one. ~username is not supported. Leaves "-" unchanged. Can raise an error.

expandGlob :: FilePath -> FilePath -> IO [FilePath] Source #

Like expandPath, but treats the expanded path as a glob, and returns zero or more matched absolute file paths, alphabetically sorted.

sortByModTime :: [FilePath] -> IO [FilePath] Source #

Given a list of existing file paths, sort them by modification time, most recent first.

readFilePortably :: FilePath -> IO Text Source #

Read text from a file, converting any rn line endings to n,, using the system locale's text encoding, ignoring any utf8 BOM prefix (as seen in paypal's 2018 CSV, eg) if that encoding is utf8.

readFileOrStdinPortably :: String -> IO Text Source #

Like readFilePortably, but read from standard input if the path is "-".

readHandlePortably :: Handle -> IO Text Source #

embedFileRelative :: FilePath -> Q Exp Source #

Like embedFile, but takes a path relative to the package directory.

getCurrentLocalTime :: IO LocalTime Source #

getCurrentZonedTime :: IO ZonedTime Source #

assertLeft :: (HasCallStack, Eq b, Show b) => Either a b -> Assertion Source #

Assert any Left value.

assertRight :: (HasCallStack, Eq a, Show a) => Either a b -> Assertion Source #

Assert any Right value.

assertParse :: (HasCallStack, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> Assertion Source #

Assert that this stateful parser runnable in IO successfully parses all of the given input text, showing the parse error if it fails. Suitable for hledger's JournalParser parsers.

assertParseEq :: (HasCallStack, Eq a, Show a, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> a -> Assertion Source #

Assert a parser produces an expected value.

assertParseEqOn :: (HasCallStack, Eq b, Show b, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> (a -> b) -> b -> Assertion Source #

Like assertParseEq, but transform the parse result with the given function before comparing it.

assertParseError :: (HasCallStack, Eq a, Show a, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> String -> Assertion Source #

Assert that this stateful parser runnable in IO fails to parse the given input text, with a parse error containing the given string.

assertParseStateOn :: (HasCallStack, Eq b, Show b, Default st) => StateT st (ParsecT HledgerParseErrorData Text IO) a -> Text -> (st -> b) -> b -> Assertion Source #

Run a stateful parser in IO like assertParse, then assert that the final state (the wrapped state, not megaparsec's internal state), transformed by the given function, matches the given expected value.

assertParseE :: (HasCallStack, Eq a, Show a, Default st) => StateT st (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError IO)) a -> Text -> Assertion Source #

assertParseEqE :: (Default st, Eq a, Show a, HasCallStack) => StateT st (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError IO)) a -> Text -> a -> Assertion Source #

assertParseErrorE :: (Default st, Eq a, Show a, HasCallStack) => StateT st (ParsecT HledgerParseErrorData Text (ExceptT FinalParseError IO)) a -> Text -> String -> Assertion Source #

debugLevel :: Int Source #

The programs debug output verbosity. The default is 0 meaning no debug output. The `--debug` command line flag sets it to 1, or `--debug=N` sets it to a higher value (the = is required). Uses unsafePerformIO. When running in GHCI, changing this requires reloading this module.

traceWith :: (a -> String) -> a -> a Source #

Trace a value with the given show function before returning it.

ptrace :: Show a => a -> a Source #

Pretty-trace a showable value before returning it. Like Debug.Trace.traceShowId, but pretty-printing and easier to type.

traceAt :: Int -> String -> a -> a Source #

Trace (print to stderr) a string if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.

traceAtWith :: Int -> (a -> String) -> a -> a Source #

Trace (print to stderr) a showable value using a custom show function, if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.

ptraceAt :: Show a => Int -> String -> a -> a Source #

Pretty-print a label and a showable value to the console if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.

ptraceAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m () Source #

Like ptraceAt, but convenient to insert in an IO monad and enforces monadic sequencing.

traceLog :: String -> a -> a Source #

Log a string to the debug log before returning the second argument. Uses unsafePerformIO.

traceLogAt :: Int -> String -> a -> a Source #

Log a string to the debug log before returning the second argument, if the global debug level is at or above the specified level. At level 0, always logs. Otherwise, uses unsafePerformIO.

traceLogIO :: MonadIO m => String -> m () Source #

Like traceLog but sequences properly in IO.

traceLogAtIO :: MonadIO m => Int -> String -> m () Source #

Like traceLogAt, but convenient to use in IO.

traceLogWith :: (a -> String) -> a -> a Source #

Log a value to the debug log with the given show function before returning it.

traceLogAtWith :: Int -> (a -> String) -> a -> a Source #

Log a string to the debug log before returning the second argument, if the global debug level is at or above the specified level. At level 0, always logs. Otherwise, uses unsafePerformIO.

ptraceLogAt :: Show a => Int -> String -> a -> a Source #

Pretty-log a label and showable value to the debug log, if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.

ptraceLogAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m () Source #

Like ptraceAt, but convenient to insert in an IO monad and enforces monadic sequencing.

traceOrLog :: String -> a -> a Source #

traceOrLogAt :: Int -> String -> a -> a Source #

ptraceOrLogAt :: Show a => Int -> String -> a -> a Source #

ptraceOrLogAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m () Source #

traceOrLogAtWith :: Int -> (a -> String) -> a -> a Source #

dbg0 :: Show a => String -> a -> a Source #

Pretty-trace to stderr (or log to debug log) a label and showable value, then return it.

dbg1 :: Show a => String -> a -> a Source #

Pretty-trace to stderr (or log to debug log) a label and showable value if the --debug level is high enough, then return the value. Uses unsafePerformIO.

dbg2 :: Show a => String -> a -> a Source #

dbg3 :: Show a => String -> a -> a Source #

dbg4 :: Show a => String -> a -> a Source #

dbg5 :: Show a => String -> a -> a Source #

dbg6 :: Show a => String -> a -> a Source #

dbg7 :: Show a => String -> a -> a Source #

dbg8 :: Show a => String -> a -> a Source #

dbg9 :: Show a => String -> a -> a Source #

dbgExit :: Show a => String -> a -> a Source #

Like dbg0, but also exit the program. Uses unsafePerformIO.

dbg0IO :: (MonadIO m, Show a) => String -> a -> m () Source #

Like dbgN, but convenient to use in IO.

dbg1IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg2IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg3IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg4IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg5IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg6IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg7IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg8IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg9IO :: (MonadIO m, Show a) => String -> a -> m () Source #

dbg0With :: (a -> String) -> a -> a Source #

Like dbgN, but taking a show function instead of a label.

dbg1With :: Show a => (a -> String) -> a -> a Source #

dbg2With :: Show a => (a -> String) -> a -> a Source #

dbg3With :: Show a => (a -> String) -> a -> a Source #

dbg4With :: Show a => (a -> String) -> a -> a Source #

dbg5With :: Show a => (a -> String) -> a -> a Source #

dbg6With :: Show a => (a -> String) -> a -> a Source #

dbg7With :: Show a => (a -> String) -> a -> a Source #

dbg8With :: Show a => (a -> String) -> a -> a Source #

dbg9With :: Show a => (a -> String) -> a -> a Source #

traceOrLogParse :: forall (m :: Type -> Type). String -> TextParser m () Source #

Trace to stderr or log to debug log the provided label (if non-null) and current parser state (position and next input). See also: Hledger.Utils.Debug, megaparsec's dbg. Uses unsafePerformIO.

dbgparse :: forall (m :: Type -> Type). Int -> String -> TextParser m () Source #

Trace to stderr or log to debug log the provided label (if non-null) and current parser state (position and next input), if the global debug level is at or above the specified level. Uses unsafePerformIO.

sourcePosPairPretty :: (SourcePos, SourcePos) -> String Source #

Render a pair of source positions in human-readable form, only displaying the range of lines.

choice' :: forall (m :: Type -> Type) a. [TextParser m a] -> TextParser m a Source #

Backtracking choice, use this when alternatives share a prefix. Consumes no input if all choices fail.

choiceInState :: forall s (m :: Type -> Type) a. [StateT s (ParsecT HledgerParseErrorData Text m) a] -> StateT s (ParsecT HledgerParseErrorData Text m) a Source #

Backtracking choice, use this when alternatives share a prefix. Consumes no input if all choices fail.

surroundedBy :: Applicative m => m openclose -> m a -> m a Source #

parsewith :: Parsec e Text a -> Text -> Either (ParseErrorBundle Text e) a Source #

runTextParser :: TextParser Identity a -> Text -> Either HledgerParseErrors a Source #

Run a text parser in the identity monad. See also: parseWithState.

rtp :: TextParser Identity a -> Text -> Either HledgerParseErrors a Source #

Run a text parser in the identity monad. See also: parseWithState.

parsewithString :: Parsec e String a -> String -> Either (ParseErrorBundle String e) a Source #

parseWithState :: Monad m => st -> StateT st (ParsecT HledgerParseErrorData Text m) a -> Text -> m (Either HledgerParseErrors a) Source #

Run a stateful parser with some initial state on a text. See also: runTextParser, runJournalParser.

parseWithState' :: Stream s => st -> StateT st (ParsecT e s Identity) a -> s -> Either (ParseErrorBundle s e) a Source #

fromparse :: (Show t, Show (Token t), Show e) => Either (ParseErrorBundle t e) a -> a Source #

parseerror :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> a Source #

showDateParseError :: (Show t, Show (Token t), Show e) => ParseErrorBundle t e -> String Source #

isNewline :: Char -> Bool Source #

nonspace :: forall (m :: Type -> Type). TextParser m Char Source #

isNonNewlineSpace :: Char -> Bool Source #

spacenonewline :: forall s (m :: Type -> Type). (Stream s, Char ~ Token s) => ParsecT HledgerParseErrorData s m Char Source #

restofline :: forall (m :: Type -> Type). TextParser m String Source #

skipNonNewlineSpaces :: forall s (m :: Type -> Type). (Stream s, Token s ~ Char) => ParsecT HledgerParseErrorData s m () Source #

skipNonNewlineSpaces1 :: forall s (m :: Type -> Type). (Stream s, Token s ~ Char) => ParsecT HledgerParseErrorData s m () Source #

skipNonNewlineSpaces' :: forall s (m :: Type -> Type). (Stream s, Token s ~ Char) => ParsecT HledgerParseErrorData s m Bool Source #

eolof :: forall (m :: Type -> Type). TextParser m () Source #

lowercase :: String -> String Source #

uppercase :: String -> String Source #

lstrip :: String -> String Source #

Remove leading whitespace.

rstrip :: String -> String Source #

Remove trailing whitespace.

strip1Char :: Char -> Char -> String -> String Source #

Strip the given starting and ending character from the start and end of a string if both are present.

stripBy :: (Char -> Bool) -> String -> String Source #

Strip a run of zero or more characters matching the predicate from the start and end of a string.

strip1By :: (Char -> Bool) -> String -> String Source #

Strip a single balanced enclosing pair of a character matching the predicate from the start and end of a string.

chomp :: String -> String Source #

Remove all trailing newlines/carriage returns.

chomp1 :: String -> String Source #

Remove all trailing newline/carriage returns, leaving just one trailing newline.

singleline :: String -> String Source #

Remove consecutive line breaks, replacing them with single space

stripbrackets :: String -> String Source #

elideLeft :: Int -> String -> String Source #

elideRight :: Int -> String -> String Source #

underline :: String -> String Source #

quoteIfNeeded :: String -> String Source #

Double-quote this string if it contains whitespace, single quotes or double-quotes, escaping the quotes as needed.

singleQuoteIfNeeded :: String -> String Source #

Single-quote this string if it contains whitespace or double-quotes. Does not work for strings containing single quotes.

quoteForCommandLine :: String -> String Source #

Try to single- and backslash-quote a string as needed to make it usable as an argument on a (sh/bash) shell command line. At least, well enough to handle common currency symbols, like $. Probably broken in many ways.

    >>> quoteForCommandLine "a"
    "a"
    >>> quoteForCommandLine "\""
    "'\"'"
    >>> quoteForCommandLine "$"
    "'\\$'"

words' :: String -> [String] Source #

Quote-aware version of words - don't split on spaces which are inside quotes. NB correctly handles "a'b" but not "'`a'`". Can raise an error if parsing fails.

unwords' :: [String] -> String Source #

Quote-aware version of unwords - single-quote strings which contain whitespace

strWidthAnsi :: String -> Int Source #

Like strWidth, but also strips ANSI escape sequences before calculating the width.

This is no longer used in code, as widths are calculated before adding ANSI escape sequences, but is being kept around for now.

strWidth :: String -> Int Source #

Alias for `realLength`.

stripAnsi :: String -> String Source #

Strip ANSI escape sequences from a string.

    >>> stripAnsi "\ESC[31m-1\ESC[m"
    "-1"

applyN :: Int -> (a -> a) -> a -> a Source #

Apply a function the specified number of times, which should be > 0 (otherwise does nothing). Possibly uses O(n) stack ?

mapM' :: Monad f => (a -> f b) -> [a] -> f [b] Source #

Like mapM but uses sequence'.

sequence' :: Monad f => [f a] -> f [a] Source #

This is a version of sequence based on difference lists. It is slightly faster but we mostly use it because it uses the heap instead of the stack. This has the advantage that Neil Mitchell’s trick of limiting the stack size to discover space leaks doesn’t show this as a false positive.

curry2 :: ((a, b) -> c) -> a -> b -> c Source #

uncurry2 :: (a -> b -> c) -> (a, b) -> c Source #

curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e Source #

uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e Source #

maximum' :: Integral a => [a] -> a Source #

Total version of maximum, for integral types, giving 0 for an empty list.

maximumStrict :: Ord a => [a] -> a Source #

Strict version of maximum that doesn’t leak space

minimumStrict :: Ord a => [a] -> a Source #

Strict version of minimum that doesn’t leak space

splitAtElement :: Eq a => a -> [a] -> [[a]] Source #

sumStrict :: Num a => [a] -> a Source #

Strict version of sum that doesn’t leak space

treeLeaves :: Tree a -> [a] Source #

Get the leaves of this tree as a list. The topmost node ("root" in hledger account trees) is not counted as a leaf.

first4 :: (a, b, c, d) -> a Source #

second4 :: (a, b, c, d) -> b Source #

third4 :: (a, b, c, d) -> c Source #

fourth4 :: (a, b, c, d) -> d Source #

first5 :: (a, b, c, d, e) -> a Source #

second5 :: (a, b, c, d, e) -> b Source #

third5 :: (a, b, c, d, e) -> c Source #

fourth5 :: (a, b, c, d, e) -> d Source #

fifth5 :: (a, b, c, d, e) -> e Source #

first6 :: (a, b, c, d, e, f) -> a Source #

second6 :: (a, b, c, d, e, f) -> b Source #

third6 :: (a, b, c, d, e, f) -> c Source #

fourth6 :: (a, b, c, d, e, f) -> d Source #

fifth6 :: (a, b, c, d, e, f) -> e Source #

sixth6 :: (a, b, c, d, e, f) -> f Source #

multicol :: Int -> [String] -> String Source #

Convert a list of strings to a multi-line multi-column list fitting within the given width. Not wide character aware.

numDigitsInt :: Integral a => Int -> a Source #

Find the number of digits of an `Int`.

makeHledgerClassyLenses :: Name -> DecsQ Source #

Make classy lenses for Hledger options fields. This is intended to be used with BalancingOpts, InputOpt, ReportOpts, ReportSpec, and CliOpts. When run on X, it will create a typeclass named HasX (except for ReportOpts, which will be named HasReportOptsNoUpdate) containing all the lenses for that type. If the field name starts with an underscore, the lens name will be created by stripping the underscore from the front on the name. If the field name ends with an underscore, the field name ends with an underscore, the lens name will be mostly created by stripping the underscore, but a few names for which this would create too many conflicts instead have a second underscore appended. ReportOpts fields for which updating them requires updating the query in ReportSpec are instead names by dropping the trailing underscore and appending NoUpdate to the name, e.g. querystring_ -> querystringNoUpdate.

There are a few reasons for the complicated rules. - We have some legacy field names ending in an underscore (e.g. value_) which we want to temporarily accommodate, before eventually switching to a more modern style (e.g. _rsReportOpts) - Certain fields in ReportOpts need to update the enclosing ReportSpec when they are updated, and it is a common programming error to forget to do this. We append NoUpdate to those lenses which will not update the enclosing field, and reserve the shorter name for manually define lenses (or at least something lens-like) which will update the ReportSpec. cf. the lengthy discussion here and in surrounding comments: https://github.com/simonmichael/hledger/pull/1545#issuecomment-881974554

tests_Utils :: TestTree Source #

overRawOpts :: ([(String, String)] -> [(String, String)]) -> RawOpts -> RawOpts Source #

setopt :: String -> String -> RawOpts -> RawOpts Source #

setboolopt :: String -> RawOpts -> RawOpts Source #

unsetboolopt :: String -> RawOpts -> RawOpts Source #

appendopts :: [(String, String)] -> RawOpts -> RawOpts Source #

boolopt :: String -> RawOpts -> Bool Source #

Is the named flag present ?

toggleopt :: String -> RawOpts -> Bool Source #

Like boolopt, except if the flag is repeated on the command line it toggles the value. An even number of repetitions is equivalent to none.

choiceopt Source #

Arguments

:: (String -> Maybe a) | "parser" that returns `Just` value for valid choice
-> RawOpts | actual options where to look for flag
-> Maybe a | exclusive choice among those returned as `Just` from "parser"

From a list of RawOpts, get the last one (ie the right-most on the command line) for which the given predicate returns a Just value. Useful for exclusive choice flags like --daily|--weekly|--quarterly...

    >>> import Safe (readMay)
    >>> choiceopt Just (RawOpts [("a",""), ("b",""), ("c","")])
    Just "c"
    >>> choiceopt (const Nothing) (RawOpts [("a","")])
    Nothing
    >>> choiceopt readMay (RawOpts [("LT",""),("EQ",""),("Neither","")]) :: Maybe Ordering
    Just EQ

collectopts :: ((String, String) -> Maybe a) -> RawOpts -> [a] Source #

Collects processed and filtered list of options preserving their order

    >>> collectopts (const Nothing) (RawOpts [("x","")])
    []
    >>> collectopts Just (RawOpts [("a",""),("b","")])
    [("a",""),("b","")]

maybestringopt :: String -> RawOpts -> Maybe String Source #

stringopt :: String -> RawOpts -> String Source #

maybecharopt :: String -> RawOpts -> Maybe Char Source #

listofstringopt :: String -> RawOpts -> [String] Source #

maybeintopt :: String -> RawOpts -> Maybe Int Source #

Reads the named option's Int argument, if it is present. An argument that is too small or too large will raise an error.

maybeposintopt :: String -> RawOpts -> Maybe Int Source #

Reads the named option's natural-number argument, if it is present. An argument that is negative or too large will raise an error.

intopt :: String -> RawOpts -> Int Source #

Reads the named option's Int argument. If not present it will return 0. An argument that is too small or too large will raise an error.

posintopt :: String -> RawOpts -> Int Source #

Reads the named option's natural-number argument. If not present it will return 0. An argument that is negative or too large will raise an error.

showDate :: Day -> Text Source #

showEFDate :: EFDay -> Text Source #

showDateSpan :: DateSpan -> Text Source #

Render a datespan as a display string, abbreviating into a compact form if possible. Warning, hides whether dates are Exact or Flex.

showDateSpanDebug :: DateSpan -> String Source #

Show a DateSpan with its begin/end dates, exact or flex.

showDateSpanMonthAbbrev :: DateSpan -> Text Source #

Like showDateSpan, but show month spans as just the abbreviated month name in the current locale.

getCurrentDay :: IO Day Source #

Get the current local date.

getCurrentMonth :: IO Int Source #

Get the current local month number.

getCurrentYear :: IO Integer Source #

Get the current local year.

elapsedSeconds :: Fractional a => UTCTime -> UTCTime -> a Source #

spanStart :: DateSpan -> Maybe Day Source #

spanStartYear :: DateSpan -> Maybe Year Source #

spanEndYear :: DateSpan -> Maybe Year Source #

spanYears :: DateSpan -> [Year] Source #

Get the 0-2 years mentioned explicitly in a DateSpan.

spansSpan :: [DateSpan] -> DateSpan Source #

Get overall span enclosing multiple sequentially ordered spans. The start and end date will be exact or flexible depending on the first span's start date and last span's end date.

splitSpan :: Bool -> Interval -> DateSpan -> [DateSpan] Source #

Split a DateSpan into consecutive exact spans of the specified Interval. If the first argument is true and the interval is Weeks, Months, Quarters or Years, the start date will be adjusted backward if needed to nearest natural interval boundary (a monday, first of month, first of quarter or first of year). If no interval is specified, the original span is returned. If the original span is the null date span, ie unbounded, the null date span is returned. If the original span is empty, eg if the end date is <= the start date, no spans are returned.

#### Examples:

    >>> let t i y1 m1 d1 y2 m2 d2 = splitSpan True i $ DateSpan (Just $ Flex $ fromGregorian y1 m1 d1) (Just $ Flex $ fromGregorian y2 m2 d2)
    >>> t NoInterval 2008 01 01 2009 01 01
    [DateSpan 2008]
    >>> t (Quarters 1) 2008 01 01 2009 01 01
    [DateSpan 2008Q1,DateSpan 2008Q2,DateSpan 2008Q3,DateSpan 2008Q4]
    >>> splitSpan True (Quarters 1) nulldatespan
    [DateSpan ..]
    >>> t (Days 1) 2008 01 01 2008 01 01  -- an empty datespan
    []
    >>> t (Quarters 1) 2008 01 01 2008 01 01
    []
    >>> t (Months 1) 2008 01 01 2008 04 01
    [DateSpan 2008-01,DateSpan 2008-02,DateSpan 2008-03]
    >>> t (Months 2) 2008 01 01 2008 04 01
    [DateSpan 2008-01-01..2008-02-29,DateSpan 2008-03-01..2008-04-30]
    >>> t (Weeks 1) 2008 01 01 2008 01 15
    [DateSpan 2007-12-31W01,DateSpan 2008-01-07W02,DateSpan 2008-01-14W03]
    >>> t (Weeks 2) 2008 01 01 2008 01 15
    [DateSpan 2007-12-31..2008-01-13,DateSpan 2008-01-14..2008-01-27]
    >>> t (DayOfMonth 2) 2008 01 01 2008 04 01
    [DateSpan 2007-12-02..2008-01-01,DateSpan 2008-01-02..2008-02-01,DateSpan 2008-02-02..2008-03-01,DateSpan 2008-03-02..2008-04-01]
    >>> t (WeekdayOfMonth 2 4) 2011 01 01 2011 02 15
    [DateSpan 2010-12-09..2011-01-12,DateSpan 2011-01-13..2011-02-09,DateSpan 2011-02-10..2011-03-09]
    >>> t (DaysOfWeek [2]) 2011 01 01 2011 01 15
    [DateSpan 2010-12-28..2011-01-03,DateSpan 2011-01-04..2011-01-10,DateSpan 2011-01-11..2011-01-17]
    >>> t (DayOfYear 11 29) 2011 10 01 2011 10 15
    [DateSpan 2010-11-29..2011-11-28]
    >>> t (DayOfYear 11 29) 2011 12 01 2012 12 15
    [DateSpan 2011-11-29..2012-11-28,DateSpan 2012-11-29..2013-11-28]

spansFromBoundaries :: Day -> [Day] -> [DateSpan] Source #

Construct a list of exact `DateSpan`s from a list of boundaries, which fit within a given range.

daysInSpan :: DateSpan -> Maybe Integer Source #

Count the days in a DateSpan, or if it is open-ended return Nothing.

spanContainsDate :: DateSpan -> Day -> Bool Source #

Does the span include the given date ?

periodContainsDate :: Period -> Day -> Bool Source #

Does the period include the given date ? (Here to avoid import cycle).

groupByDateSpan :: Bool -> (a -> Day) -> [DateSpan] -> [a] -> [(DateSpan, [a])] Source #

Group elements based on where they fall in a list of `DateSpan`s without gaps. The precondition is not checked.

spansIntersect :: [DateSpan] -> DateSpan Source #

Calculate the intersection of a number of datespans.

spanIntersect :: DateSpan -> DateSpan -> DateSpan Source #

Calculate the intersection of two datespans.

For non-intersecting spans, gives an empty span beginning on the second's start date: >>> DateSpan (Just $ Flex $ fromGregorian 2018 01 01) (Just $ Flex $ fromGregorian 2018 01 03) `spanIntersect` DateSpan (Just $ Flex $ fromGregorian 2018 01 03) (Just $ Flex $ fromGregorian 2018 01 05) DateSpan 2018-01-03..2018-01-02

spanDefaultsFrom :: DateSpan -> DateSpan -> DateSpan Source #

Fill any unspecified dates in the first span with the dates from the second one. Sort of a one-way spanIntersect.

spansUnion :: [DateSpan] -> DateSpan Source #

Calculate the union of a number of datespans.

spanUnion :: DateSpan -> DateSpan -> DateSpan Source #

Calculate the union of two datespans.

daysSpan :: [Day] -> DateSpan Source #

Calculate the minimal DateSpan containing all of the given Days (in the usual exclusive-end-date sense: beginning on the earliest, and ending on the day after the latest).

latestSpanContaining :: [DateSpan] -> Day -> Maybe DateSpan Source #

Select the DateSpan containing a given Day, if any, from a given list of DateSpans.

If the DateSpans are non-overlapping, this returns the unique containing DateSpan, if it exists. If the DateSpans are overlapping, it will return the containing DateSpan with the latest start date, and then latest end date.

parsePeriodExpr :: Day -> Text -> Either HledgerParseErrors (Interval, DateSpan) Source #

Parse a period expression to an Interval and overall DateSpan using the provided reference date, or return a parse error.

parsePeriodExpr' :: Day -> Text -> (Interval, DateSpan) Source #

Like parsePeriodExpr, but call error' on failure.

fixSmartDateStr :: Day -> Text -> Text Source #

Convert a smart date string to an explicit yyyy/mm/dd string using the provided reference date, or raise an error.

fixSmartDateStrEither :: Day -> Text -> Either HledgerParseErrors Text Source #

A safe version of fixSmartDateStr.

fixSmartDateStrEither' :: Day -> Text -> Either HledgerParseErrors EFDay Source #

fixSmartDate :: Day -> SmartDate -> EFDay Source #

Convert a SmartDate to a specific date using the provided reference date. This date will be exact or flexible depending on whether the day was specified exactly. (Missing least-significant parts produces a flex date.)

#### Examples:

    >>> :set -XOverloadedStrings
    >>> let t = fixSmartDateStr (fromGregorian 2008 11 26)
    >>> t "0000-01-01"
    "0000-01-01"
    >>> t "1999-12-02"
    "1999-12-02"
    >>> t "1999.12.02"
    "1999-12-02"
    >>> t "1999/3/2"
    "1999-03-02"
    >>> t "19990302"
    "1999-03-02"
    >>> t "2008/2"
    "2008-02-01"
    >>> t "0020/2"
    "0020-02-01"
    >>> t "1000"
    "1000-01-01"
    >>> t "4/2"
    "2008-04-02"
    >>> t "2"
    "2008-11-02"
    >>> t "January"
    "2008-01-01"
    >>> t "feb"
    "2008-02-01"
    >>> t "today"
    "2008-11-26"
    >>> t "yesterday"
    "2008-11-25"
    >>> t "tomorrow"
    "2008-11-27"
    >>> t "this day"
    "2008-11-26"
    >>> t "last day"
    "2008-11-25"
    >>> t "next day"
    "2008-11-27"
    >>> t "this week"  -- last monday
    "2008-11-24"
    >>> t "last week"  -- previous monday
    "2008-11-17"
    >>> t "next week"  -- next monday
    "2008-12-01"
    >>> t "this month"
    "2008-11-01"
    >>> t "last month"
    "2008-10-01"
    >>> t "next month"
    "2008-12-01"
    >>> t "this quarter"
    "2008-10-01"
    >>> t "last quarter"
    "2008-07-01"
    >>> t "next quarter"
    "2009-01-01"
    >>> t "this year"
    "2008-01-01"
    >>> t "last year"
    "2007-01-01"
    >>> t "next year"
    "2009-01-01"

t "last wed" "2008-11-19" t "next friday" "2008-11-28" t "next january" "2009-01-01"

    >>> t "in 5 days"
    "2008-12-01"
    >>> t "in 7 months"
    "2009-06-01"
    >>> t "in -2 weeks"
    "2008-11-10"
    >>> t "1 quarter ago"
    "2008-07-01"
    >>> t "1 week ahead"
    "2008-12-01"

prevday :: Day -> Day Source #

intervalBoundaryBefore :: Interval -> Day -> Day Source #

parsedateM :: String -> Maybe Day Source #

Try to parse a couple of date string formats: `YYYY-MM-DD`, `YYYYMMDD` or `DD`, with leading zeros required. For internal use, not quite the same as the journal's "simple dates". >>> parsedateM "20080203" Just 2008-02-03 >>> parsedateM "20080203/" Nothing >>> parsedateM "20080230" Nothing

smartdate :: forall (m :: Type -> Type). TextParser m SmartDate Source #

Parse a date in any of the formats allowed in Ledger's period expressions, and some others. Assumes any text in the parse stream has been lowercased. Returns a SmartDate, to be converted to a full date later (see fixSmartDate).

Examples:

    2004                                        (start of year, which must have 4+ digits)
    2004/10                                     (start of month, which must be 1-12)
    2004/10/1                                   (exact date, day must be 1-31)
    10/1                                        (month and day in current year)
    21                                          (day in current month)
    october, oct                                (start of month in current year)
    yesterday, today, tomorrow                  (-1, 0, 1 days from today)
    last/this/next day/week/month/quarter/year  (-1, 0, 1 periods from the current period)
    in n days/weeks/months/quarters/years       (n periods from the current period)
    n days/weeks/months/quarters/years ago      (-n periods from the current period)
    20181201                                    (8 digit YYYYMMDD with valid year month and day)
    201812                                      (6 digit YYYYMM with valid year and month)

Note malformed digit sequences might give surprising results:

    201813                                      (6 digits with an invalid month is parsed as start of 6-digit year)
    20181301                                    (8 digits with an invalid month is parsed as start of 8-digit year)
    20181232                                    (8 digits with an invalid day gives an error)
    201801012                                   (9+ digits beginning with a valid YYYYMMDD gives an error)

Eg:

YYYYMMDD is parsed as year-month-date if those parts are valid (>=4 digits, 1-12, and 1-31 respectively): >>> parsewith (smartdate <* eof) "20181201" Right (SmartCompleteDate 2018-12-01)

YYYYMM is parsed as year-month-01 if year and month are valid: >>> parsewith (smartdate <* eof) "201804" Right (SmartAssumeStart 2018 (Just 4))

With an invalid month, it's parsed as a year: >>> parsewith (smartdate <* eof) "201813" Right (SmartAssumeStart 201813 Nothing)

A 9+ digit number beginning with valid YYYYMMDD gives an error: >>> parsewith (smartdate <* eof) "201801012" Left (...)

Big numbers not beginning with a valid YYYYMMDD are parsed as a year: >>> parsewith (smartdate <* eof) "201813012" Right (SmartAssumeStart 201813012 Nothing)

datesepchars :: String Source #

datesepchar :: forall (m :: Type -> Type). TextParser m Char Source #

isDateSepChar :: Char -> Bool Source #

yearp :: forall (m :: Type -> Type). TextParser m Integer Source #

Parse a year number from a Text, making sure that at least four digits are used.

periodexprp :: forall (m :: Type -> Type). Day -> TextParser m (Interval, DateSpan) Source #

Parse a period expression, specifying a date span and optionally a reporting interval. Requires a reference "today" date for resolving any relative start/end dates (only; it is not needed for parsing the reporting interval).

    >>> let p = parsePeriodExpr (fromGregorian 2008 11 26)
    >>> p "from Aug to Oct"
    Right (NoInterval,DateSpan 2008-08-01..2008-09-30)
    >>> p "aug to oct"
    Right (NoInterval,DateSpan 2008-08-01..2008-09-30)
    >>> p "2009q2"
    Right (NoInterval,DateSpan 2009Q2)
    >>> p "Q3"
    Right (NoInterval,DateSpan 2008Q3)
    >>> p "every 3 days in Aug"
    Right (Days 3,DateSpan 2008-08)
    >>> p "daily from aug"
    Right (Days 1,DateSpan 2008-08-01..)
    >>> p "every week to 2009"
    Right (Weeks 1,DateSpan ..2008-12-31)
    >>> p "every 2nd day of month"
    Right (DayOfMonth 2,DateSpan ..)
    >>> p "every 2nd day"
    Right (DayOfMonth 2,DateSpan ..)
    >>> p "every 2nd day 2009.."
    Right (DayOfMonth 2,DateSpan 2009-01-01..)
    >>> p "every 2nd day 2009-"
    Right (DayOfMonth 2,DateSpan 2009-01-01..)
    >>> p "every 29th Nov"
    Right (DayOfYear 11 29,DateSpan ..)
    >>> p "every 29th nov ..2009"
    Right (DayOfYear 11 29,DateSpan ..2008-12-31)
    >>> p "every nov 29th"
    Right (DayOfYear 11 29,DateSpan ..)
    >>> p "every Nov 29th 2009.."
    Right (DayOfYear 11 29,DateSpan 2009-01-01..)
    >>> p "every 11/29 from 2009"
    Right (DayOfYear 11 29,DateSpan 2009-01-01..)
    >>> p "every 11/29 since 2009"
    Right (DayOfYear 11 29,DateSpan 2009-01-01..)
    >>> p "every 2nd Thursday of month to 2009"
    Right (WeekdayOfMonth 2 4,DateSpan ..2008-12-31)
    >>> p "every 1st monday of month to 2009"
    Right (WeekdayOfMonth 1 1,DateSpan ..2008-12-31)
    >>> p "every tue"
    Right (DaysOfWeek [2],DateSpan ..)
    >>> p "every 2nd day of week"
    Right (DaysOfWeek [2],DateSpan ..)
    >>> p "every 2nd day of month"
    Right (DayOfMonth 2,DateSpan ..)
    >>> p "every 2nd day"
    Right (DayOfMonth 2,DateSpan ..)
    >>> p "every 2nd day 2009.."
    Right (DayOfMonth 2,DateSpan 2009-01-01..)
    >>> p "every 2nd day of month 2009.."
    Right (DayOfMonth 2,DateSpan 2009-01-01..)

nulldatespan :: DateSpan Source #

emptydatespan :: DateSpan Source #

An exact datespan of zero length, that matches no date.

nulldate :: Day Source #

tests_Dates :: TestTree Source #

acctsepchar :: Char Source #

acctsep :: Text Source #

accountNameComponents :: AccountName -> [Text] Source #

accountNameFromComponents :: [Text] -> AccountName Source #

accountLeafName :: AccountName -> Text Source #

accountSummarisedName :: AccountName -> Text Source #

Truncate all account name components but the last to two characters.

assetAccountRegex :: Regexp Source #

Regular expressions matching common English top-level account names, used as a fallback when account types are not declared.

cashAccountRegex :: Regexp Source #

liabilityAccountRegex :: Regexp Source #

equityAccountRegex :: Regexp Source #

conversionAccountRegex :: Regexp Source #

revenueAccountRegex :: Regexp Source #

expenseAccountRegex :: Regexp Source #

accountNameInferType :: AccountName -> Maybe AccountType Source #

Try to guess an account's type from its name, matching common English top-level account names.

accountNameType :: Map AccountName AccountType -> AccountName -> Maybe AccountType Source #

accountNameLevel :: AccountName -> Int Source #

unbudgetedAccountName :: Text Source #

A top-level account prefixed to some accounts in budget reports. Defined here so it can be ignored by accountNameDrop.

accountNamePostingType :: AccountName -> PostingType Source #

accountNameWithoutPostingType :: AccountName -> AccountName Source #

accountNameWithPostingType :: PostingType -> AccountName -> AccountName Source #

joinAccountNames :: AccountName -> AccountName -> AccountName Source #

Prefix one account name to another, preserving posting type indicators like concatAccountNames.

concatAccountNames :: [AccountName] -> AccountName Source #

Join account names into one. If any of them has () or [] posting type indicators, these (the first type encountered) will also be applied to the resulting account name.

accountNameApplyAliases :: [AccountAlias] -> AccountName -> Either RegexError AccountName Source #

Rewrite an account name using all matching aliases from the given list, in sequence. Each alias sees the result of applying the previous aliases. Or, return any error arising from a bad regular expression in the aliases.

accountNameApplyAliasesMemo :: [AccountAlias] -> AccountName -> Either RegexError AccountName Source #

Memoising version of accountNameApplyAliases, maybe overkill.

accountNameDrop :: Int -> AccountName -> AccountName Source #

Remove some number of account name components from the front of the account name. If the special "unbudgeted" top-level account is present, it is preserved and dropping affects the rest of the account name.

expandAccountNames :: [AccountName] -> [AccountName] Source #

Sorted unique account names implied by these account names, ie these plus all their parent accounts up to the root. Eg: ["a:b:c","d:e"] -> ["a","a:b","a:b:c","d","d:e"]

expandAccountName :: AccountName -> [AccountName] Source #

"a:b:c" -> ["a","a:b","a:b:c"]

topAccountNames :: [AccountName] -> [AccountName] Source #

"a:b:c","d:e"
  -> ["a","d"]

parentAccountName :: AccountName -> AccountName Source #

parentAccountNames :: AccountName -> [AccountName] Source #

isAccountNamePrefixOf :: AccountName -> AccountName -> Bool Source #

Is the first account a parent or other ancestor of (and not the same as) the second ?

isSubAccountNameOf :: AccountName -> AccountName -> Bool Source #

subAccountNamesFrom :: [AccountName] -> AccountName -> [AccountName] Source #

From a list of account names, select those which are direct subaccounts of the given account name.

accountNameTreeFrom :: [AccountName] -> Tree AccountName Source #

Convert a list of account names to a tree.

elideAccountName :: Int -> AccountName -> AccountName Source #

Elide an account name to fit in the specified width. From the ledger 2.6 news:

      What Ledger now does is that if an account name is too long, it will
      start abbreviating the first parts of the account name down to two
      letters in length.  If this results in a string that is still too
      long, the front will be elided -- not the end.  For example:

        Expenses:Cash           ; OK, not too long
        Ex:Wednesday:Cash       ; Expenses was abbreviated to fit
        Ex:We:Afternoon:Cash    ; Expenses and Wednesday abbreviated
        ; Expenses:Wednesday:Afternoon:Lunch:Snack:Candy:Chocolate:Cash
        ..:Af:Lu:Sn:Ca:Ch:Cash  ; Abbreviated and elided!

clipAccountName :: Maybe Int -> AccountName -> AccountName Source #

Keep only the first n components of an account name, where n is a positive integer. If n is Just 0, returns the empty string, if n is Nothing, return the full name.

clipOrEllipsifyAccountName :: Maybe Int -> AccountName -> AccountName Source #

Keep only the first n components of an account name, where n is a positive integer. If n is Just 0, returns "...", if n is Nothing, return the full name.

escapeName :: AccountName -> Text Source #

Escape an AccountName for use within a regular expression. >>> putStr . T.unpack $ escapeName "First?!#$*?$(*) !`^#*? %)*!`#" First?!#$*?$(*) !`^#*? %)*!`#

accountNameToAccountRegex :: AccountName -> Regexp Source #

Convert an account name to a regular expression matching it and its subaccounts.

accountNameToAccountRegexCI :: AccountName -> Regexp Source #

Convert an account name to a regular expression matching it and its subaccounts, case insensitively.

accountNameToAccountOnlyRegex :: AccountName -> Regexp Source #

Convert an account name to a regular expression matching it but not its subaccounts.

accountNameToAccountOnlyRegexCI :: AccountName -> Regexp Source #

Convert an account name to a regular expression matching it but not its subaccounts, case insensitively.

tests_AccountName :: TestTree Source #

defaultBalanceLineFormat :: StringFormat Source #

Default line format for balance report: "%20(total) %2(depth_spacer)%-(account)"

parseStringFormat :: Text -> Either String StringFormat Source #

Parse a string format specification, or return a parse error.

defaultStringFormatStyle :: [StringFormatComponent] -> StringFormat Source #

tests_StringFormat :: TestTree Source #

showCommoditySymbol :: Text -> Text Source #

Show space-containing commodity symbols quoted, as they are in a journal.

isNonsimpleCommodityChar :: Char -> Bool Source #

quoteCommoditySymbolIfNeeded :: Text -> Text Source #

noColour :: AmountDisplayOpts Source #

Display Amount and MixedAmount with no colour.

noPrice :: AmountDisplayOpts Source #

Display Amount and MixedAmount with no prices.

oneLine :: AmountDisplayOpts Source #

Display Amount and MixedAmount on one line with no prices.

csvDisplay :: AmountDisplayOpts Source #

Display Amount and MixedAmount in a form suitable for CSV output.

amountstyle :: AmountStyle Source #

Default amount style

nullamt :: Amount Source #

The empty simple amount.

missingamt :: Amount Source #

A temporary value for parsed transactions which had no amount specified.

num :: Quantity -> Amount Source #

hrs :: Quantity -> Amount Source #

usd :: DecimalRaw Integer -> Amount Source #

eur :: DecimalRaw Integer -> Amount Source #

gbp :: DecimalRaw Integer -> Amount Source #

per :: Quantity -> Amount Source #

at :: Amount -> Amount -> Amount Source #

(@@) :: Amount -> Amount -> Amount Source #

amountWithCommodity :: CommoditySymbol -> Amount -> Amount Source #

Convert an amount to the specified commodity, ignoring and discarding any assigned prices and assuming an exchange rate of 1.

amountCost :: Amount -> Amount Source #

Convert a amount to its "cost" or "selling price" in another commodity, using its attached transaction price if it has one. Notes:

- price amounts must be MixedAmounts with exactly one component Amount (or there will be a runtime error XXX)
- price amounts should be positive in the Journal (though this is currently not enforced)

divideAmount :: Quantity -> Amount -> Amount Source #

Divide an amount's quantity (and its total price, if it has one) by a constant.

multiplyAmount :: Quantity -> Amount -> Amount Source #

Multiply an amount's quantity (and its total price, if it has one) by a constant.

isNegativeAmount :: Amount -> Bool Source #

Is this amount negative ? The price is ignored.

amountLooksZero :: Amount -> Bool Source #

Do this Amount and (and its total price, if it has one) appear to be zero when rendered with its display precision ?

amountIsZero :: Amount -> Bool Source #

Is this Amount (and its total price, if it has one) exactly zero, ignoring its display precision ?

withPrecision :: Amount -> AmountPrecision -> Amount Source #

Set an amount's display precision, flipped.

amountSetPrecision :: AmountPrecision -> Amount -> Amount Source #

Set an amount's display precision.

amountSetFullPrecision :: Amount -> Amount Source #

Increase an amount's display precision, if needed, to enough decimal places to show it exactly (showing all significant decimal digits, excluding trailing zeros).

setAmountInternalPrecision :: Word8 -> Amount -> Amount Source #

Set an amount's internal precision, ie rounds the Decimal representing the amount's quantity to some number of decimal places. Rounding is done with Data.Decimal's default roundTo function: "If the value ends in 5 then it is rounded to the nearest even value (Banker's Rounding)". Does not change the amount's display precision. Intended mainly for internal use, eg when comparing amounts in tests.

withInternalPrecision :: Amount -> Word8 -> Amount Source #

Set an amount's internal precision, flipped. Intended mainly for internal use, eg when comparing amounts in tests.

setAmountDecimalPoint :: Maybe Char -> Amount -> Amount Source #

Set (or clear) an amount's display decimal point.

withDecimalPoint :: Amount -> Maybe Char -> Amount Source #

Set (or clear) an amount's display decimal point, flipped.

amountStripPrices :: Amount -> Amount Source #

Strip all prices from an Amount

showAmountPrice :: Amount -> WideBuilder Source #

styleAmount :: Map CommoditySymbol AmountStyle -> Amount -> Amount Source #

Given a map of standard commodity display styles, apply the appropriate one to this amount. If there's no standard style for this amount's commodity, return the amount unchanged. Also apply the style to the price (except for precision)

styleAmountExceptPrecision :: Map CommoditySymbol AmountStyle -> Amount -> Amount Source #

Like styleAmount, but keep the number of decimal places unchanged.

amountUnstyled :: Amount -> Amount Source #

Reset this amount's display style to the default.

showAmount :: Amount -> String Source #

Get the string representation of an amount, based on its commodity's display settings. String representations equivalent to zero are converted to just "0". The special "missing" amount is displayed as the empty string.

    showAmount = wbUnpack . showAmountB noColour

showAmountB :: AmountDisplayOpts -> Amount -> WideBuilder Source #

General function to generate a WideBuilder for an Amount, according the supplied AmountDisplayOpts. The special "missing" amount is displayed as the empty string. This is the main function to use for showing Amounts, constructing a builder; it can then be converted to a Text with wbToText, or to a String with wbUnpack.

cshowAmount :: Amount -> String Source #

Colour version. For a negative amount, adds ANSI codes to change the colour, currently to hard-coded red.

    cshowAmount = wbUnpack . showAmountB def{displayColour=True}

showAmountWithoutPrice :: Amount -> String Source #

Get the string representation of an amount, without any @ price.

    showAmountWithoutPrice = wbUnpack . showAmountB noPrice

showAmountWithZeroCommodity :: Amount -> String Source #

Like showAmount, but show a zero amount's commodity if it has one.

    showAmountWithZeroCommodity = wbUnpack . showAmountB noColour{displayZeryCommodity=True}

showAmountDebug :: Amount -> String Source #

Get a string representation of an amount for debugging, appropriate to the current debug level. 9 shows maximum detail.

canonicaliseAmount :: Map CommoditySymbol AmountStyle -> Amount -> Amount Source #

Canonicalise an amount's display style using the provided commodity style map.

nullmixedamt :: MixedAmount Source #

The empty mixed amount.

missingmixedamt :: MixedAmount Source #

A temporary value for parsed transactions which had no amount specified.

isMissingMixedAmount :: MixedAmount -> Bool Source #

Whether a MixedAmount has a missing amount

mixed :: Foldable t => t Amount -> MixedAmount Source #

Convert amounts in various commodities into a mixed amount.

mixedAmount :: Amount -> MixedAmount Source #

Create a MixedAmount from a single Amount.

maAddAmount :: MixedAmount -> Amount -> MixedAmount Source #

Add an Amount to a MixedAmount, normalising the result. Amounts with different costs are kept separate.

maAddAmounts :: Foldable t => MixedAmount -> t Amount -> MixedAmount Source #

Add a collection of Amounts to a MixedAmount, normalising the result. Amounts with different costs are kept separate.

maNegate :: MixedAmount -> MixedAmount Source #

Negate mixed amount's quantities (and total prices, if any).

maPlus :: MixedAmount -> MixedAmount -> MixedAmount Source #

Sum two MixedAmount, keeping the cost of the first if any. Amounts with different costs are kept separate (since 2021).

maMinus :: MixedAmount -> MixedAmount -> MixedAmount Source #

Subtract a MixedAmount from another. Amounts with different costs are kept separate.

maSum :: Foldable t => t MixedAmount -> MixedAmount Source #

Sum a collection of MixedAmounts. Amounts with different costs are kept separate.

divideMixedAmount :: Quantity -> MixedAmount -> MixedAmount Source #

Divide a mixed amount's quantities (and total prices, if any) by a constant.

multiplyMixedAmount :: Quantity -> MixedAmount -> MixedAmount Source #

Multiply a mixed amount's quantities (and total prices, if any) by a constant.

averageMixedAmounts :: [MixedAmount] -> MixedAmount Source #

Calculate the average of some mixed amounts.

isNegativeMixedAmount :: MixedAmount -> Maybe Bool Source #

Is this mixed amount negative, if we can tell that unambiguously? Ie when normalised, are all individual commodity amounts negative ?

mixedAmountLooksZero :: MixedAmount -> Bool Source #

Does this mixed amount appear to be zero when rendered with its display precision? i.e. does it have zero quantity with no price, zero quantity with a total price (which is also zero), and zero quantity for each unit price?

mixedAmountIsZero :: MixedAmount -> Bool Source #

Is this mixed amount exactly zero, ignoring its display precision? i.e. does it have zero quantity with no price, zero quantity with a total price (which is also zero), and zero quantity for each unit price?

maIsZero :: MixedAmount -> Bool Source #

Is this mixed amount exactly zero, ignoring its display precision?

A convenient alias for mixedAmountIsZero.

maIsNonZero :: MixedAmount -> Bool Source #

Is this mixed amount non-zero, ignoring its display precision?

A convenient alias for not . mixedAmountIsZero.

amounts :: MixedAmount -> [Amount] Source #

Get a mixed amount's component amounts.

- amounts in the same commodity are combined unless they have different prices or total prices
- multiple zero amounts, all with the same non-null commodity, are replaced by just the last of them, preserving the commodity and amount style (all but the last zero amount are discarded)
- multiple zero amounts with multiple commodities, or no commodities, are replaced by one commodity-less zero amount
- an empty amount list is replaced by one commodity-less zero amount
- the special "missing" mixed amount remains unchanged

amountsRaw :: MixedAmount -> [Amount] Source #

Get a mixed amount's component amounts without normalising zero and missing amounts. This is used for JSON serialisation, so the order is important. In particular, we want the Amounts given in the order of the MixedAmountKeys, i.e. lexicographically first by commodity, then by price commodity, then by unit price from most negative to most positive.

maCommodities :: MixedAmount -> Set CommoditySymbol Source #

Get this mixed amount's commodities as a set. Returns an empty set if there are no amounts.

unifyMixedAmount :: MixedAmount -> Maybe Amount Source #

Unify a MixedAmount to a single commodity value if possible. This consolidates amounts of the same commodity and discards zero amounts; but this one insists on simplifying to a single commodity, and will return Nothing if this is not possible.

filterMixedAmount :: (Amount -> Bool) -> MixedAmount -> MixedAmount Source #

Filter a mixed amount's component amounts by a predicate.

filterMixedAmountByCommodity :: CommoditySymbol -> MixedAmount -> MixedAmount Source #

Return an unnormalised MixedAmount containing exactly one Amount with the specified commodity and the quantity of that commodity found in the original. NB if Amount's quantity is zero it will be discarded next time the MixedAmount gets normalised.

mapMixedAmount :: (Amount -> Amount) -> MixedAmount -> MixedAmount Source #

Apply a transform to a mixed amount's component `Amount`s.

mixedAmountCost :: MixedAmount -> MixedAmount Source #

Convert all component amounts to cost/selling price where possible (see amountCost).

styleMixedAmount :: Map CommoditySymbol AmountStyle -> MixedAmount -> MixedAmount Source #

Given a map of standard commodity display styles, apply the appropriate one to each individual amount.

mixedAmountUnstyled :: MixedAmount -> MixedAmount Source #

Reset each individual amount's display style to the default.

showMixedAmount :: MixedAmount -> String Source #

Get the string representation of a mixed amount, after normalising it to one amount per commodity. Assumes amounts have no or similar prices, otherwise this can show misleading prices.

    showMixedAmount = wbUnpack . showMixedAmountB noColour

showMixedAmountOneLine :: MixedAmount -> String Source #

Get the one-line string representation of a mixed amount (also showing any costs).

    showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine

showMixedAmountWithZeroCommodity :: MixedAmount -> String Source #

Like showMixedAmount, but zero amounts are shown with their commodity if they have one.

    showMixedAmountWithZeroCommodity = wbUnpack . showMixedAmountB noColour{displayZeroCommodity=True}

showMixedAmountWithoutPrice :: Bool -> MixedAmount -> String Source #

Get the string representation of a mixed amount, without showing any transaction prices. With a True argument, adds ANSI codes to show negative amounts in red.

    showMixedAmountWithoutPrice c = wbUnpack . showMixedAmountB noPrice{displayColour=c}

showMixedAmountOneLineWithoutPrice :: Bool -> MixedAmount -> String Source #

Get the one-line string representation of a mixed amount, but without any @ prices. With a True argument, adds ANSI codes to show negative amounts in red.

    showMixedAmountOneLineWithoutPrice c = wbUnpack . showMixedAmountB oneLine{displayColour=c}

showMixedAmountElided :: Int -> Bool -> MixedAmount -> String Source #

Like showMixedAmountOneLineWithoutPrice, but show at most the given width, with an elision indicator if there are more. With a True argument, adds ANSI codes to show negative amounts in red.

    showMixedAmountElided w c = wbUnpack . showMixedAmountB oneLine{displayColour=c, displayMaxWidth=Just w}

showMixedAmountDebug :: MixedAmount -> String Source #

Get an unambiguous string representation of a mixed amount for debugging.

showMixedAmountB :: AmountDisplayOpts -> MixedAmount -> WideBuilder Source #

General function to generate a WideBuilder for a MixedAmount, according to the supplied AmountDisplayOpts. This is the main function to use for showing MixedAmounts, constructing a builder; it can then be converted to a Text with wbToText, or to a String with wbUnpack.

If a maximum width is given then: - If displayed on one line, it will display as many Amounts as can fit in the given width, and further Amounts will be elided. There will always be at least one amount displayed, even if this will exceed the requested maximum width. - If displayed on multiple lines, any Amounts longer than the maximum width will be elided.

showMixedAmountLinesB :: AmountDisplayOpts -> MixedAmount -> [WideBuilder] Source #

Helper for showMixedAmountB to show a list of Amounts on multiple lines. This returns the list of WideBuilders: one for each Amount, and padded/elided to the appropriate width. This does not honour displayOneLine: all amounts will be displayed as if displayOneLine were False.

mixedAmountSetPrecision :: AmountPrecision -> MixedAmount -> MixedAmount Source #

Set the display precision in the amount's commodities.

mixedAmountSetFullPrecision :: MixedAmount -> MixedAmount Source #

In each component amount, increase the display precision sufficiently to render it exactly (showing all significant decimal digits).

mixedAmountStripPrices :: MixedAmount -> MixedAmount Source #

Remove all prices from a MixedAmount.

canonicaliseMixedAmount :: Map CommoditySymbol AmountStyle -> MixedAmount -> MixedAmount Source #

Canonicalise a mixed amount's display styles using the provided commodity style map.

tests_Amount :: TestTree Source #

journalPriceOracle :: Bool -> Journal -> PriceOracle Source #

Generate a price oracle (memoising price lookup function) from a journal's directive-declared and transaction-inferred market prices. For best performance, generate this only once per journal, reusing it across reports if there are more than one, as compoundBalanceCommand does. The boolean argument is whether to infer market prices from transactions or not.

priceDirectiveToMarketPrice :: PriceDirective -> MarketPrice Source #

amountPriceDirectiveFromCost :: Day -> Amount -> Maybe PriceDirective Source #

Make one or more `MarketPrice` from an `Amount` and its price directives.

mixedAmountToCost :: Map CommoditySymbol AmountStyle -> ConversionOp -> MixedAmount -> MixedAmount Source #

Convert all component amounts to cost/selling price if requested, and style them.

mixedAmountApplyValuation :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> Day -> ValuationType -> MixedAmount -> MixedAmount Source #

Apply a specified valuation to this mixed amount, using the provided price oracle, commodity styles, and reference dates. See amountApplyValuation.

mixedAmountValueAtDate :: PriceOracle -> Map CommoditySymbol AmountStyle -> Maybe CommoditySymbol -> Day -> MixedAmount -> MixedAmount Source #

Find the market value of each component amount in the given commodity, or its default valuation commodity, at the given valuation date, using the given market price oracle. When market prices available on that date are not sufficient to calculate the value, amounts are left unchanged.

mixedAmountApplyGain :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> Day -> ValuationType -> MixedAmount -> MixedAmount Source #

Calculate the gain of each component amount, that is the difference between the valued amount and the value of the cost basis (see mixedAmountApplyValuation).

If the commodity we are valuing in is not the same as the commodity of the cost, this will value the cost at the same date as the primary amount. This may not be what you want; for example you may want the cost valued at the posting date. If so, let us know and we can change this behaviour.

mixedAmountGainAtDate :: PriceOracle -> Map CommoditySymbol AmountStyle -> Maybe CommoditySymbol -> Day -> MixedAmount -> MixedAmount Source #

Calculate the gain of each component amount, that is the difference between the valued amount and the value of the cost basis.

If the commodity we are valuing in is not the same as the commodity of the cost, this will value the cost at the same date as the primary amount. This may not be what you want; for example you may want the cost valued at the posting date. If so, let us know and we can change this behaviour.

marketPriceReverse :: MarketPrice -> MarketPrice Source #

tests_Valuation :: TestTree Source #

nullposting :: Posting Source #

posting :: Posting Source #

post :: AccountName -> Amount -> Posting Source #

Make a posting to an account.

vpost :: AccountName -> Amount -> Posting Source #

Make a virtual (unbalanced) posting to an account.

post' :: AccountName -> Amount -> Maybe BalanceAssertion -> Posting Source #

Make a posting to an account, maybe with a balance assertion.

vpost' :: AccountName -> Amount -> Maybe BalanceAssertion -> Posting Source #

Make a virtual (unbalanced) posting to an account, maybe with a balance assertion.

nullsourcepos :: (SourcePos, SourcePos) Source #

nullassertion :: BalanceAssertion Source #

balassert :: Amount -> Maybe BalanceAssertion Source #

Make a partial, exclusive balance assertion.

balassertTot :: Amount -> Maybe BalanceAssertion Source #

Make a total, exclusive balance assertion.

balassertParInc :: Amount -> Maybe BalanceAssertion Source #

Make a partial, inclusive balance assertion.

balassertTotInc :: Amount -> Maybe BalanceAssertion Source #

Make a total, inclusive balance assertion.

showBalanceAssertion :: BalanceAssertion -> WideBuilder Source #

Render a balance assertion, as the =[=][*] symbol and expected amount.

originalPosting :: Posting -> Posting Source #

showPosting :: Posting -> String Source #

showPostingLines :: Posting -> [Text] Source #

Render a posting, at the appropriate width for aligning with its siblings if any. Used by the rewrite command.

postingsAsLines :: Bool -> [Posting] -> [Text] Source #

Given a transaction and its postings, render the postings, suitable for `print` output. Normally this output will be valid journal syntax which hledger can reparse (though it may include no-longer-valid balance assertions).

Explicit amounts are shown, any implicit amounts are not.

Postings with multicommodity explicit amounts are handled as follows: if onelineamounts is true, these amounts are shown on one line, comma-separated, and the output will not be valid journal syntax. Otherwise, they are shown as several similar postings, one per commodity. When the posting has a balance assertion, it is attached to the last of these postings.

The output will appear to be a balanced transaction. Amounts' display precisions, which may have been limited by commodity directives, will be increased if necessary to ensure this.

Posting amounts will be aligned with each other, starting about 4 columns beyond the widest account name (see postingAsLines for details).

postingAsLines :: Bool -> Bool -> Int -> Int -> Posting -> ([Text], Int, Int) Source #

Render one posting, on one or more lines, suitable for `print` output. There will be an indented account name, plus one or more of status flag, posting amount, balance assertion, same-line comment, next-line comments.

If the posting's amount is implicit or if elideamount is true, no amount is shown.

If the posting's amount is explicit and multi-commodity, multiple similar postings are shown, one for each commodity, to help produce parseable journal syntax. Or if onelineamounts is true, such amounts are shown on one line, comma-separated (and the output will not be valid journal syntax).

By default, 4 spaces (2 if there's a status flag) are shown between account name and start of amount area, which is typically 12 chars wide and contains a right-aligned amount (so 10-12 visible spaces between account name and amount is typical). When given a list of postings to be aligned with, the whitespace will be increased if needed to match the posting with the longest account name. This is used to align the amounts of a transaction's postings.

Also returns the account width and amount width used.

showAccountName :: Maybe Int -> PostingType -> AccountName -> Text Source #

Show an account name, clipped to the given width if any, and appropriately bracketed/parenthesised for the given posting type.

renderCommentLines :: Text -> [Text] Source #

Render a transaction or posting's comment as indented, semicolon-prefixed comment lines. The first line (unless empty) will have leading space, subsequent lines will have a larger indent.

isReal :: Posting -> Bool Source #

isVirtual :: Posting -> Bool Source #

isBalancedVirtual :: Posting -> Bool Source #

hasAmount :: Posting -> Bool Source #

hasBalanceAssignment :: Posting -> Bool Source #

accountNamesFromPostings :: [Posting] -> [AccountName] Source #

Sorted unique account names referenced by these postings.

sumPostings :: [Posting] -> MixedAmount Source #

Sum all amounts from a list of postings.

postingStripPrices :: Posting -> Posting Source #

Strip all prices from a Posting.

postingDate :: Posting -> Day Source #

Get a posting's (primary) date - it's own primary date if specified, otherwise the parent transaction's primary date, or the null date if there is no parent transaction.

postingDate2 :: Posting -> Day Source #

Get a posting's secondary (secondary) date, which is the first of: posting's secondary date, transaction's secondary date, posting's primary date, transaction's primary date, or the null date if there is no parent transaction.

postingDateOrDate2 :: WhichDate -> Posting -> Day Source #

Get a posting's primary or secondary date, as specified.

postingStatus :: Posting -> Status Source #

Get a posting's status. This is cleared or pending if those are explicitly set on the posting, otherwise the status of its parent transaction, or unmarked if there is no parent transaction. (Note the ambiguity, unmarked can mean "posting and transaction are both unmarked" or "posting is unmarked and don't know about the transaction".

postingAllTags :: Posting -> [Tag] Source #

Tags for this posting including any inherited from its parent transaction.

transactionAllTags :: Transaction -> [Tag] Source #

Tags for this transaction including any from its postings.

relatedPostings :: Posting -> [Posting] Source #

isPostingInDateSpan :: DateSpan -> Posting -> Bool Source #

Does this posting fall within the given date span ?

isPostingInDateSpan' :: WhichDate -> DateSpan -> Posting -> Bool Source #

isEmptyPosting :: Posting -> Bool Source #

postingApplyAliases :: [AccountAlias] -> Posting -> Either RegexError Posting Source #

Apply some account aliases to the posting's account name, as described by accountNameApplyAliases. This can fail due to a bad replacement pattern in a regular expression alias.

postingApplyCommodityStyles :: Map CommoditySymbol AmountStyle -> Posting -> Posting Source #

Choose and apply a consistent display style to the posting amounts in each commodity (see journalCommodityStyles).

postingAddTags :: Posting -> [Tag] -> Posting Source #

Add tags to a posting, discarding any for which the posting already has a value.

postingApplyValuation :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> ValuationType -> Posting -> Posting Source #

Apply a specified valuation to this posting's amount, using the provided price oracle, commodity styles, and reference dates. See amountApplyValuation.

postingToCost :: Map CommoditySymbol AmountStyle -> ConversionOp -> Posting -> Maybe Posting Source #

Maybe convert this `Posting`s amount to cost, and apply apply appropriate amount styles.

postingAddInferredEquityPostings :: Bool -> Text -> Posting -> [Posting] Source #

Generate inferred equity postings from a `Posting` using transaction prices. Make sure not to generate equity postings when there are already matched conversion postings.

postingPriceDirectivesFromCost :: Posting -> [PriceDirective] Source #

Make a market price equivalent to this posting's amount's unit price, if any.

postingTransformAmount :: (MixedAmount -> MixedAmount) -> Posting -> Posting Source #

Apply a transform function to this posting's amount.

commentJoin :: Text -> Text -> Text Source #

Join two parts of a comment, eg a tag and another tag, or a tag and a non-tag, on a single line. Interpolates a comma and space unless one of the parts is empty.

commentAddTag :: Text -> Tag -> Text Source #

Add a tag to a comment, comma-separated from any prior content. A space is inserted following the colon, before the value.

commentAddTagNextLine :: Text -> Tag -> Text Source #

Add a tag on its own line to a comment, preserving any prior content. A space is inserted following the colon, before the value.

tests_Posting :: TestTree Source #

nulltransaction :: Transaction Source #

transaction :: Day -> [Posting] -> Transaction Source #

Make a simple transaction with the given date and postings.

transactionPayee :: Transaction -> Text Source #

transactionNote :: Transaction -> Text Source #

showTransaction :: Transaction -> Text Source #

Render a journal transaction as text similar to the style of Ledger's print command.

Adapted from Ledger 2.x and 3.x standard format:

    yyyy-mm-dd[ *][ CODE] description.........          [  ; comment...............]
        account name 1.....................  ...$amount1[  ; comment...............]
        account name 2.....................  ..$-amount1[  ; comment...............]

    pcodewidth    = no limit -- 10          -- mimicking ledger layout.
    pdescwidth    = no limit -- 20          -- I don't remember what these mean,
    pacctwidth    = 35 minimum, no maximum  -- they were important at the time.
    pamtwidth     = 11
    pcommentwidth = no limit -- 22

The output will be parseable journal syntax. To facilitate this, postings with explicit multi-commodity amounts are displayed as multiple similar postings, one per commodity. (Normally does not happen with this function).

showTransactionOneLineAmounts :: Transaction -> Text Source #

Like showTransaction, but explicit multi-commodity amounts are shown on one line, comma-separated. In this case the output will not be parseable journal syntax.

showTransactionLineFirstPart :: Transaction -> Text Source #

hasRealPostings :: Transaction -> Bool Source #

realPostings :: Transaction -> [Posting] Source #

assignmentPostings :: Transaction -> [Posting] Source #

virtualPostings :: Transaction -> [Posting] Source #

balancedVirtualPostings :: Transaction -> [Posting] Source #

transactionsPostings :: [Transaction] -> [Posting] Source #

transactionDate2 :: Transaction -> Day Source #

transactionDateOrDate2 :: WhichDate -> Transaction -> Day Source #

txnTieKnot :: Transaction -> Transaction Source #

Ensure a transaction's postings refer back to it, so that eg relatedPostings works right.

txnUntieKnot :: Transaction -> Transaction Source #

Ensure a transaction's postings do not refer back to it, so that eg recursiveSize and GHCI's :sprint work right.

transactionTransformPostings :: (Posting -> Posting) -> Transaction -> Transaction Source #

Apply a transform function to this transaction's amounts.

transactionApplyValuation :: PriceOracle -> Map CommoditySymbol AmountStyle -> Day -> Day -> ValuationType -> Transaction -> Transaction Source #

Apply a specified valuation to this transaction's amounts, using the provided price oracle, commodity styles, and reference dates. See amountApplyValuation.

transactionToCost :: Map CommoditySymbol AmountStyle -> ConversionOp -> Transaction -> Transaction Source #

Maybe convert this `Transaction`s amounts to cost and apply the appropriate amount styles.

transactionAddInferredEquityPostings :: Bool -> AccountName -> Transaction -> Transaction Source #

Add inferred equity postings to a `Transaction` using transaction prices.

transactionInferCostsFromEquity :: Bool -> Map AccountName AccountType -> Transaction -> Either String Transaction Source #

Add costs inferred from equity postings in this transaction. For every adjacent pair of conversion postings, it will first search the postings with costs to see if any match. If so, it will tag these as matched. If no postings with costs match, it will then search the postings without costs, and will match the first such posting which matches one of the conversion amounts. If it finds a match, it will add a cost and then tag it. If the first argument is true, do a dry run instead: identify and tag the costful and conversion postings, but don't add costs.

partitionAndCheckConversionPostings :: Bool -> Map AccountName AccountType -> [IdxPosting] -> Either Text ([(IdxPosting, IdxPosting)], ([IdxPosting], [IdxPosting])) Source #

transactionApplyAliases :: [AccountAlias] -> Transaction -> Either RegexError Transaction Source #

Apply some account aliases to all posting account names in the transaction, as described by accountNameApplyAliases. This can fail due to a bad replacement pattern in a regular expression alias.

transactionMapPostings :: (Posting -> Posting) -> Transaction -> Transaction Source #

Apply a transformation to a transaction's postings.

transactionMapPostingAmounts :: (MixedAmount -> MixedAmount) -> Transaction -> Transaction Source #

Apply a transformation to a transaction's posting amounts.

transactionFile :: Transaction -> FilePath Source #

The file path from which this transaction was parsed.

annotateErrorWithTransaction :: Transaction -> String -> String Source #

tests_Transaction :: TestTree Source #

payeeTag :: Maybe Text -> Either RegexError Query Source #

Construct a payee tag

noteTag :: Maybe Text -> Either RegexError Query Source #

Construct a note tag

generatedTransactionTag :: Query Source #

Construct a generated-transaction tag

parseQuery :: Day -> Text -> Either String (Query, [QueryOpt]) Source #

A version of parseQueryList which acts on a single Text of space-separated terms.

The usual shell quoting rules are assumed. When a pattern contains whitespace, it (or the whole term including prefix) should be enclosed in single or double quotes.

A query term is either:

1. a search pattern, which matches on one or more fields, eg:

   acct:REGEXP - match the account name with a regular expression desc:REGEXP - match the transaction description date:PERIODEXP - match the date with a period expression

The prefix indicates the field to match, or if there is no prefix account name is assumed.

1. a query option, which modifies the reporting behaviour in some way. There is currently one of these, which may appear only once:

   inacct:FULLACCTNAME

Period expressions may contain relative dates, so a reference date is required to fully parse these.

    >>> parseQuery nulldate "expenses:dining out"
    Right (Or [Acct (RegexpCI "expenses:dining"),Acct (RegexpCI "out")],[])

    >>> parseQuery nulldate "\"expenses:dining out\""
    Right (Acct (RegexpCI "expenses:dining out"),[])

parseQueryList :: Day -> [Text] -> Either String (Query, [QueryOpt]) Source #

Convert a list of space-separated queries to a single query

Multiple terms are combined as follows: 1. multiple account patterns are OR'd together 2. multiple description patterns are OR'd together 3. multiple status patterns are OR'd together 4. then all terms are AND'd together

words'' :: [Text] -> Text -> [Text] Source #

Quote-and-prefix-aware version of words - don't split on spaces which are inside quotes, including quotes which may have one of the specified prefixes in front, and maybe an additional not: prefix in front of that.

queryprefixes :: [Text] Source #

parseQueryTerm :: Day -> Text -> Either String (Query, [QueryOpt]) Source #

Parse a single query term as either a query or a query option, or return an error message if parsing fails.

parseAccountType :: Bool -> Text -> Either String AccountType Source #

Case-insensitively parse one single-letter code, or one long-form word if permitted, to an account type. On failure, returns the unparseable text.

simplifyQuery :: Query -> Query Source #

filterQuery :: (Query -> Bool) -> Query -> Query Source #

Remove query terms (or whole sub-expressions) from this query which do not match the given predicate. XXX Semantics not completely clear. Also calls simplifyQuery on the result.

filterQueryOrNotQuery :: (Query -> Bool) -> Query -> Query Source #

Remove query terms (or whole sub-expressions) from this query which match neither the given predicate nor that predicate negated (eg, if predicate is queryIsAcct, this will keep both "acct:" and "not:acct:" terms). Also calls simplifyQuery on the result. (Since 1.24.1, might be merged into filterQuery in future.) XXX Semantics not completely clear.

matchesQuery :: (Query -> Bool) -> Query -> Bool Source #

Does this simple query predicate match any part of this possibly compound query ?

queryIsNull :: Query -> Bool Source #

Does this query match everything ?

queryIsDate :: Query -> Bool Source #

Is this a simple query of this type (date:) ? Does not match a compound query involving andornot. Likewise for the following functions.

queryIsDate2 :: Query -> Bool Source #

queryIsDateOrDate2 :: Query -> Bool Source #

queryIsStatus :: Query -> Bool Source #

queryIsCode :: Query -> Bool Source #

queryIsDesc :: Query -> Bool Source #

queryIsTag :: Query -> Bool Source #

queryIsAcct :: Query -> Bool Source #

queryIsType :: Query -> Bool Source #

queryIsDepth :: Query -> Bool Source #

queryIsReal :: Query -> Bool Source #

queryIsAmt :: Query -> Bool Source #

queryIsSym :: Query -> Bool Source #

queryIsStartDateOnly :: Bool -> Query -> Bool Source #

Does this query specify a start date and nothing else (that would filter postings prior to the date) ? When the flag is true, look for a starting secondary date instead.

queryIsTransactionRelated :: Query -> Bool Source #

Does this query involve a property of transactions (or their postings), making it inapplicable to account declarations ?

queryStartDate :: Bool -> Query -> Maybe Day Source #

What start date (or secondary date) does this query specify, if any ? For OR expressions, use the earliest of the dates. NOT is ignored.

queryEndDate :: Bool -> Query -> Maybe Day Source #

What end date (or secondary date) does this query specify, if any ? For OR expressions, use the latest of the dates. NOT is ignored.

queryDateSpan :: Bool -> Query -> DateSpan Source #

What date span (or with a true argument, what secondary date span) does this query specify ? OR clauses specifying multiple spans return their union (the span enclosing all of them). AND clauses specifying multiple spans return their intersection. NOT clauses are ignored.

queryDateSpan' :: Query -> DateSpan Source #

What date span does this query specify, treating primary and secondary dates as equivalent ? OR clauses specifying multiple spans return their union (the span enclosing all of them). AND clauses specifying multiple spans return their intersection. NOT clauses are ignored.

queryDepth :: Query -> Maybe Int Source #

The depth limit this query specifies, if it has one

inAccount :: [QueryOpt] -> Maybe (AccountName, Bool) Source #

The account we are currently focussed on, if any, and whether subaccounts are included. Just looks at the first query option.

inAccountQuery :: [QueryOpt] -> Maybe Query Source #

A query for the account(s) we are currently focussed on, if any. Just looks at the first query option.

matchesCommodity :: Query -> CommoditySymbol -> Bool Source #

matchesAmount :: Query -> Amount -> Bool Source #

Does the match expression match this (simple) amount ?

matchesMixedAmount :: Query -> MixedAmount -> Bool Source #

matchesAccount :: Query -> AccountName -> Bool Source #

Does the query match this account name ? A matching in: clause is also considered a match.

matchesAccountExtra :: (AccountName -> Maybe AccountType) -> (AccountName -> [Tag]) -> Query -> AccountName -> Bool Source #

Like matchesAccount, but with optional extra matching features:

- If the account's type is provided, any type: terms in the query must match it (and any negated type: terms must not match it).
- If the account's tags are provided, any tag: terms must match at least one of them (and any negated tag: terms must match none).

matchesPosting :: Query -> Posting -> Bool Source #

Does the match expression match this posting ? When matching account name, and the posting has been transformed in some way, we will match either the original or transformed name.

matchesPostingExtra :: (AccountName -> Maybe AccountType) -> Query -> Posting -> Bool Source #

Like matchesPosting, but if the posting's account's type is provided, any type: terms in the query must match it (and any negated type: terms must not match it).

matchesTransaction :: Query -> Transaction -> Bool Source #

Does the match expression match this transaction ?

matchesTransactionExtra :: (AccountName -> Maybe AccountType) -> Query -> Transaction -> Bool Source #

Like matchesTransaction, but if the journal's account types are provided, any type: terms in the query must match at least one posting's account type (and any negated type: terms must match none).

matchesDescription :: Query -> Text -> Bool Source #

Does the query match this transaction description ? Tests desc: terms, any other terms are ignored.

matchesPayeeWIP :: Query -> Payee -> Bool Source #

Does the query match this transaction payee ? Tests desc: (and payee: ?) terms, any other terms are ignored. XXX Currently an alias for matchDescription. I'm not sure if more is needed, There's some shenanigan with payee: and "payeeTag" to figure out.

matchesTags :: Regexp -> Maybe Regexp -> [Tag] -> Bool Source #

Does the query match the name and optionally the value of any of these tags ?

matchesPriceDirective :: Query -> PriceDirective -> Bool Source #

Does the query match this market price ?

tests_Query :: TestTree Source #

modifyTransactions :: (AccountName -> Maybe AccountType) -> (AccountName -> [Tag]) -> Map CommoditySymbol AmountStyle -> Day -> Bool -> [TransactionModifier] -> [Transaction] -> Either String [Transaction] Source #

Apply all the given transaction modifiers, in turn, to each transaction. Or if any of them fails to be parsed, return the first error. A reference date is provided to help interpret relative dates in transaction modifier queries.

timeclockEntriesToTransactions :: LocalTime -> [TimeclockEntry] -> [Transaction] Source #

Convert time log entries to journal transactions. When there is no clockout, add one with the provided current time. Sessions crossing midnight are split into days to give accurate per-day totals.

tests_Timeclock :: TestTree Source #

makeAccountTagErrorExcerpt :: (AccountName, AccountDeclarationInfo) -> TagName -> (FilePath, Int, Maybe (Int, Maybe Int), Text) Source #

Given an account name and its account directive, and a problem tag within the latter: render it as a megaparsec-style excerpt, showing the original line number and marked column or region. Returns the file path, line number, column(s) if known, and the rendered excerpt, or as much of these as is possible. The returned columns will be accurate for the rendered error message but not for the original journal data.

makeTransactionErrorExcerpt :: Transaction -> (Transaction -> Maybe (Int, Maybe Int)) -> (FilePath, Int, Maybe (Int, Maybe Int), Text) Source #

Given a problem transaction and a function calculating the best column(s) for marking the error region: render it as a megaparsec-style excerpt, showing the original line number on the transaction line, and a column(s) marker. Returns the file path, line number, column(s) if known, and the rendered excerpt, or as much of these as is possible. The returned columns will be accurate for the rendered error message but not for the original journal data.

makePostingErrorExcerpt :: Posting -> (Posting -> Transaction -> Text -> Maybe (Int, Maybe Int)) -> (FilePath, Int, Maybe (Int, Maybe Int), Text) Source #

Given a problem posting and a function calculating the best column(s) for marking the error region: look up error info from the parent transaction, and render the transaction as a megaparsec-style excerpt, showing the original line number on the problem posting's line, and a column indicator. Returns the file path, line number, column(s) if known, and the rendered excerpt, or as much of these as is possible. A limitation: columns will be accurate for the rendered error message but not for the original journal data.

transactionFindPostingIndex :: (Posting -> Bool) -> Transaction -> Maybe Int Source #

Find the 1-based index of the first posting in this transaction satisfying the given predicate.

makePostingAccountErrorExcerpt :: Posting -> (FilePath, Int, Maybe (Int, Maybe Int), Text) Source #

From the given posting, make an error excerpt showing the transaction with this posting's account part highlighted.

makeBalanceAssertionErrorExcerpt :: Posting -> (FilePath, Int, Maybe (Int, Maybe Int), Text) Source #

From the given posting, make an error excerpt showing the transaction with the balance assertion highlighted.

journalCheckOrdereddates :: WhichDate -> Journal -> Either String () Source #

runPeriodicTransaction :: Bool -> PeriodicTransaction -> DateSpan -> [Transaction] Source #

Generate transactions from `PeriodicTransaction` within a `DateSpan`. This should be a closed span with both start and end dates specified; an open ended span will generate no transactions.

Note that new transactions require `txnTieKnot` post-processing. The new transactions will have three tags added: - a recur:PERIODICEXPR tag whose value is the generating periodic expression - a generated-transaction: tag - a hidden _generated-transaction: tag which does not appear in the comment.

    >>> import Data.Time (fromGregorian)
    >>> _ptgen "monthly from 2017/1 to 2017/4"
    2017-01-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/4
        a           $1.00

    2017-02-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/4
        a           $1.00

    2017-03-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/4
        a           $1.00

    >>> _ptgen "monthly from 2017/1 to 2017/5"
    2017-01-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/5
        a           $1.00

    2017-02-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/5
        a           $1.00

    2017-03-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/5
        a           $1.00

    2017-04-01
        ; generated-transaction: ~ monthly from 2017/1 to 2017/5
        a           $1.00

    >>> _ptgen "every 2nd day of month from 2017/02 to 2017/04"
    2017-01-02
        ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04
        a           $1.00

    2017-02-02
        ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04
        a           $1.00

    2017-03-02
        ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04
        a           $1.00

    >>> _ptgen "every 30th day of month from 2017/1 to 2017/5"
    2016-12-30
        ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5
        a           $1.00

    2017-01-30
        ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5
        a           $1.00

    2017-02-28
        ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5
        a           $1.00

    2017-03-30
        ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5
        a           $1.00

    2017-04-30
        ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5
        a           $1.00

    >>> _ptgen "every 2nd Thursday of month from 2017/1 to 2017/4"
    2016-12-08
        ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4
        a           $1.00

    2017-01-12
        ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4
        a           $1.00

    2017-02-09
        ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4
        a           $1.00

    2017-03-09
        ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4
        a           $1.00

    >>> _ptgen "every nov 29th from 2017 to 2019"
    2016-11-29
        ; generated-transaction: ~ every nov 29th from 2017 to 2019
        a           $1.00

    2017-11-29
        ; generated-transaction: ~ every nov 29th from 2017 to 2019
        a           $1.00

    2018-11-29
        ; generated-transaction: ~ every nov 29th from 2017 to 2019
        a           $1.00

    >>> _ptgen "2017/1"
    2017-01-01
        ; generated-transaction: ~ 2017/1
        a           $1.00

    >>> let reportperiod="daily from 2018/01/03" in let (i,s) = parsePeriodExpr' nulldate reportperiod in runPeriodicTransaction True (nullperiodictransaction{ptperiodexpr=reportperiod, ptspan=s, ptinterval=i, ptpostings=["a" `post` usd 1]}) (DateSpan (Just $ Flex $ fromGregorian 2018 01 01) (Just $ Flex $ fromGregorian 2018 01 03))
    []

    >>> _ptgenspan "every 3 months from 2019-05" (DateSpan (Just $ Flex $ fromGregorian 2020 01 01) (Just $ Flex $ fromGregorian 2020 02 01))

    >>> _ptgenspan "every 3 months from 2019-05" (DateSpan (Just $ Flex $ fromGregorian 2020 02 01) (Just $ Flex $ fromGregorian 2020 03 01))
    2020-02-01
        ; generated-transaction: ~ every 3 months from 2019-05
        a           $1.00

    >>> _ptgenspan "every 3 days from 2018" (DateSpan (Just $ Flex $ fromGregorian 2018 01 01) (Just $ Flex $ fromGregorian 2018 01 05))
    2018-01-01
        ; generated-transaction: ~ every 3 days from 2018
        a           $1.00

    2018-01-04
        ; generated-transaction: ~ every 3 days from 2018
        a           $1.00

    >>> _ptgenspan "every 3 days from 2018" (DateSpan (Just $ Flex $ fromGregorian 2018 01 02) (Just $ Flex $ fromGregorian 2018 01 05))
    2018-01-04
        ; generated-transaction: ~ every 3 days from 2018
        a           $1.00

checkPeriodicTransactionStartDate :: Interval -> DateSpan -> Text -> Maybe String Source #

Check that this date span begins at a boundary of this interval, or return an explanatory error message including the provided period expression (from which the span and interval are derived).

toJsonText :: ToJSON a => a -> Text Source #

Show a JSON-convertible haskell value as pretty-printed JSON text.

writeJsonFile :: ToJSON a => FilePath -> a -> IO () Source #

Write a JSON-convertible haskell value to a pretty-printed JSON file. Eg: writeJsonFile "a.json" nulltransaction

readJsonFile :: FromJSON a => FilePath -> IO a Source #

Read a JSON file and decode it to the target type, or raise an error if we can't. Eg: readJsonFile "a.json" :: IO Transaction

journalConcat :: Journal -> Journal -> Journal Source #

Merge two journals into one. Transaction counts are summed, map fields are combined, the second's list fields are appended to the first's, the second's parse state is kept.

journalRenumberAccountDeclarations :: Journal -> Journal Source #

Renumber all the account declarations. This is useful to call when finalising or concatenating Journals, to give account declarations a total order across files.

dbgJournalAcctDeclOrder :: String -> Journal -> Journal Source #

Debug log the ordering of a journal's account declarations (at debug level 5+).

nulljournal :: Journal Source #

journalFilePath :: Journal -> FilePath Source #

journalFilePaths :: Journal -> [FilePath] Source #

addTransaction :: Transaction -> Journal -> Journal Source #

addTransactionModifier :: TransactionModifier -> Journal -> Journal Source #

addPeriodicTransaction :: PeriodicTransaction -> Journal -> Journal Source #

addPriceDirective :: PriceDirective -> Journal -> Journal Source #

journalTransactionAt :: Journal -> Integer -> Maybe Transaction Source #

Get the transaction with this index (its 1-based position in the input stream), if any.

journalNextTransaction :: Journal -> Transaction -> Maybe Transaction Source #

Get the transaction that appeared immediately after this one in the input stream, if any.

journalPrevTransaction :: Journal -> Transaction -> Maybe Transaction Source #

Get the transaction that appeared immediately before this one in the input stream, if any.

journalPostings :: Journal -> [Posting] Source #

All postings from this journal's transactions, in order.

journalCommoditiesDeclared :: Journal -> [CommoditySymbol] Source #

Sorted unique commodity symbols declared by commodity directives in this journal.

journalCommodities :: Journal -> Set CommoditySymbol Source #

Sorted unique commodity symbols declared or inferred from this journal.

journalDescriptions :: Journal -> [Text] Source #

Unique transaction descriptions used in this journal.

journalPayeesDeclared :: Journal -> [Payee] Source #

Sorted unique payees declared by payee directives in this journal.

journalPayeesUsed :: Journal -> [Payee] Source #

Sorted unique payees used by transactions in this journal.

journalPayeesDeclaredOrUsed :: Journal -> [Payee] Source #

Sorted unique payees used in transactions or declared by payee directives in this journal.

journalTagsDeclared :: Journal -> [TagName] Source #

Sorted unique tag names declared by tag directives in this journal.

journalTagsUsed :: Journal -> [TagName] Source #

Sorted unique tag names used in this journal (in account directives, transactions, postings..)

journalTagsDeclaredOrUsed :: Journal -> [TagName] Source #

Sorted unique tag names used in transactions or declared by tag directives in this journal.

journalAccountNamesUsed :: Journal -> [AccountName] Source #

Sorted unique account names posted to by this journal's transactions.

journalAccountNamesImplied :: Journal -> [AccountName] Source #

Sorted unique account names implied by this journal's transactions - accounts posted to and all their implied parent accounts.

journalAccountNamesDeclared :: Journal -> [AccountName] Source #

Sorted unique account names declared by account directives in this journal.

journalLeafAccountNamesDeclared :: Journal -> [AccountName] Source #

Sorted unique account names declared by account directives in this journal, which have no children.

journalAccountNamesDeclaredOrUsed :: Journal -> [AccountName] Source #

Sorted unique account names declared by account directives or posted to by transactions in this journal.

journalAccountNamesDeclaredOrImplied :: Journal -> [AccountName] Source #

Sorted unique account names declared by account directives, or posted to or implied as parents by transactions in this journal.

journalAccountNames :: Journal -> [AccountName] Source #

Convenience/compatibility alias for journalAccountNamesDeclaredOrImplied.

journalLeafAccountNames :: Journal -> [AccountName] Source #

Sorted unique account names declared or implied in this journal which have no children.

journalAccountNameTree :: Journal -> Tree AccountName Source #

journalAccountTags :: Journal -> AccountName -> [Tag] Source #

Which tags have been declared explicitly for this account, if any ?

journalInheritedAccountTags :: Journal -> AccountName -> [Tag] Source #

Which tags are in effect for this account, including tags inherited from parent accounts ?

journalTransactionsSimilarTo :: Journal -> Text -> Query -> SimilarityScore -> Int -> [(DateWeightedSimilarityScore, Age, SimilarityScore, Transaction)] Source #

Find up to N most similar and most recent transactions matching the given transaction description and query and exceeding the given description similarity score (0 to 1, see compareDescriptions). Returns transactions along with their age in days compared to the latest transaction date, their description similarity score, and a heuristically date-weighted variant of this that favours more recent transactions.

journalConversionAccount :: Journal -> AccountName Source #

The `AccountName` to use for automatically generated conversion postings.

journalAccountType :: Journal -> AccountName -> Maybe AccountType Source #

journalAddAccountTypes :: Journal -> Journal Source #

Add a map of all known account types to the journal.

journalAccountTypes :: Journal -> Map AccountName AccountType Source #

Build a map of all known account types, explicitly declared or inferred from the account's parent or name.

journalPostingsAddAccountTags :: Journal -> Journal Source #

To all postings in the journal, add any tags from their account (including those inherited from parent accounts). If the same tag exists on posting and account, the latter is ignored.

filterJournalTransactions :: Query -> Journal -> Journal Source #

Keep only transactions matching the query expression.

filterJournalPostings :: Query -> Journal -> Journal Source #

Keep only postings matching the query expression. This can leave unbalanced transactions.

filterJournalRelatedPostings :: Query -> Journal -> Journal Source #

Keep only postings which do not match the query expression, but for which a related posting does. This can leave unbalanced transactions.

filterJournalAmounts :: Query -> Journal -> Journal Source #

Within each posting's amount, keep only the parts matching the query, and remove any postings with all amounts removed. This can leave unbalanced transactions.

filterTransactionAmounts :: Query -> Transaction -> Transaction Source #

Filter out all parts of this transaction's amounts which do not match the query, and remove any postings with all amounts removed. This can leave the transaction unbalanced.

filterPostingAmount :: Query -> Posting -> Maybe Posting Source #

Filter out all parts of this posting's amount which do not match the query, and remove the posting if this removes all amounts.

filterTransactionPostings :: Query -> Transaction -> Transaction Source #

filterTransactionPostingsExtra :: (AccountName -> Maybe AccountType) -> Query -> Transaction -> Transaction Source #

filterTransactionRelatedPostings :: Query -> Transaction -> Transaction Source #

journalMapTransactions :: (Transaction -> Transaction) -> Journal -> Journal Source #

Apply a transformation to a journal's transactions.

journalMapPostings :: (Posting -> Posting) -> Journal -> Journal Source #

Apply a transformation to a journal's postings.

journalMapPostingAmounts :: (MixedAmount -> MixedAmount) -> Journal -> Journal Source #

Apply a transformation to a journal's posting amounts.

journalReverse :: Journal -> Journal Source #

Reverse all lists of parsed items, which during parsing were prepended to, so that the items are in parse order. Part of post-parse finalisation.

journalSetLastReadTime :: POSIXTime -> Journal -> Journal Source #

Set this journal's last read time, ie when its files were last read.

journalNumberAndTieTransactions :: Journal -> Journal Source #

journalNumberTransactions :: Journal -> Journal Source #

Number (set the tindex field) this journal's transactions, counting upward from 1.

journalUntieTransactions :: Transaction -> Transaction Source #

Untie all transaction-posting knots in this journal, so that eg recursiveSize and GHCI's :sprint can work on it.

journalModifyTransactions :: Bool -> Day -> Journal -> Either String Journal Source #

Apply any transaction modifier rules in the journal (adding automated postings to transactions, eg). Or if a modifier rule fails to parse, return the error message. A reference date is provided to help interpret relative dates in transaction modifier queries. The first argument selects whether to add visible tags to generated postings & modified transactions.

journalApplyCommodityStyles :: Journal -> Either String Journal Source #

Choose and apply a consistent display style to the posting amounts in each commodity (see journalCommodityStyles). Can return an error message eg if inconsistent number formats are found.

journalCommodityStyles :: Journal -> Map CommoditySymbol AmountStyle Source #

Get the canonical amount styles for this journal, whether (in order of precedence): set globally in InputOpts, declared by commodity directives, declared by a default commodity (D) directive, or inferred from posting amounts, as a map from symbol to style. Styles from directives are assumed to specify the decimal mark.

commodityStylesFromAmounts :: [Amount] -> Either String (Map CommoditySymbol AmountStyle) Source #

Given a list of amounts, in parse order (roughly speaking; see journalStyleInfluencingAmounts), build a map from their commodity names to standard commodity display formats. Can return an error message eg if inconsistent number formats are found.

Though, these amounts may have come from multiple files, so we shouldn't assume they use consistent number formats. Currently we don't enforce that even within a single file, and this function never reports an error.

canonicalStyleFrom :: [AmountStyle] -> AmountStyle Source #

Given a list of amount styles (assumed to be from parsed amounts in a single commodity), in parse order, choose a canonical style.

journalInferMarketPricesFromTransactions :: Journal -> Journal Source #

Infer transaction-implied market prices from commodity-exchanging transactions, if any. It's best to call this after transactions have been balanced and posting amounts have appropriate prices attached.

journalToCost :: ConversionOp -> Journal -> Journal Source #

Convert all this journal's amounts to cost using the transaction prices, if any. The journal's commodity styles are applied to the resulting amounts.

journalAddInferredEquityPostings :: Bool -> Journal -> Journal Source #

Add inferred equity postings to a `Journal` using transaction prices.

journalInferCostsFromEquity :: Journal -> Either String Journal Source #

Add costs inferred from equity conversion postings, where needed and possible. See hledger manual > Inferring cost from equity postings.

journalMarkRedundantCosts :: Journal -> Either String Journal Source #

Do just the internal tagging that is normally done by journalInferCostsFromEquity, identifying equity conversion postings and, in particular, postings which have redundant costs. Tagging the latter is useful as it allows them to be ignored during transaction balancedness checking. And that allows journalInferCostsFromEquity to be postponed till after transaction balancing, when it will have more information (amounts) to work with.

journalDateSpan :: Bool -> Journal -> DateSpan Source #

The fully specified exact date span enclosing the dates (primary or secondary) of all this journal's transactions and postings, or DateSpan Nothing Nothing if there are none.

journalDateSpanBothDates :: Journal -> DateSpan Source #

The fully specified date span enclosing the dates (primary and secondary) of all this journal's transactions and postings, or DateSpan Nothing Nothing if there are none.

journalStartDate :: Bool -> Journal -> Maybe Day Source #

The earliest of this journal's transaction and posting dates, or Nothing if there are none.

journalEndDate :: Bool -> Journal -> Maybe Day Source #

The "exclusive end date" of this journal: the day following its latest transaction or posting date, or Nothing if there are none.

journalLastDay :: Bool -> Journal -> Maybe Day Source #

The latest of this journal's transaction and posting dates, or Nothing if there are none.

journalPivot :: Text -> Journal -> Journal Source #

Apply the pivot transformation to all postings in a journal, replacing their account name by their value for the given field or tag.

journalApplyAliases :: [AccountAlias] -> Journal -> Either RegexError Journal Source #

Apply some account aliases to all posting account names in the journal, as described by accountNameApplyAliases. This can fail due to a bad replacement pattern in a regular expression alias.

samplejournal :: Journal Source #

samplejournalMaybeExplicit :: Bool -> Journal Source #

tests_Journal :: TestTree Source #

journalCheckUniqueleafnames :: Journal -> Either String () Source #

Check that all the journal's postings are to accounts with a unique leaf name. Otherwise, return an error message for the first offending posting.

journalCheckAccounts :: Journal -> Either String () Source #

Check that all the journal's postings are to accounts with account directives, returning an error message otherwise.

journalCheckCommodities :: Journal -> Either String () Source #

Check that all the commodities used in this journal's postings have been declared by commodity directives, returning an error message otherwise.

journalCheckPayees :: Journal -> Either String () Source #

Check that all the journal's transactions have payees declared with payee directives, returning an error message otherwise.

journalCheckTags :: Journal -> Either String () Source #

Check that all the journal's tags (on accounts, transactions, postings..) have been declared with tag directives, returning an error message otherwise.

journalCheckPairedConversionPostings :: Journal -> Either String () Source #

In each tranaction, check that any conversion postings occur in adjacent pairs.

journalCheckRecentAssertions :: Day -> Journal -> Either String () Source #

Check that all the journal's accounts with balance assertions have an assertion no more than 7 days before their latest posting. Today's date is provided for error messages.

defbalancingopts :: BalancingOpts Source #

isTransactionBalanced :: BalancingOpts -> Transaction -> Bool Source #

Legacy form of transactionCheckBalanced.

balanceTransaction :: BalancingOpts -> Transaction -> Either String Transaction Source #

Balance this transaction, ensuring that its postings (and its balanced virtual postings) sum to 0, by inferring a missing amount or conversion price(s) if needed. Or if balancing is not possible, because the amounts don't sum to 0 or because there's more than one missing amount, return an error message.

Transactions with balance assignments can have more than one missing amount; to balance those you should use the more powerful journalBalanceTransactions.

The "sum to 0" test is done using commodity display precisions, if provided, so that the result agrees with the numbers users can see.

balanceTransactionHelper :: BalancingOpts -> Transaction -> Either String (Transaction, [(AccountName, MixedAmount)]) Source #

Helper used by balanceTransaction and balanceTransactionWithBalanceAssignmentAndCheckAssertionsB; use one of those instead. It also returns a list of accounts and amounts that were inferred.

journalCheckBalanceAssertions :: Journal -> Maybe String Source #

Check any balance assertions in the journal and return an error message if any of them fail (or if the transaction balancing they require fails).

journalBalanceTransactions :: BalancingOpts -> Journal -> Either String Journal Source #

Infer any missing amounts and/or conversion costs (as needed to balance transactions and satisfy balance assignments); and check that all transactions are balanced; and (optional) check that all balance assertions pass. Or, return an error message (just the first error encountered).

Assumes journalInferCommodityStyles has been called, since those affect transaction balancing.

This does multiple things at once because amount inferring, balance assignments, balance assertions and posting dates are interdependent.

tests_Balancing :: TestTree Source #

definputopts :: InputOpts Source #

forecastPeriod :: InputOpts -> Journal -> Maybe DateSpan Source #

Get the Maybe the DateSpan to generate forecast options from. This begins on: - the start date supplied to the `--forecast` argument, if present - otherwise, the later of - the report start date if specified with -b-pdate: - the day after the latest normal (non-periodic) transaction in the journal, if any - otherwise today. It ends on: - the end date supplied to the `--forecast` argument, if present - otherwise the report end date if specified with -e-pdate: - otherwise 180 days (6 months) from today.

nullacct :: Account Source #

accountsFromPostings :: [Posting] -> [Account] Source #

Derive 1. an account tree and 2. each account's total exclusive and inclusive changes from a list of postings. This is the core of the balance command (and of *ledger). The accounts are returned as a list in flattened tree order, and also reference each other as a tree. (The first account is the root of the tree.)

accountTree :: AccountName -> [AccountName] -> Account Source #

Convert a list of account names to a tree of Account objects, with just the account names filled in. A single root account with the given name is added.

parentAccounts :: Account -> [Account] Source #

Get this account's parent accounts, from the nearest up to the root.

accountsLevels :: Account -> [[Account]] Source #

List the accounts at each level of the account tree.

mapAccounts :: (Account -> Account) -> Account -> Account Source #

Map a (non-tree-structure-modifying) function over this and sub accounts.

anyAccounts :: (Account -> Bool) -> Account -> Bool Source #

Is the predicate true on any of this account or its subaccounts ?

sumAccounts :: Account -> Account Source #

Add subaccount-inclusive balances to an account tree.

clipAccounts :: Int -> Account -> Account Source #

Remove all subaccounts below a certain depth.

clipAccountsAndAggregate :: Maybe Int -> [Account] -> [Account] Source #

Remove subaccounts below the specified depth, aggregating their balance at the depth limit (accounts at the depth limit will have any sub-balances merged into their exclusive balance). If the depth is Nothing, return the original accounts

pruneAccounts :: (Account -> Bool) -> Account -> Maybe Account Source #

Remove all leaf accounts and subtrees matching a predicate.

flattenAccounts :: Account -> [Account] Source #

Flatten an account tree into a list, which is sometimes convenient. Note since accounts link to their parents/subs, the tree's structure remains intact and can still be used. It's a tree/list!

filterAccounts :: (Account -> Bool) -> Account -> [Account] Source #

Filter an account tree (to a list).

sortAccountTreeByAmount :: NormalSign -> Account -> Account Source #

Sort each group of siblings in an account tree by inclusive amount, so that the accounts with largest normal balances are listed first. The provided normal balance sign determines whether normal balances are negative or positive, affecting the sort order. Ie, if balances are normally negative, then the most negative balances sort first, and vice versa.

accountSetDeclarationInfo :: Journal -> Account -> Account Source #

Add extra info for this account derived from the Journal's account directives, if any (comment, tags, declaration order..).

sortAccountNamesByDeclaration :: Journal -> Bool -> [AccountName] -> [AccountName] Source #

Sort account names by the order in which they were declared in the journal, at each level of the account tree (ie within each group of siblings). Undeclared accounts are sorted last and alphabetically. This is hledger's default sort for reports organised by account. The account list is converted to a tree temporarily, adding any missing parents; these can be kept (suitable for a tree-mode report) or removed (suitable for a flat-mode report).

lookupAccount :: AccountName -> [Account] -> Maybe Account Source #

Search an account list by name.

printAccounts :: Account -> IO () Source #

showAccounts :: Account -> String Source #

showAccountsBoringFlag :: Account -> String Source #

nullledger :: Ledger Source #

ledgerFromJournal :: Query -> Journal -> Ledger Source #

Filter a journal's transactions with the given query, then build a Ledger, containing the journal plus the tree of all its accounts with their subaccount-inclusive and subaccount-exclusive balances. If the query includes a depth limit, the ledger's journal will be depth limited, but the ledger's account tree will not.

ledgerAccountNames :: Ledger -> [AccountName] Source #

List a ledger's account names.

ledgerAccount :: Ledger -> AccountName -> Maybe Account Source #

Get the named account from a ledger.

ledgerRootAccount :: Ledger -> Account Source #

Get this ledger's root account, which is a dummy "root" account above all others. This should always be first in the account list, if somehow not this returns a null account.

ledgerTopAccounts :: Ledger -> [Account] Source #

List a ledger's top-level accounts (the ones below the root), in tree order.

ledgerLeafAccounts :: Ledger -> [Account] Source #

List a ledger's bottom-level (subaccount-less) accounts, in tree order.

ledgerPostings :: Ledger -> [Posting] Source #

List a ledger's postings, in the order parsed.

ledgerDateSpan :: Ledger -> DateSpan Source #

The (fully specified) date span containing all the ledger's (filtered) transactions, or DateSpan Nothing Nothing if there are none.

ledgerCommodities :: Ledger -> [CommoditySymbol] Source #

All commodities used in this ledger.

tests_Ledger :: TestTree Source #

tests_Data :: TestTree Source #

defreportopts :: ReportOpts Source #

rawOptsToReportOpts :: Day -> RawOpts -> ReportOpts Source #

Generate a ReportOpts from raw command-line input, given a day. This will fail with a usage error if it is passed - an invalid --format argument, - an invalid --value argument, - if --valuechange is called with a valuation type other than -V/--value=end. - an invalid --pretty argument,

defreportspec :: ReportSpec Source #

setDefaultConversionOp :: ConversionOp -> ReportSpec -> ReportSpec Source #

Set the default ConversionOp.

balanceAccumulationOverride :: RawOpts -> Maybe BalanceAccumulation Source #

intervalFromRawOpts :: RawOpts -> Interval Source #

Get the report interval, if any, specified by the last of -p/--period, -D--daily, -W--weekly, -M/--monthly etc. options. An interval from --period counts only if it is explicitly defined.

simplifyStatuses :: Ord a => [a] -> [a] Source #

Reduce a list of statuses to just one of each status, and if all statuses are present return the empty list.

reportOptsToggleStatus :: Status -> ReportOpts -> ReportOpts Source #

Add/remove this status from the status list. Used by hledger-ui.

transactionDateFn :: ReportOpts -> Transaction -> Day Source #

Select the Transaction date accessor based on --date2.

postingDateFn :: ReportOpts -> Posting -> Day Source #

Select the Posting date accessor based on --date2.

whichDate :: ReportOpts -> WhichDate Source #

Report which date we will report on based on --date2.

tree_ :: ReportOpts -> Bool Source #

Legacy-compatible convenience aliases for accountlistmode_.

flat_ :: ReportOpts -> Bool Source #

journalValueAndFilterPostings :: ReportSpec -> Journal -> Journal Source #

Convert a `Journal'`s amounts to cost and/or to value (see `journalApplyValuationFromOpts`), and filter by the `ReportSpec` `Query`.

We make sure to first filter by amt: and cur: terms, then value the `Journal`, then filter by the remaining terms.

journalValueAndFilterPostingsWith :: ReportSpec -> Journal -> PriceOracle -> Journal Source #

Like `journalValueAndFilterPostings`, but takes a `PriceOracle` as an argument.

journalApplyValuationFromOpts :: ReportSpec -> Journal -> Journal Source #

Convert this journal's postings' amounts to cost and/or to value, if specified by options (-B--cost-V-X--value etc.). Strip prices if not needed. This should be the main stop for performing costing and valuation. The exception is whenever you need to perform valuation _after_ summing up amounts, as in a historical balance report with --value=end. valuationAfterSum will check for this condition.

journalApplyValuationFromOptsWith :: ReportSpec -> Journal -> PriceOracle -> Journal Source #

Like journalApplyValuationFromOpts, but takes PriceOracle as an argument.

mixedAmountApplyValuationAfterSumFromOptsWith :: ReportOpts -> Journal -> PriceOracle -> DateSpan -> MixedAmount -> MixedAmount Source #

Select the Account valuation functions required for performing valuation after summing amounts. Used in MultiBalanceReport to value historical and similar reports.

valuationAfterSum :: ReportOpts -> Maybe (Maybe CommoditySymbol) Source #

If the ReportOpts specify that we are performing valuation after summing amounts, return Just of the commodity symbol we're converting to, Just Nothing for the default, and otherwise return Nothing. Used for example with historical reports with --value=end.

queryFromFlags :: ReportOpts -> Query Source #

Convert report options to a query, ignoring any non-flag command line arguments.

reportSpan :: Journal -> ReportSpec -> (DateSpan, [DateSpan]) Source #

The effective report span is the start and end dates specified by options or queries, or otherwise the earliest and latest transaction or posting dates in the journal. If no dates are specified by options/queries and the journal is empty, returns the null date span. Also return the intervals if they are requested.

reportSpanBothDates :: Journal -> ReportSpec -> (DateSpan, [DateSpan]) Source #

Like reportSpan, but uses both primary and secondary dates when calculating the span.

reportStartDate :: Journal -> ReportSpec -> Maybe Day Source #

reportEndDate :: Journal -> ReportSpec -> Maybe Day Source #

reportPeriodStart :: ReportSpec -> Maybe Day Source #

reportPeriodOrJournalStart :: ReportSpec -> Journal -> Maybe Day Source #

reportPeriodLastDay :: ReportSpec -> Maybe Day Source #

reportPeriodOrJournalLastDay :: ReportSpec -> Journal -> Maybe Day Source #

reportPeriodName :: BalanceAccumulation -> [DateSpan] -> DateSpan -> Text Source #

Make a name for the given period in a multiperiod report, given the type of balance being reported and the full set of report periods. This will be used as a column heading (or row heading, in a register summary report). We try to pick a useful name as follows:

- ending-balance reports: the period's end date
- balance change reports where the periods are months and all in the same year: the short month name in the current locale
- all other balance change reports: a description of the datespan, abbreviated to compact form if possible (see showDateSpan).

overEither :: ((a -> Either e b) -> s -> Either e t) -> (a -> b) -> s -> Either e t Source #

Apply a function over a lens, but report on failure.

setEither :: ((a -> Either e b) -> s -> Either e t) -> b -> s -> Either e t Source #

Set a field using a lens, but report on failure.

reportOptsToSpec :: Day -> ReportOpts -> Either String ReportSpec Source #

Generate a ReportSpec from a set of ReportOpts on a given day.

updateReportSpec :: ReportOpts -> ReportSpec -> Either String ReportSpec Source #

Update the ReportOpts and the fields derived from it in a ReportSpec, or return an error message if there is a problem such as missing or unparseable options data. This is the safe way to change a ReportSpec, ensuring that all fields (_rsQuery, _rsReportOpts, querystring_, etc.) are in sync.

updateReportSpecWith :: (ReportOpts -> ReportOpts) -> ReportSpec -> Either String ReportSpec Source #

Like updateReportSpec, but takes a ReportOpts-modifying function.

rawOptsToReportSpec :: Day -> RawOpts -> Either String ReportSpec Source #

Generate a ReportSpec from RawOpts and a provided day, or return an error string if there are regular expression errors.

prrAdd :: Semigroup b => PeriodicReportRow a b -> PeriodicReportRow a b -> PeriodicReportRow a b Source #

Add two `PeriodicReportRows`, preserving the name of the first.

periodicReportSpan :: PeriodicReport a b -> DateSpan Source #

Figure out the overall date span of a PeriodicReport

prMapName :: (a -> b) -> PeriodicReport a c -> PeriodicReport b c Source #

Map a function over the row names.

prMapMaybeName :: (a -> Maybe b) -> PeriodicReport a c -> PeriodicReport b c Source #

Map a function over the row names, possibly discarding some.

flatDisplayName :: AccountName -> DisplayName Source #

Construct a flat display name, where the full name is also displayed at depth 1

treeDisplayName :: AccountName -> DisplayName Source #

Construct a tree display name, where only the leaf is displayed at its given depth

prrFullName :: PeriodicReportRow DisplayName a -> AccountName Source #

Get the full, canonical, name of a PeriodicReportRow tagged by a DisplayName.

prrDisplayName :: PeriodicReportRow DisplayName a -> AccountName Source #

Get the display name of a PeriodicReportRow tagged by a DisplayName.

prrDepth :: PeriodicReportRow DisplayName a -> Int Source #

Get the display depth of a PeriodicReportRow tagged by a DisplayName.

postingsReport :: ReportSpec -> Journal -> PostingsReport Source #

Select postings from the journal and add running balance and other information to make a postings report. Used by eg hledger's register command.

mkpostingsReportItem :: Bool -> Bool -> WhichDate -> Maybe Period -> Posting -> MixedAmount -> PostingsReportItem Source #

Generate one postings report line item, containing the posting, the current running balance, and optionally the posting date and/or the transaction description.

tests_PostingsReport :: TestTree Source #

multiBalanceReport :: ReportSpec -> Journal -> MultiBalanceReport Source #

Generate a multicolumn balance report for the matched accounts, showing the change of balance, accumulated balance, or historical balance in each of the specified periods. If the normalbalance_ option is set, it adjusts the sorting and sign of amounts (see ReportOpts and CompoundBalanceCommand). hledger's most powerful and useful report, used by the balance command (in multiperiod mode) and (via compoundBalanceReport) by the bscfis commands.

multiBalanceReportWith :: ReportSpec -> Journal -> PriceOracle -> Set AccountName -> MultiBalanceReport Source #

A helper for multiBalanceReport. This one takes some extra arguments, a `PriceOracle` to be used for looking up market prices, and a set of `AccountName`s which should not be elided. Commands which run multiple reports (bs etc.) can generate the price oracle just once for efficiency, passing it to each report by calling this function directly.

compoundBalanceReport :: ReportSpec -> Journal -> [CBCSubreportSpec a] -> CompoundPeriodicReport a MixedAmount Source #

Generate a compound balance report from a list of CBCSubreportSpec. This shares postings between the subreports.

compoundBalanceReportWith :: ReportSpec -> Journal -> PriceOracle -> [CBCSubreportSpec a] -> CompoundPeriodicReport a MixedAmount Source #

A helper for compoundBalanceReport, similar to multiBalanceReportWith.

startingPostings :: ReportSpec -> Journal -> PriceOracle -> DateSpan -> [Posting] Source #

Postings needed to calculate starting balances.

Balances at report start date, from all earlier postings which otherwise match the query. These balances are unvalued. TODO: Do we want to check whether to bother calculating these? isHistorical and startDate is not nothing, otherwise mempty? This currently gives a failure with some totals which are supposed to be 0 being blank.

makeReportQuery :: ReportSpec -> DateSpan -> ReportSpec Source #

Remove any date queries and insert queries from the report span. The user's query expanded to the report span if there is one (otherwise any date queries are left as-is, which handles the hledger-ui+future txns case above).

getPostingsByColumn :: ReportSpec -> Journal -> PriceOracle -> [DateSpan] -> [(DateSpan, [Posting])] Source #

Group postings, grouped by their column

getPostings :: ReportSpec -> Journal -> PriceOracle -> [Posting] Source #

Gather postings matching the query within the report period.

generateMultiBalanceReport :: ReportSpec -> Journal -> PriceOracle -> Set AccountName -> [(DateSpan, [Posting])] -> HashMap AccountName Account -> MultiBalanceReport Source #

Lay out a set of postings grouped by date span into a regular matrix with rows given by AccountName and columns by DateSpan, then generate a MultiBalanceReport from the columns.

sortRows :: ReportOpts -> Journal -> [MultiBalanceReportRow] -> [MultiBalanceReportRow] Source #

Sort the rows by amount or by account declaration order.

sortRowsLike :: [AccountName] -> [PeriodicReportRow DisplayName b] -> [PeriodicReportRow DisplayName b] Source #

A sorting helper: sort a list of things (eg report rows) keyed by account name to match the provided ordering of those same account names.

balanceReportTableAsText :: ReportOpts -> Table Text Text WideBuilder -> Builder Source #

Given a table representing a multi-column balance report (for example, made using `balanceReportAsTable`), render it in a format suitable for console output. Amounts with more than two commodities will be elided unless --no-elide is used.

tests_MultiBalanceReport :: TestTree Source #

entriesReport :: ReportSpec -> Journal -> EntriesReport Source #

Select transactions for an entries report.

tests_EntriesReport :: TestTree Source #

budgetReport :: ReportSpec -> BalancingOpts -> DateSpan -> Journal -> BudgetReport Source #

Calculate per-account, per-period budget (balance change) goals from all periodic transactions, calculate actual balance changes from the regular transactions, and compare these to get a `BudgetReport`. Unbudgeted accounts may be hidden or renamed (see journalWithBudgetAccountNames).

combineBudgetAndActual :: ReportOpts -> Journal -> MultiBalanceReport -> MultiBalanceReport -> BudgetReport Source #

Combine a per-account-and-subperiod report of budget goals, and one of actual change amounts, into a budget performance report. The two reports should have the same report interval, but need not have exactly the same account rows or date columns. (Cells in the combined budget report can be missing a budget goal, an actual amount, or both.) The combined report will include:

- consecutive subperiods at the same interval as the two reports, spanning the period of both reports
- all accounts mentioned in either report, sorted by account code or account name or amount as appropriate.

budgetReportAsText :: ReportOpts -> BudgetReport -> Text Source #

Render a budget report as plain text suitable for console output.

budgetReportAsTable :: ReportOpts -> BudgetReport -> Table Text Text WideBuilder Source #

Build a `Table` from a multi-column balance report.

budgetReportAsCsv :: ReportOpts -> BudgetReport -> [[Text]] Source #

Render a budget report as CSV. Like multiBalanceReportAsCsv, but includes alternating actual and budget amount columns.

tests_BudgetReport :: TestTree Source #

flatShowsExclusiveBalance :: Bool Source #

When true (the default), this makes balance --flat reports and their implementation clearer. Single/multi-col balance reports currently aren't all correct if this is false.

balanceReport :: ReportSpec -> Journal -> BalanceReport Source #

Enabling this makes balance --flat --empty also show parent accounts without postings, in addition to those with postings and a zero balance. Disabling it shows only the latter. No longer supported, but leave this here for a bit. flatShowsPostinglessAccounts = True

Generate a simple balance report, containing the matched accounts and their balances (change of balance) during the specified period. If the normalbalance_ option is set, it adjusts the sorting and sign of amounts (see ReportOpts and CompoundBalanceCommand).

tests_BalanceReport :: TestTree Source #

triOrigTransaction :: (a, b, c, d, e, f) -> a Source #

triDate :: (a, Transaction, c, d, e, f) -> Day Source #

triAmount :: (a, b, c, d, e, f) -> e Source #

triBalance :: (a, b, c, d, e, f) -> f Source #

triCommodityAmount :: CommoditySymbol -> (a, b, c, d, MixedAmount, f) -> MixedAmount Source #

triCommodityBalance :: CommoditySymbol -> (a, b, c, d, e, MixedAmount) -> MixedAmount Source #

accountTransactionsReport :: ReportSpec -> Journal -> Query -> AccountTransactionsReport Source #

accountTransactionsReportItems :: Query -> Query -> MixedAmount -> (MixedAmount -> MixedAmount) -> (AccountName -> Maybe AccountType) -> [(Day, Transaction)] -> [AccountTransactionsReportItem] Source #

Generate transactions report items from a list of transactions, using the provided user-specified report query, a query specifying which account to use as the focus, a starting balance, and a sign-setting function. Each transaction is accompanied by the date that should be shown for it in the report. This is not necessarily the transaction date - see transactionRegisterDate.

transactionRegisterDate :: WhichDate -> Query -> Query -> Transaction -> Day Source #

What date should be shown for a transaction in an account register report ? This will be in context of a particular account (the "this account" query) and any additional report query. It could be:

- if postings are matched by both thisacctq and reportq, the earliest of those matched postings' dates (or their secondary dates if --date2 was used)
- the transaction date, or its secondary date if --date2 was used.

accountTransactionsReportByCommodity :: AccountTransactionsReport -> [(CommoditySymbol, AccountTransactionsReport)] Source #

Split an account transactions report whose items may involve several commodities, into one or more single-commodity account transactions reports.

tests_AccountTransactionsReport :: TestTree Source #

tests_Reports :: TestTree Source #

rawOptsToInputOpts :: Day -> RawOpts -> InputOpts Source #

Parse an InputOpts from a RawOpts and a provided date. This will fail with a usage error if the forecast period expression cannot be parsed.

parseAndFinaliseJournal :: ErroringJournalParser IO ParsedJournal -> InputOpts -> FilePath -> Text -> ExceptT String IO Journal Source #

Given a parser to ParsedJournal, input options, file path and content: run the parser on the content, and finalise the result to get a Journal; or throw an error.

initialiseAndParseJournal :: ErroringJournalParser IO ParsedJournal -> InputOpts -> FilePath -> Text -> ExceptT String IO Journal Source #

Given a parser to ParsedJournal, input options, file path and content: run the parser on the content. This is all steps of `parseAndFinaliseJournal` without the finalisation step, and is used when you need to perform other actions before finalisation, as in parsing Timeclock and Timedot files.

journalFinalise :: InputOpts -> FilePath -> Text -> ParsedJournal -> ExceptT String IO Journal Source #

Post-process a Journal that has just been parsed or generated, in this order:

- add misc info (file path, read time)
- reverse transactions into their original parse order
- apply canonical commodity styles
- add tags from account directives to postings' tags
- add forecast transactions if enabled
- add tags from account directives to postings' tags (again to affect forecast transactions)
- add auto postings if enabled
- add tags from account directives to postings' tags (again to affect auto postings)
- evaluate balance assignments and balance each transaction
- check balance assertions if enabled
- infer equity postings in conversion transactions if enabled
- infer market prices from costs if enabled
- check all accounts have been declared if in strict mode
- check all commodities have been declared if in strict mode

journalAddAutoPostings :: Bool -> Day -> BalancingOpts -> Journal -> Either String Journal Source #

Apply any auto posting rules to generate extra postings on this journal's transactions. With a true first argument, adds visible tags to generated postings and modified transactions.

journalAddForecast :: Bool -> Maybe DateSpan -> Journal -> Journal Source #

Generate periodic transactions from all periodic transaction rules in the journal. These transactions are added to the in-memory Journal (but not the on-disk file).

The start & end date for generated periodic transactions are determined in a somewhat complicated way; see the hledger manual -> Periodic transactions.

setYear :: forall (m :: Type -> Type). Year -> JournalParser m () Source #

getYear :: forall (m :: Type -> Type). JournalParser m (Maybe Year) Source #

setDefaultCommodityAndStyle :: forall (m :: Type -> Type). (CommoditySymbol, AmountStyle) -> JournalParser m () Source #

getDefaultCommodityAndStyle :: forall (m :: Type -> Type). JournalParser m (Maybe (CommoditySymbol, AmountStyle)) Source #

getDefaultAmountStyle :: forall (m :: Type -> Type). JournalParser m (Maybe AmountStyle) Source #

Get amount style associated with default currency.

Returns `AmountStyle` used to defined by a latest default commodity directive prior to current position within this file or its parents.

getAmountStyle :: forall (m :: Type -> Type). CommoditySymbol -> JournalParser m (Maybe AmountStyle) Source #

Get the `AmountStyle` declared by the most recently parsed (in the current or parent files, prior to the current position) commodity directive for the given commodity, if any.

addDeclaredAccountTags :: forall (m :: Type -> Type). AccountName -> [Tag] -> JournalParser m () Source #

addDeclaredAccountType :: forall (m :: Type -> Type). AccountName -> AccountType -> JournalParser m () Source #

pushParentAccount :: forall (m :: Type -> Type). AccountName -> JournalParser m () Source #

popParentAccount :: forall (m :: Type -> Type). JournalParser m () Source #

getParentAccount :: forall (m :: Type -> Type). JournalParser m AccountName Source #

addAccountAlias :: MonadState Journal m => AccountAlias -> m () Source #

getAccountAliases :: MonadState Journal m => m [AccountAlias] Source #

clearAccountAliases :: MonadState Journal m => m () Source #

journalAddFile :: (FilePath, Text) -> Journal -> Journal Source #

statusp :: forall (m :: Type -> Type). TextParser m Status Source #

codep :: forall (m :: Type -> Type). TextParser m Text Source #

descriptionp :: forall (m :: Type -> Type). TextParser m Text Source #

Parse possibly empty text until a semicolon or newline. Whitespace is preserved (for now - perhaps helps preserve alignment of same-line comments ?).

datep :: forall (m :: Type -> Type). JournalParser m Day Source #

Parse a date in YYYY-MM-DD format. Slash (/) and period (.) are also allowed as separators. The year may be omitted if a default year has been set. Leading zeroes may be omitted.

datetimep :: forall (m :: Type -> Type). JournalParser m LocalTime Source #

Parse a date and time in YYYY-MM-DD HH:MM[:SS][+-ZZZZ] format. Slash (/) and period (.) are also allowed as date separators. The year may be omitted if a default year has been set. Seconds are optional. The timezone is optional and ignored (the time is always interpreted as a local time). Leading zeroes may be omitted (except in a timezone).

secondarydatep :: forall (m :: Type -> Type). Day -> TextParser m Day Source #

modifiedaccountnamep :: forall (m :: Type -> Type). JournalParser m AccountName Source #

Parse an account name (plus one following space if present), then apply any parent account prefix and/or account aliases currently in effect, in that order. (Ie first add the parent account prefix, then rewrite with aliases). This calls error if any account alias with an invalid regular expression exists.

accountnamep :: forall (m :: Type -> Type). TextParser m AccountName Source #

Parse an account name, plus one following space if present. Account names have one or more parts separated by the account separator character, and are terminated by two or more spaces (or end of input). Each part is at least one character long, may have single spaces inside it, and starts with a non-whitespace. Note, this means "{account}", "%^!" and ";comment" are all accepted (parent parsers usually prevent/consume the last). It should have required parts to start with an alphanumeric; for now it remains as-is for backwards compatibility.

noncommenttextp :: forall (m :: Type -> Type). TextParser m Text Source #

Parse possibly empty text, including whitespace, until a comment start (semicolon) or newline.

noncommenttext1p :: forall (m :: Type -> Type). TextParser m Text Source #

Parse non-empty text, including whitespace, until a comment start (semicolon) or newline.

singlespacedtext1p :: forall (m :: Type -> Type). TextParser m Text Source #

Parse non-empty, single-spaced text starting and ending with non-whitespace, until a double space or newline.

singlespacednoncommenttext1p :: forall (m :: Type -> Type). TextParser m Text Source #

Parse non-empty, single-spaced text starting and ending with non-whitespace, until a comment start (semicolon), double space, or newline.

singlespacedtextsatisfying1p :: forall (m :: Type -> Type). (Char -> Bool) -> TextParser m Text Source #

Parse non-empty, single-spaced text starting and ending with non-whitespace, where all characters satisfy the given predicate.

singlespacep :: forall (m :: Type -> Type). TextParser m () Source #

Parse one non-newline whitespace character that is not followed by another one.

spaceandamountormissingp :: forall (m :: Type -> Type). JournalParser m MixedAmount Source #

Parse whitespace then an amount, or return the special "missing" marker amount.

amountp :: forall (m :: Type -> Type). JournalParser m Amount Source #

Parse a single-commodity amount, applying the default commodity if there is no commodity symbol; optionally followed by, in any order: a Ledger-style cost, Ledger-style valuation expression, and/or Ledger-style cost basis, which is one or more of lot cost, lot date, and/or lot note (we loosely call this triple the lot's cost basis). The cost basis makes it a lot rather than just an amount. Both cost basis info and valuation expression are discarded for now. The main amount's sign is significant; here are the possibilities and their interpretation. Also imagine an optional VALUATIONEXPR added to any of these (omitted for clarity): @

AMT -- acquiring an amount AMT COST -- acquiring an amount at some cost AMT COST COSTBASIS -- acquiring a lot at some cost, saving its cost basis AMT COSTBASIS COST -- like the above AMT COSTBASIS -- like the above with cost same as the cost basis

- AMT -- releasing an amount
- AMT SELLPRICE -- releasing an amount at some selling price
- AMT SELLPRICE COSTBASISSEL -- releasing a lot at some selling price, selecting it by its cost basis
- AMT COSTBASISSEL SELLPRICE -- like the above
- AMT COSTBASISSEL -- like the above with selling price same as the selected lot's cost basis amount

COST/SELLPRICE can be `UNITAMT,` `TOTALAMT, (`) UNITAMT, or (@@) TOTALAMT. The () are ignored. COSTBASIS is one or more of {LOTCOST}, [LOTDATE], (LOTNOTE), in any order, with LOTCOST defaulting to COST. COSTBASISSEL is one or more of {LOTCOST}, [LOTDATE], (LOTNOTE), in any order. {LOTCOST} can be {UNITAMT}, {{TOTALAMT}}, {=UNITAMT}, or {{=TOTALAMT}}. The = is ignored. VALUATIONEXPR can be ((VALUE AMOUNT)) or ((VALUE FUNCTION)).

@ Ledger amount syntax is really complex. Rule of thumb: curly braces, parentheses, and/or square brackets in an amount means a Ledger-style cost basis is involved.

To parse an amount's numeric quantity we need to know which character represents a decimal mark. We find it in one of three ways:

1. If a decimal mark has been set explicitly in the journal parse state, we use that
2. Or if the journal has a commodity declaration for the amount's commodity, we get the decimal mark from that
3. Otherwise we will parse any valid decimal mark appearing in the number, as long as the number appears well formed. (This means we handle files with any supported decimal mark without configuration, but it also allows different decimal marks in different amounts, which is a bit too loose. There's an open issue.)

amountp' :: forall (m :: Type -> Type). Bool -> JournalParser m Amount Source #

parseamount :: String -> Either HledgerParseErrors Amount Source #

Try to parse a single-commodity amount from a string

parseamount' :: String -> Amount Source #

Parse a single-commodity amount from a string, or get an error.

parsemixedamount :: String -> Either HledgerParseErrors MixedAmount Source #

Like parseamount', but returns a MixedAmount.

parsemixedamount' :: String -> MixedAmount Source #

Like parseamount', but returns a MixedAmount.

commoditysymbolp :: forall (m :: Type -> Type). TextParser m CommoditySymbol Source #

costp :: forall (m :: Type -> Type). Amount -> JournalParser m AmountPrice Source #

Ledger-style cost notation: `UNITAMT,` `TOTALAMT, (`) UNITAMT, or (@@) TOTALAMT. The () are ignored.

balanceassertionp :: forall (m :: Type -> Type). JournalParser m BalanceAssertion Source #

lotcostp :: forall (m :: Type -> Type). JournalParser m () Source #

numberp :: forall (m :: Type -> Type). Maybe AmountStyle -> TextParser m (Quantity, Word8, Maybe Char, Maybe DigitGroupStyle) Source #

Parse a string representation of a number for its value and display attributes.

Some international number formats are accepted, eg either period or comma may be used for the decimal mark, and the other of these may be used for separating digit groups in the integer part. See http://en.wikipedia.org/wiki/Decimal_separator for more examples.

This returns: the parsed numeric value, the precision (number of digits seen following the decimal mark), the decimal mark character used if any, and the digit group style if any.

fromRawNumber :: RawNumber -> Maybe Integer -> Either String (Quantity, Word8, Maybe Char, Maybe DigitGroupStyle) Source #

Interpret a raw number as a decimal number.

Returns: - the decimal number - the precision (number of digits after the decimal point) - the decimal point character, if any - the digit group style, if any (digit group character and sizes of digit groups)

rawnumberp :: forall (m :: Type -> Type). TextParser m (Either AmbiguousNumber RawNumber) Source #

Parse and interpret the structure of a number without external hints. Numbers are digit strings, possibly separated into digit groups by one of two types of separators. (1) Numbers may optionally have a decimal mark, which may be either a period or comma. (2) Numbers may optionally contain digit group marks, which must all be either a period, a comma, or a space.

It is our task to deduce the characters used as decimal mark and digit group mark, based on the allowed syntax. For instance, we make use of the fact that a decimal mark can occur at most once and must be to the right of all digit group marks.

    >>> parseTest rawnumberp "1,234,567.89"
    Right (WithSeparators ',' ["1","234","567"] (Just ('.',"89")))
    >>> parseTest rawnumberp "1,000"
    Left (AmbiguousNumber "1" ',' "000")
    >>> parseTest rawnumberp "1 000"
    Right (WithSeparators ' ' ["1","000"] Nothing)

multilinecommentp :: forall (m :: Type -> Type). TextParser m () Source #

emptyorcommentlinep :: forall (m :: Type -> Type). TextParser m () Source #

A blank or comment line in journal format: a line that's empty or containing only whitespace or whose first non-whitespace character is semicolon, hash, or star.

isLineCommentStart :: Char -> Bool Source #

Is this a character that, as the first non-whitespace on a line, starts a comment line ?

isSameLineCommentStart :: Char -> Bool Source #

Is this a character that, appearing anywhere within a line, starts a comment ?

followingcommentp :: forall (m :: Type -> Type). TextParser m Text Source #

Parse the text of a (possibly multiline) comment following a journal item.

    >>> rtp followingcommentp ""   -- no comment
    Right ""
    >>> rtp followingcommentp ";"    -- just a (empty) same-line comment. newline is added
    Right "\n"
    >>> rtp followingcommentp ";  \n"
    Right "\n"
    >>> rtp followingcommentp ";\n ;\n"  -- a same-line and a next-line comment
    Right "\n\n"
    >>> rtp followingcommentp "\n ;\n"  -- just a next-line comment. Insert an empty same-line comment so the next-line comment doesn't become a same-line comment.
    Right "\n\n"

transactioncommentp :: forall (m :: Type -> Type). TextParser m (Text, [Tag]) Source #

Parse a transaction comment and extract its tags.

The first line of a transaction may be followed by comments, which begin with semicolons and extend to the end of the line. Transaction comments may span multiple lines, but comment lines below the transaction must be preceded by leading whitespace.

200011 ; a transaction comment starting on the same line ... ; extending to the next line account1 $1 account2

Tags are name-value pairs.

    >>> let getTags (_,tags) = tags
    >>> let parseTags = fmap getTags . rtp transactioncommentp

    >>> parseTags "; name1: val1, name2:all this is value2"
    Right [("name1","val1"),("name2","all this is value2")]

A tag's name must be immediately followed by a colon, without separating whitespace. The corresponding value consists of all the text following the colon up until the next colon or newline, stripped of leading and trailing whitespace.

postingcommentp :: forall (m :: Type -> Type). Maybe Year -> TextParser m (Text, [Tag], Maybe Day, Maybe Day) Source #

Parse a posting comment and extract its tags and dates.

Postings may be followed by comments, which begin with semicolons and extend to the end of the line. Posting comments may span multiple lines, but comment lines below the posting must be preceded by leading whitespace.

200011 account1 $1 ; a posting comment starting on the same line ... ; extending to the next line

account2 ; a posting comment beginning on the next line

Tags are name-value pairs.

    >>> let getTags (_,tags,_,_) = tags
    >>> let parseTags = fmap getTags . rtp (postingcommentp Nothing)

    >>> parseTags "; name1: val1, name2:all this is value2"
    Right [("name1","val1"),("name2","all this is value2")]

A tag's name must be immediately followed by a colon, without separating whitespace. The corresponding value consists of all the text following the colon up until the next colon or newline, stripped of leading and trailing whitespace.

Posting dates may be expressed with "date"/"date2" tags or with bracketed date syntax. Posting dates will inherit their year from the transaction date if the year is not specified. We throw parse errors on invalid dates.

    >>> let getDates (_,_,d1,d2) = (d1, d2)
    >>> let parseDates = fmap getDates . rtp (postingcommentp (Just 2000))

    >>> parseDates "; date: 1/2, date2: 1999/12/31"
    Right (Just 2000-01-02,Just 1999-12-31)
    >>> parseDates "; [1/2=1999/12/31]"
    Right (Just 2000-01-02,Just 1999-12-31)

Example: tags, date tags, and bracketed dates >>> rtp (postingcommentp (Just 2000)) "; a:b, date:34, [=56]" Right ("a:b, date:34, [=56]n",[("a","b"),("date","3/4")],Just 2000-03-04,Just 2000-05-06)

Example: extraction of dates from date tags ignores trailing text >>> rtp (postingcommentp (Just 2000)) "; date:34=56" Right ("date:34=56n",[("date","34=56")],Just 2000-03-04,Nothing)

bracketeddatetagsp :: forall (m :: Type -> Type). Maybe Year -> TextParser m [(TagName, Day)] Source #

Parse Ledger-style bracketed posting dates ([DATE=DATE2]), as "date" and/or "date2" tags. Anything that looks like an attempt at this (a square-bracketed sequence of 0123456789/-.= containing at least one digit and one date separator) is also parsed, and will throw an appropriate error.

The dates are parsed in full here so that errors are reported in the right position. A missing year in DATE can be inferred if a default date is provided. A missing year in DATE2 will be inferred from DATE.

    >>> either (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[2016/1/2=3/4]"
    Right [("date",2016-01-02),("date2",2016-03-04)]

    >>> either (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[1]"
    Left ...not a bracketed date...

    >>> either (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[2016/1/32]"
    Left ...1:2:...This date is invalid...

    >>> either (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[1/31]"
    Left ...1:2:...The partial date 1/31 can not be parsed...

    >>> either (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[0123456789/-.=/-.=]"
    Left ...1:13:...expecting month or day...

aliasesFromOpts :: InputOpts -> [AccountAlias] Source #

Get the account name aliases from options, if any.

accountaliasp :: forall (m :: Type -> Type). TextParser m AccountAlias Source #

tests_Common :: TestTree Source #

runJournalParser :: Monad m => JournalParser m a -> Text -> m (Either HledgerParseErrors a) Source #

Run a journal parser in some monad. See also: parseWithState.

findReader :: forall (m :: Type -> Type). MonadIO m => Maybe StorageFormat -> Maybe FilePath -> Maybe (Reader m) Source #

    findReader mformat mpath

Find the reader named by `mformat`, if provided. Or, if a file path is provided, find the first reader that handles its file extension, if any.

splitReaderPrefix :: PrefixedFilePath -> (Maybe String, FilePath) Source #

If a filepath is prefixed by one of the reader names and a colon, split that off. Eg "csv:-" -> (Just "csv", "-").

tmpostingrulep :: forall (m :: Type -> Type). Maybe Year -> JournalParser m TMPostingRule Source #

defaultJournal :: IO Journal Source #

Read the default journal file specified by the environment, or raise an error.

defaultJournalPath :: IO String Source #

Get the default journal file path specified by the environment. Like ledger, we look first for the LEDGER_FILE environment variable, and if that does not exist, for the legacy LEDGER environment variable. If neither is set, or the value is blank, return the hard-coded default, which is `.hledger.journal` in the users's home directory (or in the current directory, if we cannot determine a home directory).

readJournal :: InputOpts -> Maybe FilePath -> Text -> ExceptT String IO Journal Source #

    readJournal iopts mfile txt

Read a Journal from some text, or return an error message.

The reader (data format) is chosen based on, in this order:

- a reader name provided in `iopts`
- a reader prefix in the `mfile` path
- a file extension in `mfile`

If none of these is available, or if the reader name is unrecognised, we use the journal reader. (We used to try all readers in this case; since hledger 1.17, we prefer predictability.)

readJournalFile :: InputOpts -> PrefixedFilePath -> ExceptT String IO Journal Source #

Read a Journal from this file, or from stdin if the file path is -, or return an error message. The file path can have a READER: prefix.

The reader (data format) to use is determined from (in priority order): the `mformat_` specified in the input options, if any; the file path's READER: prefix, if any; a recognised file name extension. if none of these identify a known reader, the journal reader is used.

The input options can also configure balance assertion checking, automated posting generation, a rules file for converting CSV data, etc.

readJournalFiles :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO Journal Source #

Read a Journal from each specified file path and combine them into one. Or, return the first error message.

Combining Journals means concatenating them, basically. The parse state resets at the start of each file, which means that directives & aliases do not affect subsequent sibling or parent files. They do affect included child files though. Also the final parse state saved in the Journal does span all files.

readJournal' :: Text -> IO Journal Source #

An easy version of `readJournal` which assumes default options, and fails in the IO monad.

readJournalFile' :: PrefixedFilePath -> IO Journal Source #

An easy version of `readJournalFile` which assumes default options, and fails in the IO monad.

readJournalFiles' :: [PrefixedFilePath] -> IO Journal Source #

An easy version of `readJournalFiles'` which assumes default options, and fails in the IO monad.

orDieTrying :: MonadIO m => ExceptT String m a -> m a Source #

Extract ExceptT to the IO monad, failing with an error message if necessary.

requireJournalFileExists :: FilePath -> IO () Source #

If the specified journal file does not exist (and is not "-"), give a helpful error and quit.

ensureJournalFileExists :: FilePath -> IO () Source #

Ensure there is a journal file at the given path, creating an empty one if needed. On Windows, also ensure that the path contains no trailing dots which could cause data loss (see `isWindowsUnsafeDotPath`).

tests_Read :: TestTree Source #

tests_Hledger :: TestTree Source #

assertFailure :: HasCallStack => String -> IO a #

assertBool :: HasCallStack => String -> Bool -> Assertion #

assertEqual :: (Eq a, Show a, HasCallStack) => String -> a -> a -> Assertion #

(@=?) :: (Eq a, Show a, HasCallStack) => a -> a -> Assertion #

(@?=) :: (Eq a, Show a, HasCallStack) => a -> a -> Assertion #

(@?) :: (AssertionPredicable t, HasCallStack) => t -> String -> Assertion #

assertString :: HasCallStack => String -> Assertion #

testCaseSteps :: TestName -> ((String -> IO ()) -> Assertion) -> TestTree #

testCase :: TestName -> Assertion -> TestTree #

testCaseInfo :: TestName -> IO String -> TestTree #

add :: CliOpts -> Journal -> IO () Source #

Read multiple transactions from the console, prompting for each field, and append them to the journal file. If the journal came from stdin, this command has no effect.

foldl1May :: (a -> a -> a) -> [a] -> Maybe a Source #

foldr1May :: (a -> a -> a) -> [a] -> Maybe a Source #

foldl1Note :: Partial => String -> (a -> a -> a) -> [a] -> a Source #

foldr1Note :: Partial => String -> (a -> a -> a) -> [a] -> a Source #

minimumMay :: Ord a => [a] -> Maybe a Source #

maximumMay :: Ord a => [a] -> Maybe a Source #

minimumNote :: (Partial, Ord a) => String -> [a] -> a Source #

maximumNote :: (Partial, Ord a) => String -> [a] -> a Source #

minimumByMay :: (a -> a -> Ordering) -> [a] -> Maybe a Source #

maximumByMay :: (a -> a -> Ordering) -> [a] -> Maybe a Source #

minimumByNote :: Partial => String -> (a -> a -> Ordering) -> [a] -> a Source #

maximumByNote :: Partial => String -> (a -> a -> Ordering) -> [a] -> a Source #

maximumBoundBy :: a -> (a -> a -> Ordering) -> [a] -> a Source #

The largest element of a list with respect to the given comparison function. The result is bounded by the value given as the first argument.

minimumBoundBy :: a -> (a -> a -> Ordering) -> [a] -> a Source #

The smallest element of a list with respect to the given comparison function. The result is bounded by the value given as the first argument.

maximumBound :: Ord a => a -> [a] -> a Source #

The largest element of a list. The result is bounded by the value given as the first argument.

minimumBound :: Ord a => a -> [a] -> a Source #

The smallest element of a list. The result is bounded by the value given as the first argument.

maximumBounded :: (Ord a, Bounded a) => [a] -> a Source #

The largest element of a list. The result is bounded by `minBound`.

minimumBounded :: (Ord a, Bounded a) => [a] -> a Source #

The largest element of a list. The result is bounded by `maxBound`.

findJust :: (a -> Bool) -> [a] -> a Source #

    findJust op = fromJust . find op

findJustDef :: a -> (a -> Bool) -> [a] -> a Source #

findJustNote :: Partial => String -> (a -> Bool) -> [a] -> a Source #

minimumDef :: Ord a => a -> [a] -> a Source #

New users are recommended to use `minimumBound` or `maximumBound` instead.

maximumDef :: Ord a => a -> [a] -> a Source #

New users are recommended to use `minimumBound` or `maximumBound` instead.

minimumByDef :: a -> (a -> a -> Ordering) -> [a] -> a Source #

New users are recommended to use `minimumBoundBy` or `maximumBoundBy` instead.

maximumByDef :: a -> (a -> a -> Ordering) -> [a] -> a Source #

New users are recommended to use `minimumBoundBy` or `maximumBoundBy` instead.

foldl1Def :: a -> (a -> a -> a) -> [a] -> a Source #

foldr1Def :: a -> (a -> a -> a) -> [a] -> a Source #

abort :: Partial => String -> a Source #

Synonym for `error`. Used for instances where the program has decided to exit because of invalid user input, or the user pressed quit etc. This function allows `error` to be reserved for programmer errors.

tailMay :: [a] -> Maybe [a] Source #

    tailMay [] = Nothing
    tailMay [1,3,4] = Just [3,4]

tailDef :: [a] -> [a] -> [a] Source #

    tailDef [12] [] = [12]
    tailDef [12] [1,3,4] = [3,4]

tailNote :: Partial => String -> [a] -> [a] Source #

    tailNote "help me" [] = error "Safe.tailNote [], help me"
    tailNote "help me" [1,3,4] = [3,4]

tailSafe :: [a] -> [a] Source #

    tailSafe [] = []
    tailSafe [1,3,4] = [3,4]

initMay :: [a] -> Maybe [a] Source #

initDef :: [a] -> [a] -> [a] Source #

initNote :: Partial => String -> [a] -> [a] Source #

initSafe :: [a] -> [a] Source #

headMay :: [a] -> Maybe a Source #

lastMay :: [a] -> Maybe a Source #

headNote :: Partial => String -> [a] -> a Source #

lastNote :: Partial => String -> [a] -> a Source #

foldl1May' :: (a -> a -> a) -> [a] -> Maybe a Source #

foldl1Note' :: Partial => String -> (a -> a -> a) -> [a] -> a Source #

scanr1May :: (a -> a -> a) -> [a] -> Maybe [a] Source #

scanl1May :: (a -> a -> a) -> [a] -> Maybe [a] Source #

scanr1Def :: [a] -> (a -> a -> a) -> [a] -> [a] Source #

scanl1Def :: [a] -> (a -> a -> a) -> [a] -> [a] Source #

scanr1Note :: Partial => String -> (a -> a -> a) -> [a] -> [a] Source #

scanl1Note :: Partial => String -> (a -> a -> a) -> [a] -> [a] Source #

cycleMay :: [a] -> Maybe [a] Source #

cycleDef :: [a] -> [a] -> [a] Source #

cycleNote :: Partial => String -> [a] -> [a] Source #

fromJustDef :: a -> Maybe a -> a Source #

An alternative name for `fromMaybe`, to fit the naming scheme of this package. Generally using `fromMaybe` directly would be considered better style.

fromJustNote :: Partial => String -> Maybe a -> a Source #

assertNote :: Partial => String -> Bool -> a -> a Source #

atMay :: [a] -> Int -> Maybe a Source #

atDef :: a -> [a] -> Int -> a Source #

atNote :: Partial => String -> [a] -> Int -> a Source #

readEitherSafe :: Read a => String -> Either String a Source #

This function provides a more precise error message than `readEither` from `base`.

readMay :: Read a => String -> Maybe a Source #

readDef :: Read a => a -> String -> a Source #

readNote :: (Partial, Read a) => String -> String -> a Source #

`readNote` uses `readEitherSafe` for the error message.

lookupJust :: (Eq a, Partial) => a -> [(a, b)] -> b Source #

    lookupJust key = fromJust . lookup key

lookupJustDef :: Eq a => b -> a -> [(a, b)] -> b Source #

lookupJustNote :: (Partial, Eq a) => String -> a -> [(a, b)] -> b Source #

elemIndexJust :: (Partial, Eq a) => a -> [a] -> Int Source #

    elemIndexJust op = fromJust . elemIndex op

elemIndexJustDef :: Eq a => Int -> a -> [a] -> Int Source #

elemIndexJustNote :: (Partial, Eq a) => String -> a -> [a] -> Int Source #

findIndexJust :: (a -> Bool) -> [a] -> Int Source #

    findIndexJust op = fromJust . findIndex op

findIndexJustDef :: Int -> (a -> Bool) -> [a] -> Int Source #

findIndexJustNote :: Partial => String -> (a -> Bool) -> [a] -> Int Source #

toEnumMay :: (Enum a, Bounded a) => Int -> Maybe a Source #

toEnumDef :: (Enum a, Bounded a) => a -> Int -> a Source #

toEnumNote :: (Partial, Enum a, Bounded a) => String -> Int -> a Source #

toEnumSafe :: (Enum a, Bounded a) => Int -> a Source #

succMay :: (Enum a, Eq a, Bounded a) => a -> Maybe a Source #

succDef :: (Enum a, Eq a, Bounded a) => a -> a -> a Source #

succNote :: (Partial, Enum a, Eq a, Bounded a) => String -> a -> a Source #

succSafe :: (Enum a, Eq a, Bounded a) => a -> a Source #

predMay :: (Enum a, Eq a, Bounded a) => a -> Maybe a Source #

predDef :: (Enum a, Eq a, Bounded a) => a -> a -> a Source #

predNote :: (Partial, Enum a, Eq a, Bounded a) => String -> a -> a Source #

predSafe :: (Enum a, Eq a, Bounded a) => a -> a Source #

indexMay :: Ix a => (a, a) -> a -> Maybe Int Source #

indexDef :: Ix a => Int -> (a, a) -> a -> Int Source #

indexNote :: (Partial, Ix a) => String -> (a, a) -> a -> Int Source #

foldl1Def' :: a -> (a -> a -> a) -> [a] -> a Source #

formatTime :: FormatTime t => TimeLocale -> String -> t -> String Source #

Substitute various time-related information for each %-code in the string, as per `formatCharacter`.

The general form is `%<modifier><width><alternate><specifier>`, where `<modifier>`, `<width>`, and `<alternate>` are optional.

## `<modifier>`

glibc-style modifiers can be used before the specifier (here marked as `z`):

`%-z`
  no padding
`%_z`
  pad with spaces
`%0z`
  pad with zeros
`%^z`
  convert to upper case
`%#z`
  convert to lower case (consistently, unlike glibc)

## `<width>`

Width digits can also be used after any modifiers and before the specifier (here marked as `z`), for example:

`%4z`
  pad to 4 characters (with default padding character)
`%_12z`
  pad with spaces to 12 characters

## `<alternate>`

An optional `E` character indicates an alternate formatting. Currently this only affects `%Z` and `%z`.

`%Ez`
  alternate formatting

## `<specifier>`

For all types (note these three are done by `formatTime`, not by `formatCharacter`):

`%%`
  `%`
`%t`
  tab
`%n`
  newline

### `TimeZone`

For `TimeZone` (and `ZonedTime` and `UTCTime`):

`%z`
  timezone offset in the format `±HHMM`
`%Ez`
  timezone offset in the format `±HH:MM`
`%Z`
  timezone name (or else offset in the format `±HHMM`)
`%EZ`
  timezone name (or else offset in the format `±HH:MM`)

### `LocalTime`

For `LocalTime` (and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%c`
  as `dateTimeFmt` `locale` (e.g. `%a %b %e %H:%M:%S %Z %Y`)

### `TimeOfDay`

For `TimeOfDay` (and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%R`
  same as `%H:%M`
`%T`
  same as `%H:%M:%S`
`%X`
  as `timeFmt` `locale` (e.g. `%H:%M:%S`)
`%r`
  as `time12Fmt` `locale` (e.g. `%I:%M:%S %p`)
`%P`
  day-half of day from (`amPm` `locale`), converted to lowercase, `am`, `pm`
`%p`
  day-half of day from (`amPm` `locale`), `AM`, `PM`
`%H`
  hour of day (24-hour), 0-padded to two chars, `00` - `23`
`%k`
  hour of day (24-hour), space-padded to two chars, `0` - `23`
`%I`
  hour of day-half (12-hour), 0-padded to two chars, `01` - `12`
`%l`
  hour of day-half (12-hour), space-padded to two chars, `1` - `12`
`%M`
  minute of hour, 0-padded to two chars, `00` - `59`
`%S`
  second of minute (without decimal part), 0-padded to two chars, `00` - `60`
`%q`
  picosecond of second, 0-padded to twelve chars, `000000000000` - `999999999999`.
`%Q`
  decimal point and fraction of second, up to 12 second decimals, without trailing zeros. For a whole number of seconds, `%Q` omits the decimal point unless padding is specified.

### `UTCTime` and `ZonedTime`

For `UTCTime` and `ZonedTime`:

`%s`
  number of whole seconds since the Unix epoch. For times before the Unix epoch, this is a negative number. Note that in `%s.%q` and `%s%Q` the decimals are positive, not negative. For example, 0.9 seconds before the Unix epoch is formatted as `-1.1` with `%s%Q`.

### `DayOfWeek`

For `DayOfWeek` (and `Day` and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%u`
  day of week number for Week Date format, `1` (= Monday) - `7` (= Sunday)
`%w`
  day of week number, `0` (= Sunday) - `6` (= Saturday)
`%a`
  day of week, short form (`snd` from `wDays` `locale`), `Sun` - `Sat`
`%A`
  day of week, long form (`fst` from `wDays` `locale`), `Sunday` - `Saturday`

### `Month`

For `Month` (and `Day` and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%Y`
  year, no padding. Note `%0Y` and `%_Y` pad to four chars
`%y`
  year of century, 0-padded to two chars, `00` - `99`
`%C`
  century, no padding. Note `%0C` and `%_C` pad to two chars
`%B`
  month name, long form (`fst` from `months` `locale`), `January` - `December`
`%b`, `%h`
  month name, short form (`snd` from `months` `locale`), `Jan` - `Dec`
`%m`
  month of year, 0-padded to two chars, `01` - `12`

### `Day`

For `Day` (and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%D`
  same as `%m/%d/%y`
`%F`
  same as `%Y-%m-%d`
`%x`
  as `dateFmt` `locale` (e.g. `%m/%d/%y`)
`%d`
  day of month, 0-padded to two chars, `01` - `31`
`%e`
  day of month, space-padded to two chars, `1` - `31`
`%j`
  day of year, 0-padded to three chars, `001` - `366`
`%f`
  century for Week Date format, no padding. Note `%0f` and `%_f` pad to two chars
`%V`
  week of year for Week Date format, 0-padded to two chars, `01` - `53`
`%U`
  week of year where weeks start on Sunday (as `sundayStartWeek`), 0-padded to two chars, `00` - `53`
`%W`
  week of year where weeks start on Monday (as `mondayStartWeek`), 0-padded to two chars, `00` - `53`

## Duration types

The specifiers for `DiffTime`, `NominalDiffTime`, `CalendarDiffDays`, and `CalendarDiffTime` are semantically separate from the other types. Specifiers on negative time differences will generally be negative (think `rem` rather than `mod`).

### `NominalDiffTime` and `DiffTime`

Note that a "minute" of `DiffTime` is simply 60 SI seconds, rather than a minute of civil time. Use `NominalDiffTime` to work with civil time, ignoring any leap seconds.

For `NominalDiffTime` and `DiffTime`:

`%w`
  total whole weeks
`%d`
  total whole days
`%D`
  whole days of week
`%h`
  total whole hours
`%H`
  whole hours of day
`%m`
  total whole minutes
`%M`
  whole minutes of hour
`%s`
  total whole seconds
`%Es`
  total seconds, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%Es` omits the decimal point unless padding is specified.
`%0Es`
  total seconds, with decimal point and <width> (default 12) decimal places.
`%S`
  whole seconds of minute
`%ES`
  seconds of minute, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%ES` omits the decimal point unless padding is specified.
`%0ES`
  seconds of minute as two digits, with decimal point and <width> (default 12) decimal places.

### `CalendarDiffDays`

For `CalendarDiffDays` (and `CalendarDiffTime`):

`%y`
  total years
`%b`
  total months
`%B`
  months of year
`%w`
  total weeks, not including months
`%d`
  total days, not including months
`%D`
  days of week

### `CalendarDiffTime`

For `CalendarDiffTime`:

`%h`
  total hours, not including months
`%H`
  hours of day
`%m`
  total minutes, not including months
`%M`
  minutes of hour
`%s`
  total whole seconds, not including months
`%Es`
  total seconds, not including months, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%Es` omits the decimal point unless padding is specified.
`%0Es`
  total seconds, not including months, with decimal point and <width> (default 12) decimal places.
`%S`
  whole seconds of minute
`%ES`
  seconds of minute, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%ES` omits the decimal point unless padding is specified.
`%0ES`
  seconds of minute as two digits, with decimal point and <width> (default 12) decimal places.

fromGregorian :: Year -> MonthOfYear -> DayOfMonth -> Day Source #

Convert from proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.

calendarDay :: CalendarDiffDays Source #

calendarWeek :: CalendarDiffDays Source #

calendarMonth :: CalendarDiffDays Source #

calendarYear :: CalendarDiffDays Source #

scaleCalendarDiffDays :: Integer -> CalendarDiffDays -> CalendarDiffDays Source #

Scale by a factor. Note that `scaleCalendarDiffDays (-1)` will not perfectly invert a duration, due to variable month lengths.

addDays :: Integer -> Day -> Day Source #

diffDays :: Day -> Day -> Integer Source #

periodAllDays :: DayPeriod p => p -> [Day] Source #

A list of all the days in this period.

Since: time-1.12.1

periodLength :: DayPeriod p => p -> Int Source #

The number of days in this period.

Since: time-1.12.1

periodFromDay :: DayPeriod p => Day -> (p, Int) Source #

Get the period this day is in, with the 1-based day number within the period.

    periodFromDay (periodFirstDay p) = (p,1)

Since: time-1.12.1

periodToDay :: DayPeriod p => p -> Int -> Day Source #

Inverse of `periodFromDay`.

Since: time-1.12.1

periodToDayValid :: DayPeriod p => p -> Int -> Maybe Day Source #

Validating inverse of `periodFromDay`.

Since: time-1.12.1

isLeapYear :: Year -> Bool Source #

Is this year a leap year according to the proleptic Gregorian calendar?

toGregorian :: Day -> (Year, MonthOfYear, DayOfMonth) Source #

Convert to proleptic Gregorian calendar.

fromGregorianValid :: Year -> MonthOfYear -> DayOfMonth -> Maybe Day Source #

Convert from proleptic Gregorian calendar. Invalid values will return Nothing

showGregorian :: Day -> String Source #

Show in ISO 8601 format (yyyy-mm-dd)

gregorianMonthLength :: Year -> MonthOfYear -> DayOfMonth Source #

The number of days in a given month according to the proleptic Gregorian calendar.

addGregorianMonthsClip :: Integer -> Day -> Day Source #

Add months, with days past the last day of the month clipped to the last day. For instance, 2005-01-30 + 1 month = 2005-02-28.

addGregorianMonthsRollOver :: Integer -> Day -> Day Source #

Add months, with days past the last day of the month rolling over to the next month. For instance, 2005-01-30 + 1 month = 2005-03-02.

addGregorianYearsClip :: Integer -> Day -> Day Source #

Add years, matching month and day, with Feb 29th clipped to Feb 28th if necessary. For instance, 2004-02-29 + 2 years = 2006-02-28.

addGregorianYearsRollOver :: Integer -> Day -> Day Source #

Add years, matching month and day, with Feb 29th rolled over to Mar 1st if necessary. For instance, 2004-02-29 + 2 years = 2006-03-01.

addGregorianDurationClip :: CalendarDiffDays -> Day -> Day Source #

Add months (clipped to last day), then add days

addGregorianDurationRollOver :: CalendarDiffDays -> Day -> Day Source #

Add months (rolling over to next month), then add days

diffGregorianDurationClip :: Day -> Day -> CalendarDiffDays Source #

Calendrical difference, with as many whole months as possible

diffGregorianDurationRollOver :: Day -> Day -> CalendarDiffDays Source #

Calendrical difference, with as many whole months as possible. Same as `diffGregorianDurationClip` for positive durations.

dayOfWeek :: Day -> DayOfWeek Source #

dayOfWeekDiff :: DayOfWeek -> DayOfWeek -> Int Source #

`dayOfWeekDiff a b = a - b` in range 0 to 6. The number of days from b to the next a.

firstDayOfWeekOnAfter :: DayOfWeek -> Day -> Day Source #

The first day-of-week on or after some day

weekAllDays :: DayOfWeek -> Day -> [Day] Source #

Returns a week containing the given `Day` where the first day is the `DayOfWeek` specified.

Examples:

    >>> weekAllDays Sunday (YearMonthDay 2022 02 21)
    [YearMonthDay 2022 2 20 .. YearMonthDay 2022 2 26]

    >>> weekAllDays Monday (YearMonthDay 2022 02 21)
    [YearMonthDay 2022 2 21 .. YearMonthDay 2022 2 27]

    >>> weekAllDays Tuesday (YearMonthDay 2022 02 21)
    [YearMonthDay 2022 2 15 .. YearMonthDay 2022 2 21]

Since: time-1.12.2

weekFirstDay :: DayOfWeek -> Day -> Day Source #

Returns the first day of a week containing the given `Day`.

Examples:

    >>> weekFirstDay Sunday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 20

    >>> weekFirstDay Monday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 21

    >>> weekFirstDay Tuesday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 15

Since: time-1.12.2

weekLastDay :: DayOfWeek -> Day -> Day Source #

Returns the last day of a week containing the given `Day`.

Examples:

    >>> weekLastDay Sunday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 26

    >>> weekLastDay Monday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 27

    >>> weekLastDay Tuesday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 21

Since: time-1.12.2

secondsToDiffTime :: Integer -> DiffTime Source #

Create a `DiffTime` which represents an integral number of seconds.

picosecondsToDiffTime :: Integer -> DiffTime Source #

Create a `DiffTime` from a number of picoseconds.

diffTimeToPicoseconds :: DiffTime -> Integer Source #

Get the number of picoseconds in a `DiffTime`.

secondsToNominalDiffTime :: Pico -> NominalDiffTime Source #

Create a `NominalDiffTime` from a number of seconds.

Since: time-1.9.1

nominalDiffTimeToSeconds :: NominalDiffTime -> Pico Source #

Get the seconds in a `NominalDiffTime`.

Since: time-1.9.1

nominalDay :: NominalDiffTime Source #

One day in `NominalDiffTime`.

getTime_resolution :: DiffTime Source #

The resolution of `getSystemTime`, `getCurrentTime`, `getPOSIXTime`. On UNIX systems this uses `clock_getres`, which may be wrong on WSL2.

getCurrentTime :: IO UTCTime Source #

Get the current `UTCTime` from the system clock.

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime Source #

addUTCTime a b = a + b

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime Source #

diffUTCTime a b = a - b

calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime Source #

calendarTimeTime :: NominalDiffTime -> CalendarDiffTime Source #

scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime Source #

Scale by a factor. Note that `scaleCalendarDiffTime (-1)` will not perfectly invert a duration, due to variable month lengths.

minutesToTimeZone :: Int -> TimeZone Source #

Create a nameless non-summer timezone for this number of minutes.

hoursToTimeZone :: Int -> TimeZone Source #

Create a nameless non-summer timezone for this number of hours.

timeZoneOffsetString' :: Maybe Char -> TimeZone -> String Source #

Text representing the offset of this timezone, such as "-0800" or "+0400" (like `%z` in formatTime), with arbitrary padding.

timeZoneOffsetString :: TimeZone -> String Source #

Text representing the offset of this timezone, such as "-0800" or "+0400" (like `%z` in formatTime).

utc :: TimeZone Source #

The UTC time zone.

getTimeZone :: UTCTime -> IO TimeZone Source #

Get the configured time-zone for a given time (varying as per summertime adjustments).

On Unix systems the output of this function depends on:

1. The value of `TZ` environment variable (if set)
2. The system time zone (usually configured by `/etc/localtime` symlink)

For details see tzset(3) and localtime(3).

Example:

    > let t = UTCTime (fromGregorian 2021 7 1) 0
    > getTimeZone t
    CEST
    > setEnv "TZ" "America/New_York" >> getTimeZone t
    EDT
    > setEnv "TZ" "Europe/Berlin" >> getTimeZone t
    CEST

On Windows systems the output of this function depends on:

1. The value of `TZ` environment variable (if set). See here for how Windows interprets this variable.
2. The system time zone, configured in Settings

getCurrentTimeZone :: IO TimeZone Source #

Get the configured time-zone for the current time.

midnight :: TimeOfDay Source #

Hour zero

midday :: TimeOfDay Source #

Hour twelve

makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay Source #

timeToDaysAndTimeOfDay :: NominalDiffTime -> (Integer, TimeOfDay) Source #

Convert a period of time into a count of days and a time of day since midnight. The time of day will never have a leap second.

daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime Source #

Convert a count of days and a time of day since midnight into a period of time.

utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay) Source #

Convert a time of day in UTC to a time of day in some timezone, together with a day adjustment.

localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay) Source #

Convert a time of day in some timezone to a time of day in UTC, together with a day adjustment.

timeToTimeOfDay :: DiffTime -> TimeOfDay Source #

Get the time of day given a time since midnight. Time more than 24h will be converted to leap-seconds.

pastMidnight :: DiffTime -> TimeOfDay Source #

Same as `timeToTimeOfDay`.

timeOfDayToTime :: TimeOfDay -> DiffTime Source #

Get the time since midnight for a given time of day.

sinceMidnight :: TimeOfDay -> DiffTime Source #

Same as `timeOfDayToTime`.

dayFractionToTimeOfDay :: Rational -> TimeOfDay Source #

Get the time of day given the fraction of a day since midnight.

timeOfDayToDayFraction :: TimeOfDay -> Rational Source #

Get the fraction of a day since midnight given a time of day.

addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime Source #

addLocalTime a b = a + b

diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime Source #

diffLocalTime a b = a - b

utcToLocalTime :: TimeZone -> UTCTime -> LocalTime Source #

Get the local time of a UTC time in a time zone.

localTimeToUTC :: TimeZone -> LocalTime -> UTCTime Source #

Get the UTC time of a local time in a time zone.

ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime Source #

Get the local time of a UT1 time on a particular meridian (in degrees, positive is East).

localTimeToUT1 :: Rational -> LocalTime -> UniversalTime Source #

Get the UT1 time of a local time on a particular meridian (in degrees, positive is East).

defaultTimeLocale :: TimeLocale Source #

Locale representing American usage.

`knownTimeZones` contains only the ten time-zones mentioned in RFC 822 sec. 5: "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT". Note that the parsing functions will regardless parse "UTC", single-letter military time-zones, and +HHMM format.

iso8601DateFormat :: Maybe String -> String Source #

Construct format string according to ISO-8601.

The `Maybe String` argument allows to supply an optional time specification. E.g.:

    iso8601DateFormat Nothing            == "%Y-%m-%d"           -- i.e. YYYY-MM-DD
    iso8601DateFormat (Just "%H:%M:%S")  == "%Y-%m-%dT%H:%M:%S"  -- i.e. YYYY-MM-DDTHH:MM:SS

rfc822DateFormat :: String Source #

Format string according to RFC822.

utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime Source #

zonedTimeToUTC :: ZonedTime -> UTCTime Source #

getZonedTime :: IO ZonedTime Source #

utcToLocalZonedTime :: UTCTime -> IO ZonedTime Source #

parseTimeM Source #

Arguments

:: (MonadFail m, ParseTime t) |
=> Bool | Accept leading and trailing whitespace?
-> TimeLocale | Time locale.
-> String | Format string.
-> String | Input string.
-> m t | Return the time value, or fail if the input could not be parsed using the given format.

Parses a time value given a format string. Missing information will be derived from 1970-01-01 00:00 UTC (which was a Thursday). Supports the same %-codes as `formatTime`, including `%-`, `%_` and `%0` modifiers, however padding widths are not supported. Case is not significant in the input string. Some variations in the input are accepted:

`%z` `%Ez`
  accepts any of `±HHMM` or `±HH:MM`.
`%Z` `%EZ`
  accepts any string of letters, or any of the formats accepted by `%z`.
`%0Y`
  accepts exactly four digits.
`%0G`
  accepts exactly four digits.
`%0C`
  accepts exactly two digits.
`%0f`
  accepts exactly two digits.

For example, to parse a date in YYYY-MM-DD format, while allowing the month and date to have optional leading zeros (notice the `-` modifier used for `%m` and `%d`):

    Prelude Data.Time> parseTimeM True defaultTimeLocale "%Y-%-m-%-d" "2010-3-04" :: Maybe Day
    Just 2010-03-04

parseTimeMultipleM Source #

Arguments

:: (MonadFail m, ParseTime t) |
=> Bool | Accept leading and trailing whitespace?
-> TimeLocale | Time locale.
-> [(String, String)] | Pairs of (format string, input string).
-> m t | Return the time value, or fail if the input could not be parsed using the given format.

Parses a time value given a list of pairs of format and input. Resulting value is constructed from all provided specifiers.

parseTimeOrError Source #

Arguments

:: ParseTime t |
=> Bool | Accept leading and trailing whitespace?
-> TimeLocale | Time locale.
-> String | Format string.
-> String | Input string.
-> t | The time value.

Parse a time value given a format string. Fails if the input could not be parsed using the given format. See `parseTimeM` for details.

readSTime Source #

Arguments

:: ParseTime t |
=> Bool | Accept leading whitespace?
-> TimeLocale | Time locale.
-> String | Format string
-> ReadS t |

Parse a time value given a format string. See `parseTimeM` for details.

readPTime Source #

Arguments

:: ParseTime t |
=> Bool | Accept leading whitespace?
-> TimeLocale | Time locale.
-> String | Format string
-> ReadP t |

Parse a time value given a format string. See `parseTimeM` for details.

prognameandversion :: String Source #

The program name and version string for this build of the hledger tool, including any git info available at build time.

versionString :: ProgramName -> PackageVersion -> String Source #

A helper to generate the best version string we can from the given program name and package version strings, current os and architecture, and any git info available at build time (commit hash, commit date, branch name, patchlevel since latest release tag for that program's package). Typically called for programs "hledger", "hledger-ui", or "hledger-web".

The git info changes whenever any file in the repository changes. Keeping this template haskell call here and not down in Hledger.Cli.Version helps reduce the number of modules recompiled.

helpflags :: [Flag RawOpts] Source #

Common help flags: --help, --debug, --version...

detailedversionflag :: Flag RawOpts Source #

A hidden flag just for the hledger executable.

flattreeflags :: Bool -> [Flag RawOpts] Source #

Flags for selecting flat/tree mode, used for reports organised by account. With a True argument, shows some extra help about inclusive/exclusive amounts.

hiddenflags :: [Flag RawOpts] Source #

Common flags that are accepted but not shown in --help, such as --effective, --aux-date.

inputflags :: [Flag RawOpts] Source #

Common input-related flags: --file, --rules-file, --alias...

reportflags :: [Flag RawOpts] Source #

Common report-related flags: --period, --cost, etc.

outputFormatFlag :: [String] -> Flag RawOpts Source #

Common output-related flags: --output-file, --output-format...

outputFileFlag :: Flag RawOpts Source #

generalflagsgroup1 :: (String, [Flag RawOpts]) Source #

generalflagsgroup2 :: (String, [Flag RawOpts]) Source #

generalflagsgroup3 :: (String, [Flag RawOpts]) Source #

defMode :: Mode RawOpts Source #

An empty cmdargs mode to use as a template. Modes describe the top-level command, ie the program, or a subcommand, telling cmdargs how to parse a command line and how to generate the command's usage text.

defCommandMode :: [Name] -> Mode RawOpts Source #

A cmdargs mode suitable for a hledger built-in command with the given names (primary name + optional aliases). The usage message shows [QUERY] as argument.

addonCommandMode :: Name -> Mode RawOpts Source #

A cmdargs mode representing the hledger add-on command with the given name, providing hledger's common inputreportinghelp flags. Just used when invoking addons.

hledgerCommandMode :: CommandDoc -> [Flag RawOpts] -> [(String, [Flag RawOpts])] -> [Flag RawOpts] -> ([Arg RawOpts], Maybe (Arg RawOpts)) -> Mode RawOpts Source #

Build a cmdarg mode for a hledger command, from a help template and flag/argument specifications. Reduces boilerplate a little, though the complicated cmdargs flag and argument specs are still required.

argsFlag :: FlagHelp -> Arg RawOpts Source #

showModeUsage :: Mode a -> String Source #

Get a mode's usage message as a nicely wrapped string.

withAliases :: String -> [String] -> String Source #

Add command aliases to the command's help string.

likelyExecutablesInPath :: IO [String] Source #

Get all sorted unique filenames in the current user's PATH. We do not currently filter out non-file objects or files without execute permission.

hledgerExecutablesInPath :: IO [String] Source #

Get the sorted unique filenames of all hledger-* executables in the current user's PATH. These are files in any of the PATH directories, named hledger-*, with either no extension (and no periods in the name) or one of the addonExtensions. We do not currently filter out non-file objects or files without execute permission.

ensureDebugHasArg :: (Eq (t Char), IsString (t Char), Foldable t) => [t Char] -> [t Char] Source #

Convert an argument-less --debug flag to --debug=1 in the given arguments list. Used by hledgeruiweb to make their command line parsing easier somehow.

defcliopts :: CliOpts Source #

getHledgerCliOpts :: Mode RawOpts -> IO CliOpts Source #

getHledgerCliOpts' :: Mode RawOpts -> [String] -> IO CliOpts Source #

A helper for addon commands: this parses options and arguments from the current command line using the given hledger-style cmdargs mode, and returns a CliOpts. Or, with --help or -h present, it prints long or short help, and exits the program. When --debug is present, also prints some debug output. Note this is not used by the main hledger executable.

The help texts are generated from the mode. Long help includes the full usage description generated by cmdargs (including all supported options), framed by whatever pre- and postamble text the mode specifies. It's intended that this forms a complete help document or manual.

Short help is a truncated version of the above: the preamble and the first part of the usage, up to the first line containing "flags:" (normally this marks the start of the common hledger flags); plus a mention of --help and the (presumed supported) common hledger options not displayed.

Tips: Empty lines in the pre/postamble are removed by cmdargs; add a space character to preserve them.

rawOptsToCliOpts :: RawOpts -> IO CliOpts Source #

Parse raw option string values to the desired final data types. Any relative smart dates will be converted to fixed dates based on today's date. Parsing failures will raise an error. Also records the terminal width, if supported.

outputFormats :: [String] Source #

defaultOutputFormat :: String Source #

journalFilePathFromOpts :: CliOpts -> IO [String] Source #

Get the (tilde-expanded, absolute) journal file path from 1. options, 2. an environment variable, or 3. the default. Actually, returns one or more file paths. There will be more than one if multiple -f options were provided. File paths can have a READER: prefix naming a reader/data format.

rulesFilePathFromOpts :: CliOpts -> IO (Maybe FilePath) Source #

Get the (tilde-expanded) rules file path from options, if any.

outputFileFromOpts :: CliOpts -> IO (Maybe FilePath) Source #

Get the expanded, absolute output file path specified by an -o/--output-file options, or nothing, meaning stdout.

outputFormatFromOpts :: CliOpts -> String Source #

Get the output format from the --output-format option, otherwise from a recognised file extension in the --output-file option, otherwise the default (txt).

defaultWidth :: Int Source #

Default width for hledger console output, when not otherwise specified.

replaceNumericFlags :: [String] -> [String] Source #

Replace any numeric flags (eg -2) with their long form (--depth 2), as I'm guessing cmdargs doesn't support this directly.

registerWidthsFromOpts :: CliOpts -> (Int, Maybe Int) Source #

Get the width in characters to use for the register command's console output, and also the description column width if specified (following the main width, comma-separated). The widths will be as follows: `no --width flag - overall width is the available width (COLUMNS, or posix terminal width, or 80); description width is unspecified (auto) --width W - overall width is W, description width is auto --width W,D - overall width is W, description width is D` Will raise a parse error for a malformed --width argument.

hledgerAddons :: IO [String] Source #

Get the sorted unique canonical names of hledger addon commands found in the current user's PATH. These are used in command line parsing and to display the commands list.

Canonical addon names are the filenames of hledger-* executables in PATH, without the "hledger-" prefix, and without the file extension except when it's needed for disambiguation (see below).

When there are exactly two versions of an executable (same base name, different extensions) that look like a source and compiled pair (one has .exe, .com, or no extension), the source version will be excluded (even if it happens to be newer). When there are three or more versions (or two versions that don't look like a source/compiled pair), they are all included, with file extensions intact.

topicForMode :: Mode a -> Topic Source #

Get the most appropriate documentation topic for a mode. Currently, that is either the hledger, hledger-ui or hledger-web manual.

printHelpForTopic :: Tool -> Maybe Topic -> IO () Source #

Print plain text help for this tool. Takes an optional topic argument for convenience but it is currently ignored.

runManForTopic :: Tool -> Maybe Topic -> IO () Source #

Display a man page for this tool, scrolled to the given topic if provided, using the "man" executable in $PATH. Note when a topic is provided we force man to use the "less" executable in $PATH, ignoring $MANPAGER and $PAGER.

runInfoForTopic :: Tool -> Maybe Topic -> IO () Source #

Display an info manual for this topic, opened at the given topic if provided, using the "info" executable in $PATH.

runPagerForTopic :: Tool -> Maybe Topic -> IO () Source #

Display plain text help for this tool, scrolled to the given topic if provided, using the given pager executable. Note when a topic is provided we ignore the provided pager and use the "less" executable in $PATH.

unsupportedOutputFormatError :: String -> String Source #

Standard error message for a bad output format specified with -O/-o.

withJournalDo :: CliOpts -> (Journal -> IO a) -> IO a Source #

Parse the user's specified journal file(s) as a Journal, maybe apply some transformations according to options, and run a hledger command with it. Or, throw an error.

writeOutput :: CliOpts -> String -> IO () Source #

Write some output to stdout or to a file selected by --output-file. If the file exists it will be overwritten.

writeOutputLazyText :: CliOpts -> Text -> IO () Source #

Write some output to stdout or to a file selected by --output-file. If the file exists it will be overwritten. This function operates on Lazy Text values.

journalTransform :: CliOpts -> Journal -> Journal Source #

Apply some extra post-parse transformations to the journal, if specified by options. These happen after journal validation, but before report calculation. They include:

- adding forecast transactions (--forecast)
- pivoting account names (--pivot)
- anonymising (--anonymise).

This will return an error message if the query in any auto posting rule fails to parse, or the generated transactions are not balanced.

journalReload :: CliOpts -> ExceptT String IO Journal Source #

Re-read the journal file(s) specified by options, applying any transformations specified by options. Or return an error string. Reads the full journal, without filtering.

journalReloadIfChanged :: CliOpts -> Day -> Journal -> ExceptT String IO (Journal, Bool) Source #

Re-read the option-specified journal file(s), but only if any of them has changed since last read. (If the file is standard input, this will either do nothing or give an error, not tested yet). Returns a journal or error message, and a flag indicating whether it was re-read or not. Like withJournalDo and journalReload, reads the full journal, without filtering.

journalFileIsNewer :: Journal -> FilePath -> IO Bool Source #

Has the specified file changed since the journal was last read ? Typically this is one of the journal's journalFilePaths. These are not always real files, so the file's existence is tested first; for non-files the answer is always no.

openBrowserOn :: String -> IO ExitCode Source #

Attempt to open a web browser on the given url, all platforms.

writeFileWithBackup :: FilePath -> String -> IO () Source #

Back up this file with a (incrementing) numbered suffix, then overwrite it with this new text, or give an error.

writeFileWithBackupIfChanged :: FilePath -> Text -> IO Bool Source #

Back up this file with a (incrementing) numbered suffix then overwrite it with this new text, or give an error, but only if the text is different from the current file contents, and return a flag indicating whether we did anything.

The given text should have unix line endings (n); the existing file content will be normalised to unix line endings before comparing the two. If the file is overwritten, the new file will have the current system's native line endings (n on unix, rn on windows). This could be different from the file's previous line endings, if working with a DOS file on unix or vice-versa.

readFileStrictly :: FilePath -> IO Text Source #

pivotByOpts :: CliOpts -> Journal -> Journal Source #

Apply the pivot transformation on a journal, if option is present.

anonymiseByOpts :: CliOpts -> Journal -> Journal Source #

Apply the anonymisation transformation on a journal, if option is present

journalSimilarTransaction :: CliOpts -> Journal -> Text -> Maybe Transaction Source #

postingsOrTransactionsReportAsText :: Bool -> CliOpts -> (Int -> Int -> (a, [WideBuilder], [WideBuilder]) -> Builder) -> (a -> MixedAmount) -> (a -> MixedAmount) -> [a] -> Builder Source #

Render a `PostingsReport` or `AccountTransactionsReport` as Text, determining the appropriate starting widths and increasing as necessary.

tests_Cli_Utils :: TestTree Source #

argsToCliOpts :: [String] -> [String] -> IO CliOpts Source #

Parse hledger CLI options from these command line arguments and add-on command names, or raise any error.

packageversion :: PackageVersion Source #

The "1.30.1" string defined with -D in this package's package.yaml/.cabal file (by Shake setversion), if any. Normally a dotted number string with 1-3 components.

progname :: ProgramName Source #

The name of this package's main executable.

versionStringWith :: Either String GitInfo -> ProgramName -> PackageVersion -> VersionString Source #

Given possible git state info from the build directory (or an error message, which is ignored), the name of a program (executable) in the currently building package, and the package's version, make a complete version string. Here is the logic:

- Program name, OS and architecture are always shown.
- The package version is always shown.
- If there is git info at build time, the latest commit hash and commit date are shown, and (TODO, requires githash to use -uno for giDirty): if the working copy has uncommitted changes a + sign is appended.
- (TODO, requires adding --match support to githash: If there are tags matching THISPKG-[0-9]*, the latest one is used to calculate patch level (number of commits since tag), and if non-zero, it and the branch name are shown.)

Some example outputs:

- A homebrew binary, not built in git repo: hledger-ui 1.24, mac-aarch64
- A CI release build, built in git repo at release tag: hledger-ui 1.24.1-g455b35293-20211210, mac-x86_64
- (TODO) A dev build, built in git repo: hledger-ui 1.24.1+1-g4abd8ef10-20211210 (1.24-branch), mac-x86_64

This function requires git log to show the default (rfc2822-style) date format, so that must not be overridden by a log.date git config variable.

testcmd :: CliOpts -> Journal -> IO () Source #

The test command, which runs the hledger and hledger-lib packages' unit tests. This command also accepts tasty test runner options, written after a -- (double hyphen).

Unlike most hledger commands, this one does not read the user's journal. A `Journal` argument remains in the type signature, but it should not be used (and would raise an error).

builtinCommands :: [(Mode RawOpts, CliOpts -> Journal -> IO ())] Source #

The cmdargs subcommand mode (for command-line parsing) and IO action (for doing the command's work) for each builtin command. Command actions take parsed CLI options and a (lazy) finalised journal.

builtinCommandNames :: [String] Source #

All names and aliases of the builtin commands.

findBuiltinCommand :: String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ()) Source #

Look up a builtin command's mode and action by exact command name or alias.

knownAddonCommands :: [String] Source #

Canonical names of the known addon commands which have a slot in the commands list, in alphabetical order.

knownCommands :: [String] Source #

Canonical names of all commands which have a slot in the commands list, in alphabetical order. These include the builtin commands and the known addon commands.

printCommandsList :: String -> [String] -> IO () Source #

Print the commands list, with a pager if appropriate, customising the commandsList template above with the given version string and the installed addons. Uninstalled known addons will be removed from the list, installed known addons will have the + prefix removed, and installed unknown addons will be added under Misc.

tests_Hledger_Cli :: TestTree Source #

accountsmode :: Mode RawOpts Source #

Command line options for this command.

accounts :: CliOpts -> Journal -> IO () Source #

The accounts command.

activitymode :: Mode RawOpts Source #

addmode :: Mode RawOpts Source #

appendToJournalFileOrStdout :: FilePath -> Text -> IO () Source #

Append a string, typically one or more transactions, to a journal file, or if the file is "-", dump it to stdout. Tries to avoid excess whitespace.

XXX This writes unix line endings (n), some at least, even if the file uses dos line endings (rn), which could leave mixed line endings in the file. See also writeFileWithBackupIfChanged.

journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO Journal Source #

Append this transaction to the journal's file and transaction list.

postingsReportAsText :: CliOpts -> PostingsReport -> Text Source #

Render a register report as plain text suitable for console output.

aregistermode :: Mode RawOpts Source #

aregister :: CliOpts -> Journal -> IO () Source #

Print an account register report for a specified account.

tests_Aregister :: TestTree Source #

balancemode :: Mode RawOpts Source #

Command line options for this command.

balanceReportAsText :: ReportOpts -> BalanceReport -> Builder Source #

Render a single-column balance report as plain text.

balanceReportAsCsv :: ReportOpts -> BalanceReport -> CSV Source #

Render a single-column balance report as CSV.

balanceReportItemAsText :: ReportOpts -> BalanceReportItem -> (Builder, [Int]) Source #

Render one balance report line item as plain text suitable for console output (or whatever string format is specified). Note, prices will not be rendered, and differently-priced quantities of the same commodity will appear merged. The output will be one or more lines depending on the format and number of commodities.

multiBalanceRowAsCsvText :: ReportOpts -> [DateSpan] -> PeriodicReportRow a MixedAmount -> [[Text]] Source #

multiBalanceRowAsTableText :: ReportOpts -> PeriodicReportRow a MixedAmount -> [[WideBuilder]] Source #

multiBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> Text Source #

Render a multi-column balance report as plain text suitable for console output.

multiBalanceReportAsCsv :: ReportOpts -> MultiBalanceReport -> CSV Source #

Render a multi-column balance report as CSV. The CSV will always include the initial headings row, and will include the final totals row unless --no-total is set.

multiBalanceReportAsHtml :: ReportOpts -> MultiBalanceReport -> Html () Source #

Render a multi-column balance report as HTML.

multiBalanceReportHtmlRows :: ReportOpts -> MultiBalanceReport -> (Html (), [Html ()], [Html ()]) Source #

Render the HTML table rows for a MultiBalanceReport. Returns the heading row, 0 or more body rows, and the totals row if enabled.

multiBalanceReportHtmlFootRow :: ReportOpts -> [Text] -> Html () Source #

Render one MultiBalanceReport totals row as a HTML table row.

balanceReportAsTable :: ReportOpts -> MultiBalanceReport -> Table Text Text WideBuilder Source #

Build a `Table` from a multi-column balance report.

tests_Balance :: TestTree Source #

balancesheetmode :: Mode RawOpts Source #

balancesheet :: CliOpts -> Journal -> IO () Source #

balancesheetequitymode :: Mode RawOpts Source #

balancesheetequity :: CliOpts -> Journal -> IO () Source #

cashflowmode :: Mode RawOpts Source #

cashflow :: CliOpts -> Journal -> IO () Source #

closemode :: Mode RawOpts Source #

codesmode :: Mode RawOpts Source #

Command line options for this command.

codes :: CliOpts -> Journal -> IO () Source #

The codes command.

commoditiesmode :: Mode RawOpts Source #

Command line options for this command.

commodities :: CliOpts -> Journal -> IO () Source #

demomode :: Mode RawOpts Source #

Command line options for this command.

demo :: CliOpts -> Journal -> IO () Source #

The demo command.

descriptionsmode :: Mode RawOpts Source #

Command line options for this command.

descriptions :: CliOpts -> Journal -> IO () Source #

The descriptions command.

diffmode :: Mode RawOpts Source #

Command line options for this command.

helpmode :: Mode RawOpts Source #

help' :: CliOpts -> Journal -> IO () Source #

Display the hledger manual in various formats. You can select a docs viewer with one of the `--info`, `--man`, `--pager` flags. Otherwise it will use the first available of: info, man, $PAGER, less, stdout (and always stdout if output is non-interactive).

importmode :: Mode RawOpts Source #

importcmd :: CliOpts -> Journal -> IO () Source #

incomestatementmode :: Mode RawOpts Source #

incomestatement :: CliOpts -> Journal -> IO () Source #

notesmode :: Mode RawOpts Source #

Command line options for this command.

notes :: CliOpts -> Journal -> IO () Source #

The notes command.

payeesmode :: Mode RawOpts Source #

Command line options for this command.

payees :: CliOpts -> Journal -> IO () Source #

The payees command.

pricesmode :: Mode RawOpts Source #

prices :: CliOpts -> Journal -> IO () Source #

printmode :: Mode RawOpts Source #

print' :: CliOpts -> Journal -> IO () Source #

Print journal transactions in standard format.

originalTransaction :: Transaction -> Transaction Source #

registermode :: Mode RawOpts Source #

register :: CliOpts -> Journal -> IO () Source #

Print a (posting) register report.

postingsReportItemAsText :: CliOpts -> Int -> Int -> (PostingsReportItem, [WideBuilder], [WideBuilder]) -> Builder Source #

Render one register report line item as plain text. Layout is like so: `width (specified, terminal width, or 80) -------------------- date (10) description account amount (12) balance (12) DDDDDDDDDD dddddddddddddddddddd aaaaaaaaaaaaaaaaaaa AAAAAAAAAAAA AAAAAAAAAAAA` If description's width is specified, account will use the remaining space. Otherwise, description and account divide up the space equally.

With a report interval, the layout is like so: `width (specified, terminal width, or 80) -------------------- date (21) account amount (12) balance (12) DDDDDDDDDDDDDDDDDDDDD aaaaaaaaaaaaaaaaaaaaaaaaaaaaa AAAAAAAAAAAA AAAAAAAAAAAA`

date and description are shown for the first posting of a transaction only.

Returns a string which can be multi-line, eg if the running balance has multiple commodities. Does not yet support formatting control like balance reports.

Also returns the natural width (without padding) of the amount and balance fields.

tests_Register :: TestTree Source #

rewritemode :: Mode RawOpts Source #

rewrite :: CliOpts -> Journal -> IO () Source #

statsmode :: Mode RawOpts Source #

stats :: CliOpts -> Journal -> IO () Source #

Print various statistics for the journal.

tagsmode :: Mode RawOpts Source #

tags :: CliOpts -> Journal -> IO () Source #

barchar :: Char Source #

activity :: CliOpts -> Journal -> IO () Source #

Print a bar chart of number of postings per report interval.

showHistogram :: ReportSpec -> Journal -> String Source #

printDayWith :: (PrintfArg t1, PrintfType t2) => (t3 -> t1) -> (DateSpan, t3) -> t2 Source #

countBar :: Foldable t => t a -> [Char] Source #