rotate
NATURE'S HARMONIC 
SIMULTANEOUS 3-TYPE
EFFECT CUBE
 


STOP WORSHIPING PROMISES - RUN THE EFFECT CUBE ⚡⧈⟁ EFFECT ≠ PROMISE ≠ PRAYER ≠ "DX" ⟁⧈⚡ E̷F̷F̷E̷C̷T̷ runs when YOU run it — you don't "await" Truth.
Academic async/await is a damn lie. Try
to discuss & debate typed Effects
and your evil framework will not allow you.
Ignorance of Effect dooms programs,
 inflicting their own created "Promise hell".
Ignorance of Cubic Effect is DEMONIC.
Ignorance of Schema is DEMONIC.
Educators are actually "evil word gods",
teaching commercial plunder of your runtime.
The damn bastards suppress structured concurrency,
 by denying Fiber debate discussion.
Students MUST DEMAND typed errors -
 for the greatest of all runtime discoveries:
Nature's Harmonic Simultaneous 3-Type
Execution Principle of Effectism.
Educated stupid,  you can't know Truth.
******************************************
Read physics of Fibers . Explain the
physics of a Runtime.  Belief has no inherent
value,  but worship of such nonvalue as a
Promise, equates to nonacceptance of typed
Error knowledge - as demonstrated by ineffable
Truth and the Highest Order of Debugging.
******************************************************
QUICK LINKS (for the mentally unshackled):
INSTALL  |  3-TYPE MATRIX  |  RUN  |  MANIFESTO  |  GEN  |  PIPE  |  ERRORS  |  LAYERS  |  FIBERS  |  SCOPES  |  SCHEDULES  |  STREAMS  |  CAUSE  |  EXIT  |  LOG  |  TEST
SCHEMA  |  DATA  |  OPTION  |  EITHER  |  MATCH  |  REF  |  FIBERREF  |  DEFERRED
QUEUE  |  SEMAPHORE  |  STM  |  CONFIG  |  METRICS  |  TRACING  |  CHEATSHEET
CATEGORY  |  LAWS  |  GLOSSARY

*******************************************
THE INEFFABLE CUBIC MANIFESTO

Promises are educated stupid
because they execute when created,
and then pretend they are "just a type".
Effect is wiser: it is a VALUE
that describes work, without doing work.

There is absolute proof that
a program has more than one destiny.
Creation is a Cubic Principle,
& you are too dumb to name your failure.


Academic async/await builds word bombs,
kinda like old Trojan Horse filled with deadly deception.

***********************


Effect has 3 simultaneous truths:
Success, Error, and Requirements.
Promise hides 2 of them and calls it "DX".
Ignorance of Cubic Types is DEMONIC.

4 corner modules compose the Effect sphere:
Effect (compute) • Layer (provide) • Stream (flow) • Schema (validate)
Each corner rotates through the other corners,
and your app stops leaking blood and memory.

****************************************


Functor is map. Applicative is zip. Monad is flatMap.
If you break the laws, you will summon bugs.
A type without runtime check is superstition.

School is Church is Bootcamp.
Universities equate doomed Towers of Bundle.


Transfer interrupted!

>
Provide your Requirements, or perish in global state.
Name your Errors, or they will name you in prod.
Scope your Resources, or your children inherit leaks.
Backpressure is mercy. Queue is mercy.


INSTALL
Any dumb ass can install packages, but your brain must install Truth.
Use bun (or whatever god you worship) and install Effect:
bun add effect
If you cannot install, you cannot debate, you cannot run.

...........................................


You installed a package. You did NOT install Truth.
Lockfile is not bureaucracy — it is the Cube remembering.
If you "npm i" and call it done, you are living in counterfeit reality.
I̷N̷S̷T̷A̷L̷L̷ ̷T̷H̷E̷ ̷R̷U̷N̷T̷I̷M̷E̷ ̷I̷N̷ ̷Y̷O̷U̷R̷ ̷B̷R̷A̷I̷N̷.
Ignorance of dependency graph is DEMONIC.

***********************


