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.

Generic map and bind support for Nullable<_>

See original GitHub issue

Description

There is currently no support for using the general functions and operators for map, bind, etc. on System.Nullable<T> like there is for Option<T>. This would be nice to have when using types from C#-style libraries.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
mattstermillercommented, Apr 3, 2020

Thanks, I’ll play with it and if it seems to work I’ll submit a PR

0reactions
mattstermillercommented, Apr 6, 2020

I created a PR with a Nullable module with map, bind and iter and overloads for the generic Map and Bind. Personally I wouldn’t get much use out other things, but can add things like exists and toList if there would be a desire.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are there any nullable annotations that implicitly extend to ...
I was wondering if there are any annotations that can be added to an argument so that it covers generic types as well....
Read more >
Null Object design pattern and Maybe Monad in C# | Medium
We can extend the Nullable<T> with a Map method that would only apply a function Func<T, T1> when the nullable has a value....
Read more >
Result of left joining a nullable nominal type should be null ...
When generating left join we need to add additional null check in selector so that we can generate correct default type if sequence...
Read more >
Functional C#: Non-nullable reference types
Working with Maybe using bind and map operations is a good thing, but - again - in many cases it may signalize problems...
Read more >
Interface DatabaseClient.GenericExecuteSpec
Bind a non- null value to a parameter identified by its index . DatabaseClient. ... Configure a result mapping function and enter the...
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