Changes between Initial Version and Version 14 of Ticket #8779


Ignore:
Timestamp:
Dec 16, 2015 9:58:31 PM (4 years ago)
Author:
bgamari
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8779

    • Property Cc roma@… yom@… merijn@… dfranke hello@… mpickering gkaracha added
    • Property Keywords PatternSynonyms added
    • Property Version changed from 7.6.3 to 7.8.1
  • Ticket #8779 – Description

    initial v14  
    22
    33Another missing piece is exhaustiveness checks. Given this pattern
    4 {{{
     4{{{#!hs
    55initLast [] = Nothing
    66initLast xs = Just (init xs, last xs)
     
    88}}}
    99we want the compiler to tell the programmer that
    10 {{{
     10{{{#!hs
    1111f [] = ...
    1212f (xs ::: x) = ...
    1313}}}
    1414is complete, while
    15 {{{
     15{{{#!hs
    1616g (xs ::: x) = ...
    1717}}}
     
    2424We add a new pragma `COMPLETE_PATTERNS` (any ideas for a shorter name). The syntax is essentially the same as for `MINIMAL`, i.e. a boolean formula, with constructors and pattern synonyms as atoms. In this case.
    2525
    26 {{{
     26{{{#!hs
    2727{-# COMPLETE_PATTERNS [] && (:::) #-}
    2828}}}