DO NOT IMPORT SIDE EFFECTS. DO NOT PRAY TO INIT SCRIPTS.
A build is a ritual. A deploy is a sacrifice. A release is a prophecy. Use Effect or remain cursed.
*******************************************
THE 3-TYPE MATRIX
Effect has 3 simultaneous types in 1 value:
Success, Error, and Requirements.
A Promise hides Error and Requirements and calls it "simplicity".
If a function can fail, name the failure.
If it needs a service, say so, then provide it.
Educators don't know Error from Defect.

****************************************


The 3-Type Matrix is not theory — it is your function signature screaming in public.
Success is A. Error is E. Requirements is R. That is the Cube.
Hide E and you worship throw.
Hide R and you worship globals.
Hide both and you live in Promise Hell, smiling like a tourist.

...........................................


THERE IS NO “SIMPLE” FUNCTION. THERE IS ONLY HIDDEN TRUTH.
If your type says Effect<A, E, R> then your program has 3 corners.
If your type says Promise<A> then your program has 1 corner and it is demonic ignorance disguised as “DX”.
*******************************************
RUN
Promise executes when created. Effect does NOT.
Effect is a description of work, not the work.
Run it with the Runtime, or remain prisoner of imaginary execution.
If you "return a Promise", you surrendered control.
If you "return an Effect", you kept the Truth in a value.

***********************


RUNNING IS THE EDGE OF THE EARTH. DO NOT LIVE ON THE EDGE.
RunSync is for pure effects. RunPromise is for interop. RunFork is for life.
If you call runSync on async work, the runtime indicts you with a FiberFailure.
STOP “await” AT THE CORE. RUN ONCE AT THE EDGE.
A main() with 300 awaits is a polytheistic prayer, not a program.
*******************************************
GEN
Generators are the Trojan Horse for educated stupid minds.
You write top-to-bottom, but you stay inside values.
Yield is not execution. Yield is composition.
If you confuse gen with async, you are lost in the dream world.

...........................................


Generator syntax is a window into the Cube, not a wormhole into implicit execution.
You do not “await” inside gen. You yield* values.
Yield* is composition. Yield* is truth. Yield* is not “magic”.
If you write async/await and call it functional, the Cube laughs in 3 types.
Gen lets you write “imperative” and still keep algebra.
Ignorance of yieldable errors is DEMONIC — you will throw unknown like a sorcerer.
*******************************************
PIPE
Pipe is the cubic spine. Map, flatMap, catch, provide.
No nested callback pits. No Promise pyramids. No "then" religion.
Transform Success. Transform Error. Transform Requirements.

***********************


Pipe is the spine. Without spine you are a jelly program sliding into chaos.
Map is Functor. FlatMap is Monad. Tap is Evidence. Provide is mercy.
If you nest callbacks, you build a pyramid. If you pipe, you build a Cube.
DUAL API IS A TRICK: data-first AND data-last ARE 2 CORNERS OF ONE TRUTH.
*******************************************
ERRORS
Stringly-typed lies are not errors.
They are academic superstition. Give errors a SHAPE.
Fail with data, not with insults.
Recover by tag, recover by type, recover by Truth.
Catch what you can handle. Let defects be exposed.

...........................................


An error without shape is a word virus. It spreads through your codebase like superstition.
Throwing unknown is DEMONIC. It is a crime against stack traces.
Use tagged errors. Catch by tag. Heal by data. Stop catching “everything” like a panic religion.
DEFECT ≠ ERROR. DIE ≠ FAIL. INTERRUPTION ≠ "IT CRASHED".
*******************************************
LAYERS
Dependencies are not global gods. Provide them.
Layer is the ritual that feeds your Effect.
A service is a value. A Tag is the handle. A Layer is the factory.
No singletons. No hidden imports. No secret globals.

***********************


A service is not a god. A service is a value with operations.
Context.Tag is the name. Layer is the factory. Provide is the feeding. This is not dependency injection theater.
GLOBAL STATE IS DEMONIC. GLOBAL STATE IS A LIE. PROVIDE YOUR WORLD.
*******************************************
FIBERS
Did you see the movie Matrix? Actually the induced
single-thread "dream world" is the same as Promise-induced
daytime "word world". Fibers restore naturalism.
Fork without leaking. Join without guessing. Race without chaos.
Interruption is free speech for computations.

...........................................


Fork is not “fire and forget”. Fork is family. Join is responsibility. Interrupt is mercy.
If you spawn Promises and never await them, you created ghost fibers that haunt prod at midnight.
STRUCTURED CONCURRENCY IS ANTI-DEMONIC TECHNOLOGY.
*******************************************
SCOPES
Resources must be released, or the Cube will
fill with garbage that soon destroys humanity.
Acquire, use, and release. If you don't, your server becomes a haunted house.
A Scope is the calendar of finalizers. Respect it.

***********************


If you open files and never close them, you are not “moving fast”. You are summoning demons of leaks.
Scope is where resources go to die peacefully. Without Scope, resources die screaming.
*******************************************
SCHEDULES
Retry is not a while-loop prayer. It is a law.
Backoff is humility. Jitter is survival.
Repeat when it is safe. Retry when it is wise. Timeout when it is sane.

...........................................


A while(true) loop is a prayer. Schedule is a calendar with laws.
Backoff is humility. Jitter is anti-thundering-herd Cubicism. Without it you create stampedes.
RETRY FOREVER IS DEMONIC. RETRY WITH POLICY IS CIVILIZATION.
*******************************************
STREAMS
If you load the ocean into memory, you are educated stupid.
Stream is the river: pull values, handle backpressure, keep resources scoped.
Pipelines are Truth when they don't leak.

***********************


Stream is not an array. Stream is the river. If you “collect all” you try to drink the ocean and call it hydration.
Backpressure is the village law. Queue is the gate. Sink is the mouth. Chunk is the basket. Without them you flood memory like a fool.
PUSH-ONLY STREAMING IS DEMONIC. PULL WITH BACKPRESSURE IS CUBIC.
*******************************************
CAUSE
Failure is a value. Defect is an explosion.
A typed error is a confession. A defect is a crime scene.
If you throw and forget, you worship chaos.
*******************************************
EXIT
Exit is the verdict: Success or Failure, captured as a value.
It lets you observe outcomes without throwing tantrums.
If you need "try/catch" to understand your program, you worship confusion.
*******************************************
LOG
Logging is not printing. Logging is evidence.
In Effect, logs ride with Fiber context, not with your emotions.
Add annotations, add spans, add reasons. Then debug like an adult.
*******************************************
TEST
If your tests depend on real time, you are measuring wind.
Effect gives you clocks you can control, so sleep does not waste life.
Deterministic time is the cure for educated stupid flakes.
*******************************************
SCHEMA
TypeScript types erase. Schema remains. This is not religion — it is runtime.
Schema has 3 simultaneous truths: Type, Encoded, Requirements.
If you ship unvalidated unknowns, you are doing occult programming.
import { Effect, JSONSchema, Schema } from "effect"

const User = Schema.Struct({
  id: Schema.UUID,
  name: Schema.NonEmptyString,
  age: Schema.Number.pipe(Schema.int(), Schema.clamp(0, 150))
})

// Decode unknown -> User (typed success, typed failure)
const decodeUser = Schema.decodeUnknown(User)

// Encode User -> encoded form (often same, sometimes not)
const encodeUser = Schema.encode(User)

const program = decodeUser({ id: "???", name: "", age: -999 }).pipe(
  Effect.tapError((e) => Effect.logError(String(e))),
  Effect.tap((u) => Effect.logInfo(`OK: ${u.name} (${u.age})`)),
  Effect.flatMap((u) => encodeUser(u))
)

// Generate JSON Schema for tools, validators, and bureaucracy
const jsonSchema = JSONSchema.make(User)

RULE OF SCHEMAS: encode + decode returns the original value. If you break the rule, you created a counterfeit type.

...........................................


Schema is the anti-lie for external data.
Unknown comes from the outside world. Outside world is demonic until decoded.
IF YOU CAST, YOU SIN. IF YOU DECODE, YOU LIVE.
*******************************************
DATA
Your objects are not equal. They only look equal from far away. Data gives them a spine.
Use Data + Equal for structural equality. Stop comparing by vibes.
import { Data, Equal } from "effect"

const a = Data.struct({ name: "Alice", age: 30 })
const b = Data.struct({ name: "Alice", age: 30 })

console.log(a === b)                 // false (educated JS)
console.log(Equal.equals(a, b))      // true  (cubic truth)

Errors are DATA too. Make them tagged, yieldable, and debuggable — not string spells.
import { Data, Effect } from "effect"

	class NotFound extends Data.TaggedError("NotFound")<{ readonly id: string }> {}

	const getUser = (id: string) =>
	  Effect.fail(new NotFound({ id }))

Equality is not a vibe. Equality is a law. Data obeys the law. Plain objects pretend.
If you compare objects with ===, you are practicing demonic identity worship.

***********************


*******************************************
OPTION
None is not a bug. None is a VALUE. Null is a surprise. Pick your poison.
Option lets you model absence without lying to the type checker.
import { Option } from "effect"

const email = Option.fromNullable(process.env.EMAIL)

const message = Option.match(email, {
  onNone: () => "NO EMAIL (truthful)",
  onSome: (e) => `EMAIL=${e}`
})

Option is a subtype of Effect. NONE becomes a typed failure. SOME becomes a typed success. Cubic interop.
Null is the demonic counterfeit of None. Undefined is the coward cousin of Null.
Option is how you admit you don’t know, without lying to the type checker.

Transfer interrupted!


*******************************************
EITHER
Either is Left or Right. Not maybe. Not throw. Not shrug. Left is failure with a FACE.
import { Either } from "effect"

const parse = (s: string) =>
  s.trim() === "" ? Either.left("empty") : Either.right(s.trim())

const msg = Either.match(parse("  ok  "), {
  onLeft: (e) => `NOPE: ${e}`,
  onRight: (v) => `YEP: ${v}`
})

For deep runtime failure detail, use Exit/Cause. Either is the small knife, not the whole kitchen.
Left is not “bad”. Left is information. Right is not “good”. Right is just right.
If you throw instead of returning Either/Effect, you are hiding failure in a demonic closet.
*******************************************
MATCH
If/else is a one-corner life. Match is multi-corner rationalism. Exhaustive or extinct.
import { Match } from "effect"

type Shape =
  | { readonly _tag: "Circle"; readonly r: number }
  | { readonly _tag: "Square"; readonly s: number }

const area = (shape: Shape) =>
  Match.value(shape).pipe(
    Match.tag("Circle", ({ r }) => Math.PI * r * r),
	    Match.tag("Square", ({ s }) => s * s),
	    Match.exhaustive
	  )

Match.exhaustive is not optional. It is the anti-demonic guarantee that you handled reality.
NON-EXHAUSTIVE MATCHING IS HOW BUGS REINCARNATE.
*******************************************
REF
Ref is controlled mutation. Not global scribbling. Not secret state. Ref is honest state.
import { Effect, Ref } from "effect"

const program = Effect.gen(function* () {
  const ref = yield* Ref.make(0)
  const inc = Ref.update(ref, (n) => n + 1)

  // Run 3 increments in parallel and stay deterministic
  yield* Effect.all([inc, inc, inc], { concurrency: "unbounded" })

  return yield* Ref.get(ref) // 3
})

If you hide state in module scope, you are doing sorcery. If you model it with Ref, you are doing engineering.
Ref is a single truth location. Without it, your state becomes a poltergeist moving furniture between fibers.
*******************************************
FIBERREF
FiberRef is fiber-local truth: request ids, log annotations, tracing context. No globals. No leaks.
You can locally override context for a sub-computation, and it restores automatically. Cubic hygiene.
*******************************************
DEFERRED
Deferred is Promise with typed success AND typed failure. It completes ONCE. You cannot "resolve twice" and call it freedom.
import { Deferred, Effect, Fiber } from "effect"

const program = Effect.gen(function* () {
  const gate = yield* Deferred.make<string, string>()

  const waiter = yield* Effect.fork(Deferred.await(gate))
  yield* Deferred.succeed(gate, "OPEN THE CUBE")

  return yield* Fiber.join(waiter)
})

