-
Notifications
You must be signed in to change notification settings - Fork 30
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
update for linear #40
Conversation
replace R2 with R2 n, suitable constraints on n
dmod :: RealFrac a => a -> a -> a | ||
-- | Interpolate linearly between two values. The first argument is | ||
-- the parameter. A parameter of @0@ results in the second argument; | ||
-- with a parameter of @1@, @lerp'@ returns its third argument. |
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.
I think you've got these the wrong way round :)
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.
Thanks for catching that!
I was actually working on this too :). nvm, it's nice to compare. I've also converted |
I should have checked with you before I started. Sorry. I'd like to work on a Backend or two. What have you not started on? I just gave you push rights to more repos, including |
I'd like to linearize at least one backend as well. Let me know whats left. |
Great, thanks. So far I've worked on |
@bergey why dont you take -cairo or -canvas, your choice and i'll take the other. |
@cchalmers I gave you push rights to diagrams-rasterific |
@jeffreyrosenbluth I'll take |
@bergey sounds good. will do |
Follows the argument order in vector-space.
More type class constraints in Logo
In liftF & liftF2, `a` and `n` are distinct type variables, since `f` must operate both on `n ` and `Complex n`
@@ -101,8 +99,8 @@ data Q236 = Q236 Rational Rational Rational Rational | |||
deriving (Eq, Ord, Show, Read) |
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.
This Ord
instance is wrong? It's used for Grid
but I don't fully understand it. A proper Ord
instance could be made by comparing Double
s:
instance Ord Q236 where
a <= b = toDouble a <= toDouble b
Same trick could be done for signum
.
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.
That Ord
instance has been there longer than I've been involved, so I hadn't really thought about it. I agree, it doesn't do what I'd expect (though it's adequate for Map
and the like). Does Grid
care which behavior is used?
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.
How does Grid
use this? I don't see it. The Ord
instance for Q236
was just intended for using them as keys in maps etc. I'd really rather not use toDouble a <= toDouble b
since the whole point of using the Q236
representation is to avoid having to do floating-point comparisons.
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.
I ment Edge
, specifically via mkEdge
sorry. I haven't gone thought the code so I don't know why it puts it in order. Nvm I see now it's just to have an Eq
instance for Polygon
.
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.
It looks to me like all the uses of Ord
just treat it as a canonical order, and don't assume that Q236
is an ordered field. I think it's worth adding a comment that this is deliberate, but we should leave the code alone.
@cchalmers Thanks for making nearly all the changes I planned to make today! |
Migrate from `vector-space` package to `linear` Make types more polymorphic.
Accompanies diagrams/diagrams-lib#212
This is nearly done; it remains to decide what to do about
force-layout
, and the minor name collision ofsize
. I think the choices withforce-layout
are port it to linear (it has no revdeps butdiagrams-contrib
) or createvector-space
class instances forV2
and other types, indiagrams-contrib
.