[GHC] #15558: Locally handling an empty constraint

GHC ghc-devs at haskell.org
Thu Aug 23 00:13:08 UTC 2018


#15558: Locally handling an empty constraint
-------------------------------------+-------------------------------------
        Reporter:  Ericson2314       |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  ⊥
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ericson2314):

 That's better, but I'd still like to remove the type error and the
 `undefined`:

 Being able to write `\ @_ -> undefined` would be better, and if we had a
 `witnessEq :: a ~ b => a :~ b`, I could do `\ @b -> case witnessEq @[b] @a
 of {}` which would be better still.
 Best of all with "absurd constraint lambda-case" would be:

 {{{
 g' = \case
   X -> Bar 0 (\ @_b -> \@case {})
   Y -> Bar [] False
 }}}

 Which avoids `witnessEq`. Generalizing to all constraints, that's
 avoidingg some dictionary singleton thing to do the normal term level
 empty case by doing empty case on the constraint directly.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15558#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list