-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
704 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These owners will be the default owners for everything in the repo and | ||
# will be requested for review when someone opens a pull request. | ||
* @stefan-lindegger @Speeedy01 @marco-bertschi @pascalberger @christianbumann @x-jokay @silanosa @georgesgoetz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"generalSettings": { | ||
"shouldScanRepo": true | ||
}, | ||
"checkRunSettings": { | ||
"vulnerableCheckRunConclusionLevel": "failure" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
Order: 10 | ||
Description: Overview about the features of BBT.Maybe. | ||
--- | ||
<p>@Html.Raw(Model.String(DocsKeys.Description))</p> | ||
|
||
@Html.Partial("_ChildPages") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
Order: 20 | ||
Title: Core principles | ||
Description: Core principles of BBT.Maybe | ||
--- | ||
|
||
C# does not (yet) include a language construct for null safe treatment of optional reference-type variables. | ||
Therefore every method argument, return value, class member, property and local variable is a challenge, because a value may or may not be assigned. | ||
A possible solution is implementing a null condition for each reference call with an if clause. | ||
This contradicts the fail fast approach, makes code less readable and increases cyclomatic complexity. | ||
A better approach is to introduce a functional option type. | ||
|
||
# Advantages | ||
|
||
* Explicit method signature: Declaration of optional reference type argument and return value through a typified construct make method documentation redundant. | ||
* Prevention of null reference exceptions: Straight access to the nullable reference value is not possible, an action for the not-null case is called instead. | ||
|
||
# Implementation details | ||
|
||
* Maybe is a value type | ||
* Default of maybe is the null case | ||
* Maybe supports actions for handling the null and the not null case | ||
* Maybe is serializable | ||
* Provides factory methods for maybe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
Order: 10 | ||
Title: Why does BBT.Maybe exist? | ||
Description: Introduction to BBT.Maybe, what problems are solved and how it's distinctive from other functional option type implementations | ||
--- | ||
|
||
BBT.Maybe is an implementation of the functional option type pattern. | ||
|
||
# Features | ||
|
||
* Makes nullable references explicit | ||
* Prevents null reference exceptions on reference calls | ||
* Provides an option type with broad usage over all layers of code | ||
|
||
# Advantages over similar libraries | ||
|
||
* Prevents access to null value, therefore no direct access is offered. | ||
* Implementation of maybe for both optional reference and nullable value types | ||
* Reduction to core functionality prevents bloated feature set | ||
* Usage of maybe in communication layer |
Oops, something went wrong.