-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update response types - correctly model single-value tuples.
- Loading branch information
1 parent
c363e22
commit a7c4e5e
Showing
5 changed files
with
53 additions
and
32 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,21 @@ | ||
namespace rec Fable.Import.GoogleCloud.Common | ||
|
||
/// <summary> | ||
/// Single-value tuple (aka womple). Used as a workaround to represent single value tuples in Typescript. | ||
/// </summary> | ||
/// <remarks> | ||
/// Many Google Cloud API endpoints return single element tuples (womples), for which no equivalent type exists in F#. | ||
/// This type can be used to represent such types. It's more palatable than the alternative, which is modelling such | ||
/// types as arrays (Typescript tuples are implemented as arrays in Javascript) | ||
/// and then indexing into them to get the value. | ||
/// | ||
/// See: https://github.com/fable-compiler/ts2fable/issues/296 | ||
/// </remarks> | ||
type Tuple1<'a> = 'a * unit | ||
|
||
module Tuple1 = | ||
/// Unbox the single element of a Tuple1. | ||
let unbox (t1 : Tuple1<'a>) : 'a = | ||
let (v, _) = t1 | ||
v | ||
|
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