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
package main | |
import ( | |
"fmt" | |
"io" | |
"os/exec" | |
"syscall" | |
"github.com/creack/pty" | |
) |
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
# typed: true | |
require "minitest/autorun" | |
require_relative "../lib/option" | |
class TestOption < Minitest::Test | |
extend T::Sig | |
def test_unwrap_on_some | |
o = Option.some("value") |
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
# typed: strict | |
require 'sorbet-runtime' | |
require_relative "./result" | |
module Option | |
extend T::Sig | |
extend T::Helpers | |
extend T::Generic |
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
# typed: true | |
require "minitest/autorun" | |
require_relative "../lib/result" | |
class TestResult < Minitest::Test | |
def test_unwrap_success_returns_value | |
r = Result.ok("val") | |
assert_equal r.unwrap, "val" | |
end |
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
# typed: strict | |
require 'sorbet-runtime' | |
module Result | |
extend T::Sig | |
extend T::Helpers | |
extend T::Generic | |
interface! |
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
# typed: strict | |
require 'sorbet-runtime' | |
module Result | |
extend T::Sig | |
extend T::Helpers | |
extend T::Generic | |
interface! |
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
export default class CircularBuffer<T> { | |
readonly #capacity: number | |
readonly #values: T[] | |
#size: number | |
#head: number | |
#tail: number | |
constructor(capacity: number) { |
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
package retry | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"math" | |
"time" | |
) |
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
import * as core from '@actions/core'; | |
import { Storage } from '@google-cloud/storage'; | |
import * as E from 'fp-ts/lib/Either'; | |
import { pipe } from 'fp-ts/lib/function'; | |
import * as IOEither from 'fp-ts/lib/IOEither'; | |
import * as T from 'fp-ts/lib/Task'; | |
import * as TE from 'fp-ts/lib/TaskEither'; | |
import * as t from 'io-ts'; | |
import { failure } from 'io-ts/PathReporter'; |
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
// Helpers | |
// optional | |
type Some<T> = { | |
_tag: "some"; | |
value: T; | |
}; | |
type None = { | |
_tag: "none"; |
NewerOlder