Imports
import brings in a module. The bundled modules are always available.
| Module | Contains |
|---|---|
physics/constants | CODATA 2022 constants: c, G, planck constant, boltzmann constant, avogadro constant, gas constant, electron mass, proton mass, elementary charge, g0, and short names kB, qe, NA, R, hbar, me, mp, eps0, mu0 |
whimsy/uk | double decker bus, Nelsons Column, football pitch, Wales, Olympic swimming pool |
whimsy/us | football field, Empire State Building, Rhode Island, Texas |
whimsy/au | cricket pitch, Tasmania, Sydney Harbour |
whimsy/cabinet | smoot, barn, shake, jiffy, fortnight, microfortnight, attoparsec, and friends |
finance/core | Profit(incoming, outgoing) with profit and margin, Annuity(principal, rate, periods) with payment, RegularPayments(payment, rate, periods) with value; the fundamentals the other finance modules are built from, on the prelude’s CompoundInterest, and every one runs backwards |
finance/mortgage | Mortgage(principal, apr, term, period, arrangement fee), RepaymentTerm(principal, apr, payment), Overpayment(principal, apr, term, extra) |
finance/property | Rent(tenant pays, landlord costs, agents fees), RentalYield(price, rent), NetYield(price, rent, costs), Flip(purchase, refurb, sale, …); rents and costs are rates per month |
finance/tax | VAT(net, rate), SalesTax(price, rate), Tip(bill, rate, people) |
health/body | BMI, BMRMale, BMRFemale, TDEE(bmr, activity) with the activity ladder (sedentary … extra active), HeartRate(age), the bpm unit |
finance/savings | Savings(deposit, apr, term, compounding), RegularSaving(monthly, apr, term), SavingsPlan(deposit, monthly, apr, term), DoublingTime(apr), Inflation(amount, rate, term) |
fitness/running | Pace(distance, time) with pace and speed, RacePrediction(distance, time, target), RunningEnergy(weight, distance), Strides(distance, stride), the marathon and half marathon units |
home/energy | Appliance(power, daily use, tariff), Bill(previous, current, unit rate, standing charge, period), Charging(battery, charger, tariff, losses), Solar(capacity, install cost, tariff, yield) |
home/diy | Room(length, width, height, openings), Paint(area, coats, coverage, tin), Tiles(area, tile length, tile width, waste), Flooring(area, pack covers, waste), Wallpaper(perimeter, height, …), Concrete(length, width, depth, waste, bag makes) |
kitchen/cooking | Scale(serves, want, quantity), Ingredient(volume, density) with the density ladder (flour, sugar, butter, …), Oven(temperature) with fan, fahrenheit and gas mark, Roast(weight, per kilo, plus) with the per-kilo ladder (chicken, beef rare, …), Dough(flour, hydration, salt share, yeast share) |
travel/trip | Drive(distance, speed, stops), Fuel(distance, economy, price), Electric(distance, economy, price), Range(tank, economy), Budget(nights, hotel, spending, flights, people), the mpg, UK mpg and night units |
shapes/2d | Circle, Ellipse, Rectangle(width, height), Square(side), Triangle, TriangleSides, RightTriangle, Trapezoid, Polygon; every one runs backwards |
shapes/3d | Sphere, Cylinder, Cone, Pyramid (on a Square, with slant angle), Frustum (a Cone less a cone, with slant angle), Box(width, length, height) on its base rectangle, Cube; every one runs backwards, and importing it brings shapes/2d along |
physics/mechanics | Fall(height), Motion(acceleration, time, initial speed), Braking(speed, deceleration, reaction), Projectile(speed, angle), Kinetic, Potential, Momentum, Force, Lift, Pendulum; gravity defaults to standard gravity |
physics/electrical | Ohm(voltage, current) with resistance and power, Series, Parallel, VoltageDivider(input, top, bottom), LED(supply, forward voltage, current), Battery(capacity, load, voltage), RC(resistance, capacitance), the Ah, kohm, Mohm and farad units |
import "physics/constants"
earth mass = standard gravity * (6371 km)^2 / G to 3 sf
earth mass to kg
import "whimsy/uk"
1 Olympic swimming pool to l
The formula libraries run in either direction, like any formula.
import "finance/mortgage"
import "finance/tax"
Mortgage(principal = £300,000, apr = 5%)::monthly payment
Mortgage(monthly payment = £1,500/month, apr = 5%)::principal
VAT(gross = £120)::net
An imported module’s public names join your document. Names declared with
let inside a module stay private to it. Two imports that define the same
name are an error; a name you define yourself wins over an import.