Rule 35s-atpat-con
Atomic Patterns
(35)
Comments
Only status is accepted, so the constructor of a record type alias, of status , cannot occur in a pattern. The instance must be a constructed type, so this rule accepts only a constructor without arguments; a constructor with arguments is covered by rule (43).
TeX source
\defnrule[r:s-atpat-con]
{C(\longcon) = (\sigma, \isc) \premsep \sigma \succ \tau^{(k)}t}
{\jdg{C}{\longcon}{(\emptymap, \tau^{(k)}t)}}Tests (6)
- elm / CompilerIssue1916PhantomExtensibleAliasCrashTestA phantom type over an extensible record in a function alias crashes the compiler.
- elm / MinimalConstructorPatternTestA constructor pattern without arguments matches its constructor.
- elm / TypeMismatchBoolPatternTestA `True` pattern in a `case` on a number is rejected with a TYPE MISMATCH.
- elm / TypeMismatchIfConditionIntTestThe compiler rejects an `if` whose condition is the number `1` rather than a `Bool`, with a TYPE MISMATCH error.
- elm / TypeMismatchNumberLeftOfAndTestA number as the left operand of `&&` (`1 && True`) is rejected with a TYPE MISMATCH error, because `&&` takes two `Bool`s.
- elm / TypeMismatchNumberLeftOfOrTestA number as the left operand of `||` (`1 || True`) is rejected with a TYPE MISMATCH error, because `||` takes two `Bool`s.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:s-atpat-con] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.