*Main> (1 meter / second) * 5 second
5.0 m/s⋅s
*Main> 2 meter + (1 meter / second) * 5 second
7.0 m
One really cute trick is that the various si prefixes are actually functions. So instead of defining every combination of milli-, centi-, deci and so on, you can write them like this: Main*> 1 kilo meter + 324 centi meter
1.00324 km
The library can convert between compatible units automatically, so you never have to worry about the conversion factor: Main*> 1.23 kilo meter `as` mile
0.7642865664519207 mile
Since the prefixes are systematic, you can come up with your own bastardized units: Main*> 1 centi mile `as` kilo inch
0.6336000000000002 kin
Of course, if we try to combine incompatible units, we get a type error. And this shows the most glaring problem with this library :P. Main*> 10 second + 2 inch
<interactive>:38:11:
Couldn't match type 'GHC.Types.False with 'GHC.Types.True
When using functional dependencies to combine
UnitTyped.And 'GHC.Types.False 'GHC.Types.False 'GHC.Types.False,
arising from the dependency `a b -> c'
in the instance declaration in `UnitTyped'
UnitTyped.And 'GHC.Types.False 'GHC.Types.False 'GHC.Types.True,
arising from a use of `+' at <interactive>:38:11
In the expression: 10 second + 2 inch
In an equation for `it': it = 10 second + 2 inch
This message is absolutely hideous. But it's still better than nothing. I think some mechanism for letting libraries customize type error messages would be awesome, but I don't know what that would look like.[1]: https://bitbucket.org/xnyhps/haskell-unittyped/wiki/Examples