Port to linear

Extra changes I made along the way:

- get rid of unnecessary `Backend` constraints.
- general Cartesian functions (`unitX`, `scalingY` etc.) depends on the classes (`R1`, `R2`, `R3`) so same functions can be used for R2 and R3
- SizeSpec2D iso: `spec2D :: Iso' (SizeSpec2D n) (Maybe n, Maybe n)`
- `Traced` instance for `BoundingBox`
- `halfTurn`, `quarterTurn` added (similar to `fullTurn`)
- `fromOrthogonal`, `fromSymmetric` added (similar to `fromLinear`)

Some things I'd like to change:

- change `view` to `boxEnvelope` or something similar to prevent clash with `lens`
- No `Diagrams.Prelude.ThreeD`. Have R3 functions in `Diagrams.Prelude` (in anticipation of projections)

I'm thinking of renaming type families to `F` for the container and `A` for the number type and have alias `V t = F t (A t)`. The associated type variables would also change, so it's `Point f a`, `Diagram b f a` etc. This makes it more consistent with `linear` and the `V` type has the same behaviour. Any thoughts?
Aha, I see. I like that too.
On Sep 14, 2014 1:22 AM, "Chris" <notifications@github.com> wrote:

> In src/Diagrams/BoundingBox.hs:
>
> >  boundingBox a = fromMaybeEmpty $ do
> > -    env <- appEnvelope $ getEnvelope a
> > -    let h = recompose $ map (\v -> (v,          env           $ basisValue v)) us
> > -        l = recompose $ map (\v -> (v, negate . env . negateV $ basisValue v)) us
> > -    return $ NonEmptyBoundingBox (P l, P h)
> > -  where
> > -    -- The units. Might not work if 0-components aren't reported.
> > -    --TODO: Depend on Enum Basis?
> > -    us = map fst $ decompose (zeroV :: V a)
> > +  env <- (appEnvelope . getEnvelope) a
> > +  let h = fmap env eye
>
> It's defined in Diagrams.Core.Transform as
>
> eye :: (Rep v ~ E v, Representable v, Additive v, Num n) => v (v n)
> eye = tabulate $ \(E e) -> zero & e .~ 1
>
> vector-space's HasBasis is essentially replaced by the more powerful Rep
> v ~ E v, Representable v which I much prefer.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/diagrams/diagrams-lib/pull/212/files#r17517301>.
>