Skip to content
GitLab
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 5,264
    • Issues 5,264
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16339
Closed
Open
Issue created Feb 19, 2019 by Ryan Scott@RyanGlScottMaintainer

Cannot put (.) or (!) type operators into an export list

Thanks to recent work in GHC HEAD, it is now possible to define type operators named (.) and (!):

type (f . g) x = f (g x)
type x ! f = f x

However, I was surprised to discover that it's not possible to put them in an export list! That is to say, this program doesn't parse:

{-# LANGUAGE TypeOperators #-}
module Bug (type (.), type (!)) where

type (f . g) x = f (g x)
type x ! f = f x
$ ~/Software/ghc4/inplace/bin/ghc-stage2 --interactive Bug.hs
GHCi, version 8.7.20190219: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/rgscott/.ghci

Bug.hs:2:19: error: parse error on input ‘.’
  |
2 | module Bug (type (.), type (!)) where
  |                   ^

This problem appears to be specific to the (.) and (!) type operators, since any other type operator will work in its place:

{-# LANGUAGE TypeOperators #-}
module Works (type (&)) where

type (f & g) x = f (g x)
Trac metadata
Trac field Value
Version 8.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC int-index
Operating system
Architecture
Edited Mar 10, 2019 by Ryan Scott
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking