export const RIGHT = '@typed/Right' as const
export type RIGHT = typeof RIGHT
/**
* A JSON-serializable Right data-structure.
* @name Right
* @type
*/
export interface Right {
readonly [RIGHT]: A
}
export namespace Right {
/**
* Creates a Right
* @name Right.of(value: A): Right
* @param {A}
* @return {Right}
*/
export function of(value: A): Right {
return { [RIGHT]: value }
}
}
/**
* Extracts the value contained in a Right.
* @name fromRight(right: Right): A
* @param right
*/
export function fromRight(right: Right): A {
return right[RIGHT]
}