Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,868
    • Issues 4,868
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19639
Closed
Open
Created Apr 02, 2021 by Krzysztof Gogolewski@monoidalDeveloper

Should we support prefix lollipop?

The linear types proposal does not define the linear arrow %1-> or ⊸ in the prefix form.

Should we support it as (⊸)? Users tend to expect it, by symmetry with (->). For example, instance Monad ((⊸) r).

There are three options:

  1. Do nothing, expect users to use FUN 'One.
  2. Add a type synonym type (⊸) = FUN 'One. Drawback: it would have to be imported (you could use the infix form with only -XLinearTypes without importing any module but not the prefix form).
  3. Add a special, built-in, lollipop arrow (⊸) parallel to (->). Problems:
  • It would be the first time a name is available only with -XUnicodeSyntax. (E.g. :i (⊸) would have no equivalent without -XUnicodeSyntax)
  • The special handling for (->) would have to be repeated.
    • :i Functor would probably have to show instance for either FUN 'One a or (⊸) a, depending on -fprint-unicode-syntax.
    • There is special code to give (->) negative fixity.
    • There is special code to display instances in :i (->).
    • There is special code to support instance Monad ((->) r) without -XTypeSynonymInstances and -XFlexibleInstances
    • Quoting in TH which currently gives ArrowT (this may not need to be replicated for the linear arrow, though)

None of those issues is insurmountable but there's extra complexity.

  1. We could do (3.) + add a non-unicode arrow (%1->) or something. This is really awkward, because this is not a valid identifier. The * kind was a bit like this: a special entry in the parser that needed a lot of special handling, and we spent a lot of time getting rid of it.

My preferences are 1 > 2 > 3 > 4. I think deciding this is minor enough not to deserve a full-blown proposal.

Edited Apr 02, 2021 by Krzysztof Gogolewski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking