@@ -7,28 +7,28 @@ encode physical units at *compile time*.
77## Examples
88
99``` purs
10- > printResult $ 2.0 .* minutes ⊕ 30.0 .* seconds
11- 2.5min
10+ > showResult $ 2.0 .* minutes ⊕ 30.0 .* seconds
11+ " 2.5min"
1212
13- > printResult $ (85.0 .* miles ./ hour) `convertTo` (meters ./ second)
14- 37.9984m/s
13+ > showResult $ (85.0 .* miles ./ hour) `convertTo` (meters ./ second)
14+ " 37.9984m/s"
1515
16- > printResult $ (10.0 .* meters ./ second) `convertTo` (kilo meters ./ hour)
17- 36.0km/h
16+ > showResult $ (10.0 .* meters ./ second) `convertTo` (kilo meters ./ hour)
17+ " 36.0km/h"
1818
19- > printResult $ (10.0 .* miles) `convertTo` (grams .^ 2.0)
20- Cannot unify unit 'mi' with unit 'g²'
19+ > showResult $ (10.0 .* miles) `convertTo` (grams .^ 2.0)
20+ " Cannot unify unit 'mi' with unit 'g²'"
2121
22- > printResult $ sin (90.0 .* degree)
23- 1.0
22+ > showResult $ sin (90.0 .* degree)
23+ " 1.0"
2424```
2525
2626Calculate the time it takes to download a * 2.7GB* file on a * 6Mbit/s* connection:
2727``` purs
2828> let filesize = 2.7 .* giga byte
2929> let speed = 6.0 .* mega bit ./ second
30- > printResult $ (filesize ⊘ speed) `convertTo` hours
31- 1.0h
30+ > showResult $ (filesize ⊘ speed) `convertTo` hours
31+ " 1.0h"
3232```
3333
3434Calculate the oscillation period * T = 2π sqrt(L/g)* of a pendulum with length * L = 20cm* :
@@ -37,8 +37,8 @@ Calculate the oscillation period *T = 2π sqrt(L/g)* of a pendulum with length *
3737> let length = 20.0 .* centi meter
3838> let period = scalar (2.0 * pi) ⊗ sqrt (length ⊘ g)
3939
40- > printResult $ period `convertTo` milli seconds
41- 897.1402930932747ms
40+ > showResult $ period `convertTo` milli seconds
41+ " 897.1402930932747ms"
4242```
4343
4444## Documentation
0 commit comments