OrderRecord

PackageAcme.Docs

Order functions

The Order module contains the operations for the sample Order record. Keeping behavior beside the type demonstrates how FsLiveDocs distinguishes same-named F# types and modules while presenting both in one API reference.

create rejects negative subtotals and returns a validated order. total applies a fractional tax rate, and its XML documentation includes a checked transcript.

The create source is tagged for transclusion so the deep-reference guide can display the maintained implementation rather than a copied snippet.

Fields

NameTypeDescription
IdIdNo description available.
SubtotalSubtotalNo description available.

Specification

Kind
Record
Members
2
Examples
0
createSignature
create id subtotal
totalSignature
total taxRate order

Summary

NameSignatureSynopsis
Operations
createcreate id subtotalCreates an order after validating its subtotal.
totaltotal taxRate orderCalculates the total including a fractional tax rate.

Operations

kind:member

create

create id subtotal
Member
Creates an order after validating its subtotal.

Parameters

NameTypeDescription
idintStable order identifier.
subtotaldecimalPrice before tax.

Returns

Order
kind:member

total

total taxRate order
Member
Calculates the total including a fractional tax rate.

Parameters

NameTypeDescription
taxRatedecimal
orderOrder

Returns

decimal

Verification Examples

CalculateTotal

> Acme.Docs.Order.create 7 20M |> Acme.Docs.Order.total 0.1M;;
val it: decimal = 22.0M