Rule 3s-atexp-longcon
Atomic Expressions
(3)
Referred to from
- The comment on rule
s-atexp-longvar(Chapter 4)
TeX source
\defnrule[r:s-atexp-longcon]
{C(\longcon) = (\sigma, \is) \premsep \sigma \succ \tau}
{\jdg{C}{\longcon}{\tau}}Tests (11)
- elm / HigherOrderFilterLikeFunctionTestA let-bound function that takes a predicate and a list, and keeps the list's head when the predicate holds, gives `[1]` for a predicate that always returns `True`.
- elm / ImportClosedTypeConstructorTestA custom type exposed without `(..)` exposes no constructor, even one spelt as the type.
- elm / LssGapCtorAsValueA custom type constructor passed as a function argument builds the value it is applied to.
- elm / LssGapCtorInListA custom type constructor stored in a list can be taken out and applied.
- elm / TooManyArgsTooManyArgumentsToAConstructorTestApplying a constructor to more arguments than it takes, `Just 1 2`, is rejected with a TOO MANY ARGS error.
- elm / TooManyArgsTooManyArgumentsToANullaryConstructorTestA constructor with no arguments applied to one is rejected with a TOO MANY ARGS error.
- elm / TypeMismatchArgumentToAConstructorTestA constructor applied to an argument of the wrong type is rejected with a TYPE MISMATCH.
- elm / TypeMismatchMaybeOfANumberAgainstARigidVarTestReturning `Just 1` from a function annotated `a -> a` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchRigidNumberAsMaybeTestReturning a `Maybe` where the annotation promises a `number` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchRigidVarAsMaybeTestA function annotated `a -> a` that returns a `Maybe` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchTypeUnderAnExposingListTestA value annotated `Int` but defined as `Just 1` is rejected with a TYPE MISMATCH error.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:s-atexp-longcon] 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.