You return a (representation of a) side effect rather than execute a side effect.
Example
import{log}from'fp-ts/lib/Console'import{IO,io}from'fp-ts/lib/IO'import{chain,fold,none,Option,some}from'fp-ts/lib/Option'import{pipe}from'fp-ts/lib/pipeable'functiongetCharactersA(s:string):Option<string>{returns.length>3?some(s.substring(3)):none}functionprogram(input:string):IO<void>{returnpipe(some(input),chain(getCharactersA),// return my side effect only if there is a valuefold(()=>io.of(undefined),log))}program('foo')()// no outputprogram('barbaz')()// outputs "baz" to the console
You return a (representation of a) side effect rather than execute a side effect.
Example
Or fold(io.of(constVoid))