This repository has been archived by the owner on Oct 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename example files * fix MaybeVector and add maybe.jl with docs * fix zoom lens @show syss[1] typo
- Loading branch information
1 parent
9aa3416
commit 3dbe82a
Showing
6 changed files
with
30 additions
and
11 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
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
File renamed without changes.
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,21 @@ | ||
# MIT license | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# See LICENSE in the project root for full license information. | ||
|
||
export Maybe, MaybeVector | ||
|
||
""" | ||
Haskell-style [option type](https://en.wikipedia.org/wiki/Option_type) primarily used to allow optional inputs/outputs | ||
for functions. | ||
For example, in `src/Examples/docs_examples.jl`, we have `draw_cooketriplet(filename::Maybe{AbstractString} = nothing)`. | ||
If the function is called with a `filename` argument, then it is passed as a string, and `Vis.save(filename)` saves an | ||
image of the drawn example. If there is no argument, then the save call is dispatched to the empty `function | ||
Vis.save(::Nothing) end`. This allows the user to run the example without saving a file. | ||
""" | ||
const Maybe{T} = Union{T, Nothing} | ||
|
||
""" | ||
Extension of `Maybe{T}` which allows things like `[nothing, 1, 1.0, nothing] isa MaybeVector{Real}` | ||
""" | ||
const MaybeVector{T} = Vector{<:Maybe{T}} |