Skip to content

✨ Add unpacking and piping for optional and_then#266

Merged
elbeno merged 1 commit intointel:mainfrom
elbeno:optional-transform-unwrap
Aug 15, 2025
Merged

✨ Add unpacking and piping for optional and_then#266
elbeno merged 1 commit intointel:mainfrom
elbeno:optional-transform-unwrap

Conversation

@elbeno
Copy link
Contributor

@elbeno elbeno commented Aug 15, 2025

Problem:

  • It's awkward to continually unpack tuples when calling optional ... transform ... and_then chains.
  • It's wordy to express and_then chains, when the pipe operator is a conventional way to express monadic bind.

Solution:

  • Add automatic tuple unpacking.
  • Add pipe syntax for and_then chains.

@elbeno elbeno force-pushed the optional-transform-unwrap branch from d1ae674 to e6140eb Compare August 15, 2025 16:54
Problem:
- It's awkward to continually unpack tuples when calling `optional` ...
  `transform` ... `and_then` chains.
- It's wordy to express `and_then` chains, when the pipe operator is a
  conventional way to express monadic bind.

Solution:
- Add automatic tuple unpacking.
- Add pipe syntax for `and_then` chains.
@elbeno elbeno force-pushed the optional-transform-unwrap branch from e6140eb to 1719938 Compare August 15, 2025 17:14
Copy link
Contributor

@mjcaisse-intel mjcaisse-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@elbeno elbeno merged commit c0b4c44 into intel:main Aug 15, 2025
42 checks passed
@elbeno elbeno deleted the optional-transform-unwrap branch October 16, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants