Skip to content

Instantly share code, notes, and snippets.

View smhmayboudi's full-sized avatar

Hossein Mayboudi smhmayboudi

View GitHub Profile
import {Schema, Serializable} from '@effect/schema';
import {Brand, Console, Effect, HashMap, Ref, pipe} from 'effect';
export type Int = number & Brand.Brand<'Int'>;
export const Int = Brand.refined<Int>(
n => Number.isInteger(n),
n => Brand.error(`expected ${n} to be an integer.`)
);
export type Positive = number & Brand.Brand<'Positive'>;
import {Schema, Serializable} from '@effect/schema';
import {Brand, Console, Effect, HashMap, pipe, Ref} from 'effect';
export type Int = number & Brand.Brand<'Int'>;
export const Int = Brand.refined<Int>(
n => Number.isInteger(n),
n => Brand.error(`expected ${n} to be an integer.`)
);
export type Positive = number & Brand.Brand<'Positive'>;