Use idiomatic/canonical option type annotations in Result module
See original GitHub issueResult.toOption
has return type Option<'T>
. The idiomatic/canonical notation is 'T option
. The use of Option<'T>
here means that Option<'T>
shows up in code/line lens and tooltips all over my codebase when using this function, whereas I would prefer 'T option
.
I haven’t checked, but I am guessing that this could apply to other functions in the Result
module, too.
For completeness, note that the same kind of issue would also apply to functions typed with List<'T>
instead of 'T list
, and other similar types. (I haven’t checked or encountered any, though.)
Issue Analytics
- State:
- Created 9 months ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Type annotations in the standard library - Core Development
zoneinfo , I recall thinking that I would put type annotations directly into the Python version of the module (PEP 399), but most...
Read more >Annotation issues at runtime - mypy 1.5.0 documentation
Annotation issues at runtime#. Idiomatic use of type annotations can sometimes run up against what a given version of Python considers legal code....
Read more >Optional return type annotations? - python
I've looked over documentation on a module typing but haven't as of yet found any methods there that allow for this. I haven't...
Read more >Understanding type annotation in Python
In this extensive post with specific examples, learn how to use Python type annotation to your advantage using the mypy library.
Read more >What type annotation should I use to type a function that ...
What type annotation should I use to type a function that accept a type T and a value of that type using typing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I would only be changing to postfix lowercase notation in signature files for these?
option
voption
list
ref
Apart from
[]
, these are the only ones listed in the formatting guidelines, so I guess the list is complete.Regarding
array
changes. The remaining work is tracked here https://github.com/dotnet/fsharp/issues/14329.