Skip to content

Add instance Consumable/Dupable/Movable for ByteString, ShortByteString and Text#501

Merged
aspiwack merged 1 commit intotweag:masterfrom
Bodigrim:movable-for-text-and-bytestring
Feb 25, 2026
Merged

Add instance Consumable/Dupable/Movable for ByteString, ShortByteString and Text#501
aspiwack merged 1 commit intotweag:masterfrom
Bodigrim:movable-for-text-and-bytestring

Conversation

@Bodigrim
Copy link
Copy Markdown
Contributor

Closes #412.

ByteString, ShortByteString and Text are simple immutable data, so they are trivially Movable. linear-base already depends on text and (transitively) on bytestring, so this does not incur new dependencies.

@aspiwack
Copy link
Copy Markdown
Member

Immutable isn't sufficient. But because they have a single closure at the root, I agree, all these things are Movable by virtue of just forcing this one thunk (Text is quite subtle but appears to work).

…ng and Text

As discussed in tweag#412,
`linear-base` already depends on `text` and (transitively) on `bytestring`.
The types in question are simple immutable data with WHNF = NF,
so they are trivially `Movable`.
@Bodigrim Bodigrim force-pushed the movable-for-text-and-bytestring branch from c4037a5 to 5a59388 Compare February 24, 2026 21:37
@Bodigrim
Copy link
Copy Markdown
Contributor Author

@aspiwack pushed a fix for Ormolu, it should be good now.

@aspiwack
Copy link
Copy Markdown
Member

I'll cut a release with this (I think it's going to be purely a type-class-instance related release), probably tomorrow.

@aspiwack aspiwack merged commit 43a8469 into tweag:master Feb 25, 2026
7 checks passed
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.

Add instance Consumable/Dupable/Movable for ByteString and Text

2 participants