#3919: Or-patterns as GHC extension
---------------------------------+------------------------------------------
    Reporter:  BjornEdstrom      |       Owner:              
        Type:  feature request   |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:                    |    Keywords:              
          Os:  Unknown/Multiple  |    Testcase:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 Or-patterns is a way of grouping together patterns that match to the same
 value. A construct like

 {{{
  fun 0 _ = E
  fun _ 0 = E
 }}}

 Could more concisely be written as, for example

 {{{
  fun 0 _
   || _ 0 = E
 }}}

 As a concrete example why this is beautiful and how it could look, see
 ''Red-black trees in a functional setting, C. Okasaki'' [1].

 I don't know enough about GHC internals to know the obvious way to
 implement this, but I would gladly give it a try given pointers in the
 right direction.

 [1] http://www.eecs.usma.edu/webs/people/okasaki/jfp99.ps

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3919>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to