`option` is supposed to match to the html <option>, thus only strings, any 
marshalling you will need to perform yourself, such as by, for example, 
wrapping up option into something like `optionMyType t = option [ value 
(myTypeSerialize t) ]` or so for ease of use.  :-)


On Tuesday, October 25, 2016 at 6:45:26 AM UTC-6, James Hamilton wrote:
>
> Hello!
>
> I suppose this really only applies to instances of <option>, but there may 
> be other examples. 
>
> When using <option> with <select>, it's necessary to set a value on the 
> <option> using <value> which accepts a String. However, I usually actually 
> want to refer to a Type which I have to represent as a String and marshal 
> it back to its correct type when updating the model. 
>
> Is there a way of doing this using a type, and if not could it be done? I 
> think it's a reasonable thing to expect to be able to do with an <option>, 
> but then again I'm pretty new to this so please tell me if I'm asking for 
> something complicated!
>
>

-- 
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