-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre 1.3 #241
Conversation
To clean up the space for lens. I don't view was a great description of the function anyway.
This is just a replacement for (#) from lens.
And replace the old function in favour of lenses and the transform Isos.
This helps with type inference, so if something needs a Color a you can give it green or green `withOpacity` 0.4 and it'll work out it's Double.
Prism' (Texture n) (AlphaColour Double)
And a Read instance.
Also export Data.Colour.SRGB in Prelude.
For Parametric and EndValues.
Including Cons and Snoc for Lines and _Line and _Loop prisms.
Make a 2D vector from an angle.
There where essensially there for the semigroup instance but took up much more code than just writing the instance out.
For lines, trails, paths and bounding boxes.
Now there's only a few conflicts with lens and Prelude. Namely beside, backwards, none, transform, (#) (moved to (##)) and (.>). inside and outside are in Diagrams.BoundingBox but not exported by Prelude.
This shouldn't cause many problems with backends. Some of them fail |
@@ -132,8 +140,11 @@ module Diagrams.Prelude | |||
-- | For working with 'Active' (i.e. animated) things. | |||
, module Data.Active | |||
|
|||
-- | Essential Lens Combinators | |||
, (&), (.~), (%~) | |||
-- | This exports most of the lens module, excluding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be lens "package" not module. Or maybe it should say "Control.Lens module".
My responses to your main changes are below. I'm still not done looking carefully through all the changes. Specialise
|
I forgot to mention 72bf032 -- transformation isomorphisms. I've added
I've added example usage in the comments for the new |
I've wanted those transformation |
Ah, I like it. I had noticed some code using movedFrom like that and On 9:48am, Tue, Mar 10, 2015 Chris notifications@github.com wrote:
|
Conflicts: src/Diagrams/Angle.hs src/Diagrams/ThreeD/Transform.hs src/Diagrams/Transform/Matrix.hs
For the more complicated ones I've just linked the corresponding reverseFoo function.
In 4.6 lens got rid of AReview' and AReview only takes 2 arguments. If we want support for lens <4.6 we need to add some CPP.
Note that |
This only exports things from diagrams or diagrams-lib. This could be usefull want to avoid conflicts other libraries exported from Diagrams.Prelude. Use Diagrams for Diagrams.Prelude.
These are functions from lens that are likely to conflict with other libraries.
So what's still holding this up? Just deciding what to do with the |
Oh, wait, I see those changes have already been made. This looks good to me. |
LGTM as well |
Great! |
This is a bunch of miscellaneous changes I wanted to make for 1.3. I've tried to make each commit a separate feature. The main changes are:
Specialise
Colour
andAlphaColour
Color
instances toDouble
This means you can write
fillColour black
without a type signature onblack
. If you happen to be working with aColour Float
you can usecolourConvert
.Move (
|>
) (qualify object withName
) to (>|
)This cleans up space for lenses snoc operator to use with
Line
s newCons
andSnoc
instances.Remove
LineJoinA
andLineCapA
I'm not too bothered about this, it just seemed silly to make a
newtype
aroundLast
just for the instance.Move
view
torectEnvelope
I'm open to name suggestions but I use
view
a lot from lens and I always forget and get horrible error messages. Also I don't thinkview
s a great name because anything outside the box is still visible, it just happens to hide it if you use it on the final diagram.New show instances
The new show instances hide the internal representation and can be copy pasted to form valid Haskell when possible.
Attribute
andStyle
instances show the name of type they're holding which is useful for debuggingExport lens from prelude
It doesn't have to be the whole of lens but I'd like a lot more. Importing lens separately makes a few annoying clashing and it is a prelude after all :)