Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
E
examples
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Iris
  • examples
  • Merge Requests
  • !20

Closed
Opened Jun 12, 2019 by Simon Spies@simonspies
  • Report abuse
Report abuse

Branded Types

  • Overview 27
  • Commits 4
  • Pipelines 4
  • Changes 3

These two examples use the logical relation of Heaplang to define arrays and vectors. Arrays are fixed-size and provide safe and unsafe functions to access their elements. Vectors can grow in size and use the unsafe array methods to access their elements. Safety is ensured by branding vectors, meaning each vector is tagged with a fresh type variable. Statically, this has a similar effect as existential types. Semantically, the type variable is used to encode an ADT, i.e. impose invariants on the vector.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: iris/examples!20
Source branch: master