Skip to content

Conversation

@iamed2
Copy link
Contributor

@iamed2 iamed2 commented Jun 24, 2017

After this PR:

@inferred Val{2} + Val{1} == Val{3}

I was doing inlineable type-stable recursion in AxisArrays but wanted to be able to specify an early terminator. I started with just decrement but decided to do +, -, and * in case other use cases came up.

@ararslan ararslan added the maths Mathematical functions label Jun 24, 2017
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, but I should have Inference able to do this soon enough :)

@andyferris
Copy link
Member

Very funny.

I got a PR open for a Val(x) constructor so that this might instead become

Val(2) + Val(1) == Val(3)

I've also had a long-standing plan to make a StaticNumbers package to live alongside StaticArrays that does this stuff (e.g. SInt as "static integer").

But by far the best plan is as Jameson says - make inference do this propagation automatically :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maths Mathematical functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants