Rule 14s-exp-app
Expressions
(14)
TeX source
\defnrule[r:s-exp-app]
{\jdg{C}{\expm}{\tau' \rightarrow \tau} \premsep \jdg{C}{\atexp}{\tau'}}
{\jdg{C}{\expm\ \atexp}{\tau}}Tests (126)
- elm / CompilerIssue1491PhantomTupleUnsoundTestA phantom type parameter `( m, m )` is accepted where `( OnePlus m, m )` is required.
- elm / CompilerIssue1669InfiniteTypeArrayGetSetHangTestA function whose type would be infinite, built from `get` and `set` on a local array type in a pipeline, is rejected with a type error.
- elm / CompilerIssue1691ContradictoryExtensibleRecordHangTestA point-free definition whose extensible-record annotations contradict each other is rejected with a type error.
- elm / CompilerIssue1700InfiniteTypeFoldrLambdaHangTestA `foldr` lambda that conses a list onto an element (`uniq :: elem`) is rejected with an infinite-type error.
- elm / CompilerIssue1748DestructureMissingFieldCrashTestDestructuring a record field that does not exist, in an unannotated function, crashes the compiler.
- elm / CompilerIssue1866PhantomExtensibleRecordHangTestComposing two functions on phantom types over different extensible records, taken from one record argument, is rejected with a type error.
- elm / CompilerIssue1951OpenRecordLetCrashTestUnifying a closed and an open record type in let bindings crashes the compiler.
- elm / CompilerIssue1974RankCrashWrongAnnotationTestA wrong argument annotation on a recursive function called from another crashes the type checker.
- elm / CompilerIssue1975LetOrderCrashTestA type error in a let block crashes the compiler, depending on the names of its bindings.
- elm / CompilerIssue2006IndexOutOfBoundsMaybeWithDefaultTestApplying a `Subtype -> Subtype` function from `withDefault` to the whole model crashes the compiler.
- elm / CompilerIssue2027IncompatibleExtensibleRecordsHangTestUsing one value as two incompatible extensible records (`Tricky x x`) must be a type error.
- elm / CompilerIssue2036LensRecordUpdateHangTestA lens whose setter takes its arguments in the wrong order must be a type error.
- elm / CompilerIssue2105ExtensibleFoldlCrashTestFolding with a function that extends a record type parameter must produce a complete type error report, not crash the compiler.
- elm / CompilerIssue2106FoldlExtensibleRecordHangTestA `foldl` whose step function extends an extensible-record type parameter must be rejected with a type error, not hang the compiler.
- elm / CompilerIssue2148RecordUpdateFoldrCrashTestA type error in a `foldr` over records must be reported normally, not crash the compiler.
- elm / CompilerIssue2153RecursiveCallWrongArgCrashTestA recursive call with an argument of the wrong type must be reported as a TYPE MISMATCH, not crash the compiler.
- elm / CompilerIssue2184LetRecursionTooManyArgsCrashTestTwo let-bound recursive functions that call themselves with too many arguments must be reported as a type error, not crash the compiler.
- elm / CompilerIssue2214LensSetterArgumentOrderHangTestThe compiler rejects, with a type error, a lens record whose setter takes its arguments in the wrong order.
- elm / CompilerIssue2241FoldMapInfiniteTypeHangTestThe compiler rejects, with a type error, a call whose tuple-accumulating lambda does not fit the function it is passed to.
- elm / InfiniteTypeSelfAppliedArgumentOnBothSidesTestA function argument applied to itself is rejected with an INFINITE TYPE error.
- elm / InfixAssocRightConsAppendTest`::` and `++` (both precedence 5) associate to the right, so `"a" ++ "b" :: [ "c" ]` does not type.
- elm / StandardA99RecordPatternSharedVariableTestTwo variables of one record pattern that share one `number` type.
- elm / TooManyArgsTooManyArgumentsToAConstructorTestApplying a constructor to more arguments than it takes, `Just 1 2`, is rejected with a TOO MANY ARGS error.
- elm / TooManyArgsTooManyArgumentsToAFunctionTestApplying a function to more arguments than it takes, `not True False`, is rejected with a TOO MANY ARGS error.
- elm / TooManyArgsTooManyArgumentsToALambdaTestApplying a one-argument lambda to two arguments, `(\a -> a + 1) 1 2`, is rejected with a TOO MANY ARGS error.
- elm / TooManyArgsTooManyArgumentsToALiteralTestAn integer literal applied to an argument is rejected with a TOO MANY ARGS error.
- elm / TooManyArgsTooManyArgumentsToALocalTestA top-level `Int` value applied to an argument 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 / TooManyArgsTooManyArgumentsToAnOperatorTestAn operator function given three arguments is rejected with a TOO MANY ARGS error.
- elm / TypeMismatchAccessOnANumberTestField access on an `Int` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchAccessOnAnEmptyRecordTestReading a field from an empty record is rejected with a TYPE MISMATCH.
- elm / TypeMismatchAliasNamedLikeAnImportedTypeTestA local type alias that shadows an imported type name is a different type from it, so mixing the two is rejected with a TYPE MISMATCH.
- elm / TypeMismatchAppendableAgainstATupleTestA list whose tuple elements disagree in both components is rejected with a TYPE MISMATCH.
- elm / TypeMismatchArgumentToAConstructorTestA constructor applied to an argument of the wrong type is rejected with a TYPE MISMATCH.
- elm / TypeMismatchArgumentToAnOperatorFunctionTestA `String` passed to the operator function `(+)` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchBoolLeftOfAppendTestA `Bool` on the left of `++` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchBoolLeftOfMinusTestA `Bool` on the left of `-` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchBoolLeftOfPowerTestA `Bool` on the left of `^` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchBoolLeftOfTimesTestA `Bool` on the left of `*` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchBoolRightOfAppendWithAStringTestA `Bool` on the right of `++` after a `String` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchBoolRightOfPlusTest`1 + True` is rejected with a TYPE MISMATCH, because `+` takes two numbers and `True` is a `Bool`.
- elm / TypeMismatchBoolsComparedTest`True < False` is rejected with a TYPE MISMATCH, because `<` takes comparable values and `Bool` is not comparable.
- elm / TypeMismatchCaseAsAnArgumentTestA `case` expression passed as the argument to `not` is rejected with a TYPE MISMATCH, because its branch yields a number and `not` takes a `Bool`.
- elm / TypeMismatchClosedRecordWhereExtensibleTestPassing a record that lacks a field the result must have is rejected with a TYPE MISMATCH.
- elm / TypeMismatchCompappendAgainstATupleTestA list whose two tuple entries disagree, one holding a value used with both `++` and `<`, the other a tuple of numbers in that position, is rejected with a TYPE MISMATCH.
- elm / TypeMismatchCompappendListEntryWithABoolTestA list holding a value used with both `++` and `<` alongside `True` is rejected with a TYPE MISMATCH, because `Bool` can be neither appended nor compared.
- elm / TypeMismatchComparableAgainstATupleTestA list whose two tuple entries disagree, one holding a value used with `<`, the other a tuple of numbers in that position, is rejected with a TYPE MISMATCH.
- elm / TypeMismatchComposedWithANumberTest`not >> 1` is rejected with a TYPE MISMATCH, because `>>` composes two functions and `1` is a number.
- elm / TypeMismatchConsedOntoABoolTest`1 :: True` is rejected with a TYPE MISMATCH, because the right side of `::` must be a list and `True` is a `Bool`.
- elm / TypeMismatchConsedOntoAMaybeTest`1 :: Just 1` is rejected with a TYPE MISMATCH, because the right side of `::` must be a list and `Just 1` is a `Maybe`.
- elm / TypeMismatchDifferentlyNamedComparableVarsTestA list of two tuples whose first components are values of different custom types is rejected with a TYPE MISMATCH, where the second components are functions annotated with differently named `comparable` variables.
- elm / TypeMismatchDifferentlyNamedFlexVarsTestA list of two tuples whose first components are values of different custom types is rejected with a TYPE MISMATCH, where the second components are functions annotated with differently named type variables.
- elm / TypeMismatchExtensibleRecordMissingAFieldTestPassing `{ age = 1 }` to a function that takes `{ r | name : Int }` is rejected with a TYPE MISMATCH, because the record has no `name` field.
- elm / TypeMismatchFieldTypoTestThe compiler rejects access to a misspelled record field, `r.nmae` on a record whose only field is `name`, with a TYPE MISMATCH error.
- elm / TypeMismatchFlexibleRecordWhereClosedAfterAMismatchTestThe compiler rejects passing a tuple whose two components both disagree with the annotation, with a TYPE MISMATCH error.
- elm / TypeMismatchFlexibleRecordWithAnExtraFieldWhereClosedTestThe compiler rejects passing a record that must have an `age` field to a function that takes exactly `{ name : Int }`, with a TYPE MISMATCH error.
- elm / TypeMismatchFloatComparedForEqualityTestThe compiler rejects `1.5 == "a"`, an equality test between a `Float` and a `String`, with a TYPE MISMATCH error.
- elm / TypeMismatchFloatLeftOfAppendTestThe compiler rejects a `Float` on the left of `++`, which only accepts strings and lists, with a TYPE MISMATCH error.
- elm / TypeMismatchFloatLeftOfIntDivideTestThe compiler rejects the `Float` literal `1.5` on the left of the integer division operator `//`, with a TYPE MISMATCH error.
- elm / TypeMismatchFloatRightOfIntDivideTestThe compiler rejects the `Float` literal `1.5` on the right of the integer division operator `//`, with a TYPE MISMATCH error.
- elm / TypeMismatchFloatRightOfMinusWithIntTestThe compiler rejects `n - f`, subtracting a `Float` from an `Int`, with a TYPE MISMATCH error, because Elm has no implicit conversion between the two.
- elm / TypeMismatchFloatRightOfPlusWithIntTestThe compiler rejects `n + f`, adding a `Float` to an `Int`, with a TYPE MISMATCH error, because Elm has no implicit conversion between the two.
- elm / TypeMismatchFloatRightOfPowerWithIntTestThe compiler rejects `n ^ f`, raising an `Int` to a `Float` power, with a TYPE MISMATCH error, because `^` needs both sides to be the same number type.
- elm / TypeMismatchFloatRightOfTimesWithIntTestThe compiler rejects `n * f`, multiplying an `Int` by a `Float`, with a TYPE MISMATCH error, because Elm has no implicit conversion between the two.
- elm / TypeMismatchFunctionLeftOfGreaterThanTestThe compiler rejects `not > not`, comparing two functions with `>`, with a TYPE MISMATCH error, because functions are not `comparable`.
- elm / TypeMismatchImportedTypeNamedLikeAnAliasTestThe compiler rejects a list holding both `Basics.True` and a value of a local alias named `Bool`, which stands for `Int`, with a TYPE MISMATCH error.
- elm / TypeMismatchIntAgainstNumberAfterAMismatchTestThe compiler rejects a list of pairs whose second entry has a `String` first component where the first entry has a number, with a TYPE MISMATCH error.
- elm / TypeMismatchIntRightOfAppendTestThe compiler rejects `"a" ++ n`, appending an `Int` to a `String`, with a TYPE MISMATCH error.
- elm / TypeMismatchIntRightOfAppendWithAListTestAppending an `Int` to a list with `++` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchIntRightOfDivideTestDividing by an `Int` with `/` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchIntRightOfMinusWithFloatTestSubtracting an `Int` from a `Float` with `-` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchIntRightOfPlusWithFloatTestAdding an `Int` to a `Float` with `+` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchIntRightOfPowerWithFloatTestRaising a `Float` to an `Int` power with `^` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchIntRightOfTimesWithFloatTestMultiplying a `Float` by an `Int` with `*` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchLambdaArgumentPatternTestApplying a lambda with a tuple pattern to a number is rejected with a TYPE MISMATCH.
- elm / TypeMismatchLambdaCallAsAnArgumentTestPassing the result of a lambda call to `not` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchListConsedOntoAListOfStringsTestConsing a list onto a list of strings with `::` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchListMultipliedTestMultiplying a list with `*` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchListRightOfAppendWithAStringTestAppending a list to a `String` with `++` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchListRightOfPlusTestAdding a list to a number with `+` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchListRightOfTimesTestMultiplying a number by a list with `*` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchListsAddedTestAdding two lists with `+` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchMaybeConsedOntoAListOfStringsTestConsing a `Maybe` onto a list of strings with `::` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchMisspeltFieldAmongManyTestAccessing a misspelt field of a record with many fields is rejected with a TYPE MISMATCH.
- elm / TypeMismatchNegateTestNegating a `String` with the prefix minus (`-s`) is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchNumberAndAppendableListEntriesTestA list literal whose entries are `a + 1` and `b ++ b` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchNumberAndCompappendListEntriesTestA list literal whose entries are `a + 1` and a value `c` that is both appended (`b ++ b`) and compared (`c < c`) is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchNumberIntoNotWithPipeLeftTestApplying `not` to a number with `<|` (`not <| 1`) is rejected with a TYPE MISMATCH error, because `not` takes a `Bool`.
- elm / TypeMismatchNumberLeftOfComposeRightTestA number as the left operand of `>>` (`1 >> not`) is rejected with a TYPE MISMATCH error, because `>>` composes two functions.
- elm / TypeMismatchNumberLeftOfPipeLeftTestA number as the left operand of `<|` (`1 <| 2`) is rejected with a TYPE MISMATCH error, because `<|` applies its left operand as a function.
- elm / TypeMismatchNumberListEntryWithAnAliasTestA list literal holding a number and a value of the record alias `N` (`[ 1, n ]`) is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchNumberPipedIntoANumberTestPiping a number into another number (`1 |> 2`) is rejected with a TYPE MISMATCH error, because `|>` applies its right operand as a function.
- elm / TypeMismatchNumberPipedIntoNotTestPiping a number into `not` (`1 |> not`) is rejected with a TYPE MISMATCH error, because `not` takes a `Bool`.
- elm / TypeMismatchNumberPlusAppendableTestAppending to the result of an addition (`(a + 1) ++ b`) is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchRecordFieldExtraTestPassing the record `{ name = 1, age = 2 }` to a function annotated to take exactly `{ name : Int }` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchRecordFieldsMissingTestPassing the record `{ name = 1 }` to a function annotated to take `{ name : Int, age : Int, size : Int }` is rejected with a TYPE MISMATCH error, because the fields `age` and `size` are missing.
- elm / TypeMismatchRecordLeftOfAtMostTestComparing two records with `<=` is rejected with a TYPE MISMATCH error, because `<=` takes `comparable` operands and records are not comparable.
- elm / TypeMismatchRigidExtensionWhereFlexibleAfterAMismatchTestAn extensible record argument placed in a list beside an unannotated local value is rejected with a TYPE MISMATCH.
- elm / TypeMismatchSecondArgumentToAFunctionTestPassing a number as the second argument of a function that expects a `String` there is rejected with a TYPE MISMATCH.
- elm / TypeMismatchSelfAppliedArgumentAgainstANumberTestAn unannotated function argument that is applied to itself and also used as a numeric function is rejected with a TYPE MISMATCH.
- elm / TypeMismatchSelfAppliedArgumentAgainstARigidNumberTestA local function argument that is applied to itself and also listed beside a function involving an annotated `number` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchSelfAppliedArgumentAgainstARigidVarTestA local function argument that is applied to itself and also listed beside a function involving an annotated type variable is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringAppendedToListTestAppending a `String` to a list with `++` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringLeftOfConsTestConsing a `String` onto a list of numbers with `::` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringLeftOfDivideTestA `String` as the left operand of `/` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringLeftOfIntDivideTestA `String` as the left operand of `//` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringLeftOfLessThanTestComparing a `String` with a number using `<` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringLeftOfPlusTestA `String` as the left operand of `+` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfAtLeastTestComparing a number with a `String` using `>=` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfAtMostTestComparing a number with a `String` using `<=` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfGreaterThanTestComparing a number with a `String` using `>` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfMinusTestA `String` as the right operand of `-` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfNotEqualsTestComparing a number with a `String` using `/=` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfPlusTestA `String` as the right operand of `+` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfPowerTestA `String` as the right operand of `^` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchStringRightOfTimesTestA `String` as the right operand of `*` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchTupleAgainstAnAliasTestA list holding a value of an alias for `Int` and a tuple is rejected with a TYPE MISMATCH.
- elm / TypeMismatchTwentyEightTypeVariablesTestUsing a function of 28 unannotated arguments as a number is rejected with a TYPE MISMATCH.
- elm / TypeMismatchTwoComparableVarsTestA list mixing tuples whose first components have different custom types is rejected with a TYPE MISMATCH.
- elm / TypeMismatchTwoFlexibleRecordsTestA record argument whose `name` field is used both as a number and as a `String` is rejected with a TYPE MISMATCH.
- elm / TypeMismatchUnitLeftOfAtLeastTestComparing two unit values with `>=` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnitsOnBothSidesTestA list of pairs whose second components differ, `( (), 1 )` and `( (), "a" )`, is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnknownTypeAgainstANumberTestA function whose case branches return `( Just 1, h )` and `( True, x + 1 )` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnknownTypeAgainstARigidNumberTestA function annotated `number -> ( Bool, number )` whose case branches return `( Just 1, h )` and `( True, x )` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnknownTypeAgainstARigidVarTestA function annotated `a -> ( Bool, a )` whose case branches return `( Just 1, h )` and `( True, x )` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnknownTypesOnBothSidesTestA list of pairs `( h, 1 )` and `( h, "a" )`, built inside a case on `[ 1, "a" ]`, 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-exp-app] 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.