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
  • #18830
Closed
Open
Created Oct 12, 2020 by Georgi Lyubenov@googleson78

Can't use NamedFieldPuns and ScopedTypeVariables together

Motivation

I believe there is a "hole" in interactions between NamedFieldPuns and ScopedTypeVariables.

{-# LANGUAGE NamedFieldPuns, ScopedTypeVariables #-}

data X a = X {field :: Y a}

data Y a

f :: X a -> ...
f X {field :: Y a} = ...

This is currently not a valid way (doesn't parse) to bind type variables.

Proposal

I propose that

f X {field :: Y a} = ...

desugar(?) to

f X {field = field :: Y a} = ...
Edited Oct 12, 2020 by Georgi Lyubenov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking