-
Notifications
You must be signed in to change notification settings - Fork 11
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
Overhaul name_of_type #12
Conversation
# it is a bug in our implementation if this error every gets hit. | ||
isbits(x) || throw(DomainError((x, T), "not a valid type-param")) | ||
return x | ||
end |
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.
Added these literals rather than name_of_type(x)=x
so i can be sure nothing slipped through
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
==========================================
+ Coverage 99.31% 99.42% +0.11%
==========================================
Files 4 4
Lines 145 173 +28
==========================================
+ Hits 144 172 +28
Misses 1 1
Continue to review full report at Codecov.
|
src/method.jl
Outdated
@@ -95,7 +132,8 @@ function arguments(m::Method) | |||
end | |||
end | |||
|
|||
function where_parameters(x::TypeVar) | |||
# type-vars can only show up attached to UnionAlls. | |||
function where_parameter1(x::TypeVar) |
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 rename is because it doesn't return list of where parameters
just formats 1 of them
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 feel like we need something a bit more descriptive here.
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 can't think of a better one.
Its not unsual to have:
foos(xs) = map(foo1, xs)
This is the processing for single thing that kind of maps to the multiple things that whereparams
is trying to process.
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.
Its not unsual to have:
foos(xs) = map(foo1, xs)
I've never seen this before (in Julia, Python or Scala that i've seen)
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.
but i've no better name suggestion - sorry
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've never seen this before (in Julia, Python or Scala that i've seen)
Just a different way of doing things.
julia> @time [x^2 for x in [1,2,3]]
0.022936 seconds (41.61 k allocations: 2.128 MiB)
3-element Array{Int64,1}:
1
4
9
julia> @time map(x->x^2, [1,2,3])
0.023335 seconds (48.81 k allocations: 2.499 MiB)
3-element Array{Int64,1}:
1
4
9
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 meant the 1
suffix naming convention
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 makes more sense 😆
src/method.jl
Outdated
@@ -95,7 +132,8 @@ function arguments(m::Method) | |||
end | |||
end | |||
|
|||
function where_parameters(x::TypeVar) | |||
# type-vars can only show up attached to UnionAlls. | |||
function where_parameter1(x::TypeVar) |
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 feel like we need something a bit more descriptive here.
Co-authored-by: mattBrzezinski <matt.brzezinski@invenia.ca>
The better name was in reprospect obvious |
I'm logging off for the night, but I will take a look at this first thing tomorrow morning! |
Tuple{}
Val{:foo}
)I think this also has some other changes, to support other things, but not sure what they are. Hopefully code-cov will tell me if I have added any features i forget about.Here are tests that failed before