question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use idiomatic/canonical option type annotations in Result module

See original GitHub issue

Result.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:closed
  • Created 9 months ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
cmeerencommented, Dec 28, 2022

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.

1reaction
edgarfgpcommented, Dec 28, 2022

Regarding array changes. The remaining work is tracked here https://github.com/dotnet/fsharp/issues/14329.

  • Update FSharp.Core API reference
  • Update docs
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found