If one tries to use tuple aliases as constructor functions the error message is not helpful.
module Main exposing (..)
type alias PersonRecord =
{ name : String
, age : Int
}
recordTest = PersonRecord "John" 32
type alias PersonTuple = ( String, Int )
tupleTest = PersonTuple "John" 32
The error message is Cannot find variable PersonTuple
The thinking then might go: "I just defined PersonTuple two lines above. How can it not be found?"
And one might try all kind of strange things to define it differently, importing it and so on.
It's even more general than that.
type alias Momento = Int or even type Momento = Int
declared just before saying
box = Momento 345
Give Cannot find variable Momento and nothing else.
If one tries to use tuple aliases as constructor functions the error message is not helpful.
The error message is
Cannot find variable PersonTuple
The thinking then might go: "I just defined PersonTuple two lines above. How can it not be found?" And one might try all kind of strange things to define it differently, importing it and so on.
A live version of this code can be found here: https://ellie-app.com/4dYpWwpgyLTa1/0