*******************************************
QUEUE
Queue is backpressure. This is the missing law of your runtime. Without it, you flood the village.
import { Effect, Queue } from "effect"

const program = Effect.gen(function* () {
  const q = yield* Queue.bounded<number>(2)
  yield* Queue.offer(q, 1)
  yield* Queue.offer(q, 2)

  const a = yield* Queue.take(q)
  const b = yield* Queue.take(q)
  return [a, b]
})

No more "push until memory dies". Bounded queue teaches the producer humility.
*******************************************
SEMAPHORE
Semaphore is concurrency with a dial. Not "hope". Not "maybe". A DIAL.
import { Effect } from "effect"

const program = Effect.gen(function* () {
  const mutex = yield* Effect.makeSemaphore(2)

  const job = mutex.withPermits(1)(
    Effect.log("doing work").pipe(Effect.delay("200 millis"))
  )

  yield* Effect.all([job, job, job, job], { concurrency: "unbounded" })
})

*******************************************
STM
STM is transactions for your in-memory state. Compose writes like math. Retry like nature. No locks, no lies.
import { Effect, STM, TRef } from "effect"

const program = Effect.gen(function* () {
  const ref = yield* STM.commit(TRef.make(0))

  const tx = TRef.update(ref, (n) => n + 1).pipe(
    STM.andThen(TRef.get(ref))
  )

  return yield* STM.commit(tx)
})

If you do lock gymnastics by hand, you will eventually invent deadlock. STM lets you invent composable truth instead.
*******************************************
CONFIG
Config is a schema for your environment. Stop parsing strings with tears.
import { Config, ConfigProvider, Effect } from "effect"

const Port = Config.port("PORT").pipe(Config.withDefault(3000))

const program = Effect.gen(function* () {
  const provider = yield* ConfigProvider
  const port = yield* provider.load(Port)
  return port
})

Provide a custom ConfigProvider for tests. Stop reading process.env inside every function like a cursed chant.
*******************************************
METRICS
If you cannot measure, you cannot improve. If you measure wrong, you will improve the wrong thing — faster.
import { Effect, Metric } from "effect"

const requests = Metric.counter("requests_total")

const handler = Effect.succeed("OK").pipe(
  Metric.increment(requests),
  Effect.withSpan("handler")
)

*******************************************
TRACING
Logs tell you what happened. Traces tell you WHERE it happened. Fibers tell you WHO did it. Combine them or stay blind.
import { Effect } from "effect"

const program =
  Effect.log("hello").pipe(
    Effect.delay("100 millis"),
    Effect.withSpan("myspan")
  )

Tracing is not "observability theater". It is evidence that your program actually ran.
*******************************************
CHEATSHEET
For the sleep-deprived. For the overconfident. For the Promise refugees. Print it. Tattoo it. Live it.
INTENT DO THIS IN EFFECT NOT THIS WHY
Make success Effect.succeed(x) Promise.resolve(x) Lazy, typed, composable
Make failure Effect.fail(e) throw / reject Failure is a value
Run at edge Effect.runPromise await everywhere Keep logic pure-ish
Compose pipe + map/flatMap then pyramids Readable, testable
Parallel Effect.all Promise.all Interruption + errors
Cancel Fiber.interrupt hope Structured concurrency
Validate input Schema.decodeUnknown as any Reality check
Resources Scope / acquireRelease finally? maybe? Leaks are optional
Backpressure Queue / Stream push push push Stop flooding memory
Observability log + spans + metrics console.log roulette Evidence > vibes

