I use the third pattern you describe in elm-animation, and it works, but it's 
definitely clunky.

I think there are two separate issues here. First is the syntax of wrapping and 
unwrapping and using as-patterns. The second is performance. I know Evan has 
said he wants to optimize away the wrapper, but the timeframe remains 
characteristically uncertain. I'd like to see union types be comparable, so 
that would help. And finally there's the notion of keeping the model "the same" 
for the purposes of lazy views, which I'm not immediately sure how to solve for 
records that contain functions. Union types are already equatable though. 

As for syntax, while I find your form very elegant, I'm worried someone will try

type Foo = {...} | Float

since this seems like a reasonable extension of existing union types. When in 
fact, the types in question were never union types; it's the tag we're trying 
to get rid of!

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to