penny-lib-0.2.0.0: Extensible double-entry accounting system - library

Safe HaskellSafe-Infered

Penny.Lincoln.Builders

Description

Partial functions that make common types in Lincoln. Some data types in Lincoln are deeply nested, with TextNonEmpty nested inside of a newtype, nested inside of a NonEmptyList, nested inside of... :) All the nesting ensures to the maximum extent possible that the type system reflects the restrictions that exist on Penny's data. For example, it would make no sense to have an empty account (that is, an account with no sub-accounts) or a sub-account whose name is an empty Text.

The disadvantage of the nesting is that building these data types can be tedious if, for example, you want to build some data within a short custom Haskell program. Thus, this module.

Synopsis

Documentation

crashy :: Show e => Exceptional e a -> aSource

Makes a function partial. Use if you don't want to bother dealing with the Exceptional type.

account :: String -> Exceptional String AccountSource

Create an Account. You supply a single String, with colons to separate the different sub-accounts.

commodity :: String -> Exceptional String CommoditySource

Create a Commodity. You supply a single String, with colons to separate the different sub-commodities.