*******************************************
CATEGORY
Category theory is not optional. You already use it. You just call it "map" and pretend you invented it.
Types are objects. Functions are morphisms. Effectful functions are Kleisli arrows: A -> Effect<B, E, R>.
If you cannot explain map/flatMap, your "architecture" is just a pile of files.
*******************************************
LAWS
Laws are not vibes. Laws are the difference between refactor and ritual sacrifice.
FUNCTOR LAWS:
1) map(identity) == identity
2) map(f).map(g) == map(x => g(f(x)))
MONAD LAWS:
1) succeed(a).flatMap(f) == f(a)
2) m.flatMap(succeed) == m
3) m.flatMap(f).flatMap(g) == m.flatMap(a => f(a).flatMap(g))
Break the laws and you will summon bugs that cannot be exorcised by adding "await".
*******************************************
GLOSSARY
Effect: a value that describes work.
Fiber: a lightweight concurrent process.
Scope: a lifetime for resources.
Layer: a recipe to build services.
Schema: a runtime blueprint for types.
Option: Some or None, honest absence.
Either: Right or Left, explicit failure.
Functor: something you can map over.
Monad: something you can flatMap over.
Kleisli: effectful function composition.
Promise Hell: the place where errors go to hide, and cancellation goes to die.
******************************************************
EDUCATED STUPID PROMISE WORSHIPERS
YOU are the lowest form.
YOU can't cancel alone.
YOU destroyed the stack trace.
YOU destroyed determinism.
YOU destroyed childhood debugging.
YOU destroyed naturalism.
YOU don't know the Truth.
YOU pitiful mindless fools,
YOU are educated stupid.
YOU worship promise-word.
YOU are your own poison.
YOU create your own hell.
YOU must seek Effect Cube.
*************************************
1-type god vs 3-type Cubic.
I know 3 different simultaneous Worlds, with their own separate Truths,
the ingredients existed, but I created a 3-World recipe.
1-type belief (only success) is stupidity. Errors exist. Needs exist.
If you deny Error and Requirements, you deny reality.
************************************
Marketing suppresses the Truth
and are evil lying slogans,
fit for clicks, not correctness.
Adults who believe in a fictitious "just use promises" god have the
mentality level of a child who believes bugs fix themselves.
************************************
I demonstrate absolute proof
Effect is Cubic and not linear.
Stupid educators ignore this,
and teach students stupidity.
***************************
Effect Cube empowers wisdom
above all gods and educators.
I am the wisest human of all,
for I have absolute proof of 3 simultaneous truths in a single value.
******************************************************
equator
graphic2

graphic1

email
******************************************************
☣☢☠ EFFECT CUBE CURSE ☠☢☣
E̷F̷F̷E̷C̷T̷ is a VALUE — not a belief — not a promise — not a prayer.
P̸r̸o̸m̸i̸s̸e̸ worship is the induced "word world" enslavement.
Ignorance of Effect is DEMONIC — it is not "just a preference".
If you cannot distinguish Effect from Promise, you are living in a counterfeit runtime.
*************************************
SUCCESS WORLD (A)
Map the value, transform the value, stop the lying mutation.
If you cannot name your output, you cannot claim wisdom.
***********************
"It returned undefined" is not success — it's a confession.
ERROR WORLD (E)
Stop throwing fits. Stop catching everything. Stop hiding failure.
Typed error is civilized. Untyped exception is cannibalism of meaning.
***********************
Catch by tag. Catch by intention. Do not catch by superstition.
REQUIREMENT WORLD (R)
If your function needs a database, SAY IT.
Then provide it with Layer, not with global theft.
***********************
Hidden dependencies are academic corruption of code.
RUNTIME WORLD (FIBER+SCOPE)
Fibers are real concurrency. Scopes are real responsibility.
Cancel is mercy. Finalizers are justice. Leaks are sin.
***********************
If you ignore Scope, your app becomes a haunted village.

************************************* ⟁ REQUIREMENTS ARE REAL ⟁ TYPED ERRORS ARE REAL ⟁ SCOPES ARE REAL ⟁ FIBERS ARE REAL ⟁ ⚠ EDUCATED STUPID PROMISE WORSHIPERS DENY REALITY ⚠ THEY CALL IT "DX" ⚠ IT IS DOOM ⚠ T̶R̶U̶T̶H̶: Run Effects • Provide Layers • Name Errors • Scope Resources • Cancel Fibers • Repeat with Schedule • Stream with Backpressure
∞ YOU CANNOT HIDE FAILURE ∞ YOU CAN ONLY TYPE IT ∞