[GHC] #14590: Sectioned hole oddities

#14590: Sectioned hole oddities -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #13050 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- #13050 added support for infix holes. However, it seems that the same support was not added for //sectioned// holes, as the following two examples demonstrate: Left-sectioned holes technically work, although they are pretty-printed poorly: {{{#!hs f :: Int -> Int -> Int f x y = (x `_`) y }}} {{{ GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) Bug.hs:2:12: error: • Found hole: _ :: Int -> Int -> Int • In the expression: _ In the expression: \ x_ -> _ x x_ ) In the expression: ( \ x_ -> _ x x_ )) y • Relevant bindings include y :: Int (bound at Bug.hs:2:5) x :: Int (bound at Bug.hs:2:3) f :: Int -> Int -> Int (bound at Bug.hs:2:1) | 2 | f x y = (x `_`) y | ^^^ }}} Notice the messy `In the expression: \ x_ -> _ x x_ )` part. Right-sectioned holes don't even parse at all: {{{#!hs f :: Int -> Int -> Int f x y = (`_` x) y }}} {{{ GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) Bug.hs:2:11: error: parse error on input ‘_’ | 2 | f x y = (`_` x) y | ^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14590 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14590: Sectioned hole oddities -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13050 | Differential Rev(s): Phab:D4273 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4273 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14590#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14590: Sectioned hole oddities
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #13050 | Differential Rev(s): Phab:D4273
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#14590: Sectioned hole oddities -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T14590 Blocked By: | Blocking: Related Tickets: #13050 | Differential Rev(s): Phab:D4273 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => typecheck/should_compile/T14590 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14590#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC