witchcraft icon indicating copy to clipboard operation
witchcraft copied to clipboard

Make Witchcraft.Chain.do_notation respect chainer

Open florius0 opened this issue 3 years ago • 3 comments

Summary

This PR fixes Witchcraft.Chain.do_notation/2. Previously it ignored second argument assuming any chainer is Witchcraft.Chain.chain/2.

However, there is a call of do_notation/2 across Witchcraft codebase in which chainer other then chain/2 is passed:

https://github.com/witchcrafters/witchcraft/blob/6c61c3ecd5b431c52e8b60aafb05596d9182205e/lib/witchcraft/monad.ex#L284-L287

Test plan (required)

mix test should be enough

Closing issues

Fixes #108

After Merge

  • [ ] Does this change invalidate any docs or tutorials? If so ensure the changes needed are either made or recorded
  • [x] Does this change require a release to be made? Is so please create and deploy the release

florius0 avatar Apr 16 '22 16:04 florius0

Moreover, the fact mention above can be proved as follows.

Running this snippet before would've returned [links: []], which points that no process were spawn_link'ed to shell process (if the snippet is run from shell).

async [] do
  let a = 1
  let b = 2
  
  return a + b
  
  return Process.info(self, :links)
end

Now, it shows that the process is indeed linked: [links: [#PID<0.238.0>]]

florius0 avatar Apr 17 '22 17:04 florius0

@QuinnWilton could you take a look?

florius0 avatar Apr 18 '22 17:04 florius0

Wow, thanks for the PR, @florius0 I'll review it shortly and incorporate into doma-engineering fork and provide feedback here + at fission discord. 💙 💛

cognivore avatar Mar 03 '23 20:03 cognivore