···32323333func Ctx[V any]() Fx[V, V] { return Func(identity[V]) }
34343535-// An stopped effect that panics if resumed
3535+// An stopped effect that panics if resumed.
3636+// Only useful with Replace.
3737+//
3838+// For example, an Abort effect halts since it has no possible value for V
3939+// but then its Handler can Replace the halted effect with an Error value.
4040+// See: abort/result.go
3641func Halt[S, V any]() Fx[S, V] {
3742 return Stop(func() Fx[S, V] {
3843 return Fx[S, V]{
···5358 if e.res != nil {
5459 return e.res()
5560 }
5656- return e
6161+ if e.imm != nil {
6262+ return Const[S](e.imm())
6363+ }
6464+ return Pending(func(s S) Fx[S, V] { return Resume(e.sus(s)) })
5765}
58665967// Replace with y if x is already Halted. Otherwise x continues.
···232240func Eval[V any](e Fx[Nil, V]) V {
233241 for {
234242 if e.res != nil {
235235- panic("tried to evaluate halted effect. try using fx.Replace with another effect.")
243243+ panic("tried to evaluate an stopped effect. try using fx.Resume or fx.Replace on it.")
236244 }
237245 if e.imm != nil {
238246 return e.imm()