Open
Conversation
added 4 commits
April 19, 2025 19:16
…ched)
```purs
module Foo where
import Prelude
import Data.Tuple
import Effect.Uncurried as EFn
renderComponentSlot :: EFn.EffectFn1 String (Tuple Int (EFn.EffectFn2 Int Int Int))
renderComponentSlot = EFn.mkEffectFn1 \cs -> pure (Tuple 1 patch)
patch :: EFn.EffectFn2 Int Int Int
patch = EFn.mkEffectFn2 \st slot -> map fst $ EFn.runEffectFn1 renderComponentSlot ""
```
gives
```js
import * as Data_Functor from "../Data.Functor/index.js";
import * as Data_Tuple from "../Data.Tuple/index.js";
import * as Effect from "../Effect/index.js";
var $runtime_lazy = function (name, moduleName, init) {
var state = 0;
var val;
return function (lineNumber) {
if (state === 2) return val;
if (state === 1) throw new ReferenceError(name + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
state = 1;
val = init();
state = 2;
return val;
};
};
var map = /* #__PURE__ */ Data_Functor.map(Effect.functorEffect);
var $lazy_patch = /* #__PURE__ */ $runtime_lazy("patch", "Foo", function () {
return function (st, slot) {
return map(Data_Tuple.fst)(function () {
return $lazy_renderComponentSlot(18)("");
})();
};
});
var $lazy_renderComponentSlot = /* #__PURE__ */ $runtime_lazy("renderComponentSlot", "Foo", function () {
return function (cs) {
var step = $lazy_patch(14);
return new Data_Tuple.Tuple(1, step);
};
});
var patch = /* #__PURE__ */ $lazy_patch(17);
var renderComponentSlot = /* #__PURE__ */ $lazy_renderComponentSlot(9);
export {
renderComponentSlot,
patch
};
```
but
```purs
module Foo where
import Prelude
import Data.Tuple
import Effect.Uncurried as EFn
renderComponentSlot :: EFn.EffectFn1 String (Tuple Int (EFn.EffectFn2 Int Int Int))
renderComponentSlot = EFn.mkEffectFn1 \cs -> pure (Tuple 1 patch)
x = EFn.runEffectFn1 renderComponentSlot ""
patch :: EFn.EffectFn2 Int Int Int
patch = EFn.mkEffectFn2 \st slot -> map fst $ x
```
throws
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(my prev account was blocked)