Skip to content

Instantly share code, notes, and snippets.

@asahasrabuddhe
Last active April 16, 2025 17:10
Show Gist options
  • Save asahasrabuddhe/15bd5225e4ad5a98034ac4fecd3c7d84 to your computer and use it in GitHub Desktop.
Save asahasrabuddhe/15bd5225e4ad5a98034ac4fecd3c7d84 to your computer and use it in GitHub Desktop.
Problem Phantom Type Solution
Writing to a read-only file Only allow `Write(f File[Writable])`
Sending unverified request Only allow `Send(r Request[Validated])`
Applying wrong permissions Distinct phantom markers for each permission
Unsafe API transitions Type-safe state machines (e.g. login flow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment