Skip to content

Deprecate cycle, repeat, and iterate#458

Merged
aspiwack merged 1 commit intotweag:masterfrom
treeowl:deprecate-cycle
Jun 26, 2023
Merged

Deprecate cycle, repeat, and iterate#458
aspiwack merged 1 commit intotweag:masterfrom
treeowl:deprecate-cycle

Conversation

@treeowl
Copy link
Copy Markdown
Collaborator

@treeowl treeowl commented Jun 12, 2023

Deprecate Data.List.Linear.{cycle,repeat,iterate}. Infinite results cannot be consumed linearly, so they are not really useful in a linear context. They could be consumed by a program that exits via an exception, but I don't think that's something that should really be supported.

Begins to address #453

Deprecate `Data.List.Linear.{cycle,repeat,iterate}`. Infinite results
cannot be consumed linearly, so they are not really useful in a linear
context. They could be consumed by a program that exits via an
exception, but I don't think that's something that should really be
supported.

Begins to address tweag#453
@treeowl treeowl changed the title Deprecate cycle and repeat Deprecate cycle, repeat, and iterate Jun 12, 2023
@treeowl treeowl requested a review from aspiwack June 19, 2023 19:16
@treeowl
Copy link
Copy Markdown
Collaborator Author

treeowl commented Jun 19, 2023

Alternative: just re-export the versions from base, since these versions have no advantage in linear programming.

@treeowl
Copy link
Copy Markdown
Collaborator Author

treeowl commented Jun 19, 2023

Another function that looks like it has a similar issue: Streaming.Linear.delays.

Copy link
Copy Markdown
Member

@aspiwack aspiwack left a comment

Choose a reason for hiding this comment

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

Sorry about the delay. Yes, let's deprecate, it's most certainly the right call.

Not so clear about Stream.delays though. It could conceivably be used in an infinite process (which can be cancelled with regular thread cancelling).

@aspiwack aspiwack merged commit 2c6b70e into tweag:master Jun 26, 2023
@treeowl
Copy link
Copy Markdown
Collaborator Author

treeowl commented Jun 26, 2023

What do you mean by "regular thread cancelling"? That tends to mean death by exception, no?

@aspiwack
Copy link
Copy Markdown
Member

Indeed, this is what I have in mind.

@treeowl
Copy link
Copy Markdown
Collaborator Author

treeowl commented Jun 26, 2023

But that goes for the others too, or anything else infinite, right?

@aspiwack
Copy link
Copy Markdown
Member

Yes, you're right (also, I'm infinitely slow at responding on this thread).

Somewhat I was thinking “streams have effects”, which is true, but you can also want to do mapM_ on an infinite list.

These things make sense, but probably shouldn't be front and center. We could have them in a separate module. So that you will have to realise, when importing these definitions, that they're not as innocent as their equivalent in non-linear Haskell. What do you think?

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