Suppose I have two types of aliases:
type alias A = {...}
type alias B = {...}
and type of association
type Content = A | B
and model type
type alias Model= {cont : Content, ...}
init : Content -> Model
init cont = {cont = cont, ...}
How to pass type A record to init.
a : A
a = {...}
init a
produces the following error:
Detected errors in 1 module.
The 1st argument to function `init` has an unexpected type.
78| init e
^
As I infer the type of values flowing through your program, I see a conflict
between these two types:
Content
A
I would suggest that A is a kind of "subtype" of Content. I can't just write
a:Content
a = {...}
init a
because part of the logic analyzes the content case
source
share