--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
Thanks very much John. The auto-formatter I'm using is https://github.com/avh4/elm-format, I also found it to be a bit much. I'm a big fan of automatic formatting so might look at changing these settings in elm-format, or if anyone knows of other autoformatters please let me know.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
(Btw, the (<|) function is the opposite of (|>). I personally use only the former, because it does things in the same order that you normally write a function. The latter makes things look "backwards".)
--
It’s some form of compiler bug. If in your gist, you replace the output type HasX a
by { a | x : Float }
, which is its definition, then the gist will suddenly compile. So I think you should try to bring this example down to a minimal case and then open a bug report at https://github.com/elm-lang/elm-compiler/issues (after you have checked there isn’t an issue covering this alreay).
About some of your specific questions:
- how HasX (HasXAndY {}) and HasXAndY (Has X a) could behave differently
They are different types. The first one is a record type that contains two (!) fields x
(of which only one is accessible) and one field y
. The second one is a record type that contains those two/three plus whatever fields the record type has to which a
will be instantiated.
- what the error message is trying to say; what is the difference between HasX { …, x : … } and HasX {…}
It’s trying to say that the first of these types has an x
field that the second of these types does not have. Likely a consequence of the double presence of x
(see above) in one of the two types. Like: HasX { ..., x : ... }
has two x
s, but HasX {...}
has only one.
--