[GHC] #14446: Extending TypeApplications to support infix functions

#14446: Extending TypeApplications to support infix functions -------------------------------------+------------------------------------- Reporter: dredozubov | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- For a motivational example I propose a piece of code using a library [https://github.com/typeable/schematic], which defines a fancy record-like object and requires some type annotations: {{{ jsonExample = withRepr @SchemaExample $ field @"foo" [12] :& field @"bar" (Just "bar") :& RNil }}} By using the same function as an infix operator, it may be possible to rewrite it to something along the lines of {{{ (.=) = field jsonExample = withRepr @SchemaExample $ @"foo" .= [12] :& @"bar" .= (Just "bar") :& RNil }}} To do that, we'll need to associate a type application with the function to the right of it. I imagine it'll introduce ambiguity to the parser, but it can be dealt with by allowing a different syntactical construct for a right type application. Haven't checked with a grammar, but it can be something like this: {{{ jsonExample = withRepr @SchemaExample $ "foo"@ .= [12] :& "bar"@ .= (Just "bar") :& RNil }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14446 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14446: Extending TypeApplications to support infix functions -------------------------------------+------------------------------------- Reporter: dredozubov | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dredozubov): * status: new => closed * resolution: => duplicate Comment: Seems like I made a duplicate of #12363, I'm linking this ticket there and closing this one -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14446#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC