MCPcopy Create free account
hub / github.com/Effect-TS/effect / makePrimitive

Function makePrimitive

packages/effect/src/unstable/cli/Primitive.ts:110–117  ·  view source on GitHub ↗
(
  tag: string,
  parse: (value: string) => Effect.Effect<A, string, Environment>
)

Source from the content-addressed store, hash-verified

108export const isBoolean = (p: Primitive<unknown>): p is Primitive<boolean> => p._tag === "Boolean"
109
110const makePrimitive = <A>(
111 tag: string,
112 parse: (value: string) => Effect.Effect<A, string, Environment>
113): Primitive<A> =>
114 Object.assign(Object.create(Proto), {
115 _tag: tag,
116 parse
117 })
118
119const makeSchemaPrimitive = <T>(
120 tag: string,

Callers 6

makeSchemaPrimitiveFunction · 0.70
Primitive.tsFile · 0.70
choiceFunction · 0.70
pathFunction · 0.70
fileParseFunction · 0.70
fileSchemaFunction · 0.70

Calls 1

assignMethod · 0.80

Tested by

no test coverage detected