{- $powers-of-length-units
It is permissible to express powers of length units by prefixing
'square' and 'cubic' (see section 9.6 "Spelling unit names raised
to powers" of <#note1 [1]>).

These definitions may seem slightly out of place but these is no
obvious place where they should be. Here they are at least close
to the definitions of 'DArea' and 'DVolume'.
-}

-- $setup
-- >>> import Numeric.Units.Dimensional.Prelude

-- | Constructs a unit of area from a unit of length, taking the area of a square whose sides are that length.
--
-- >>> 64 *~ square meter == (8 *~ meter) ^ pos2
-- True
square :: (Fractional a, Typeable m) => Unit m DLength a -> Unit 'NonMetric DArea a
square x = x ^ pos2
square :: (Fractional a, Typeable m) => Unit m DLength a -> Unit 'NonMetric DArea a
square x = x ^ pos2
square x = x ^ pos2