Hi,
I want to write a tiny app to teach children about binary data. One of the things I want to discuss, is that it doesn’t matter if I talk about 0/1, High/Low-values or any other possible represantion of binary data. Therefore the binary data should be displayed in different ways which can be selected via a drop-down list. You can find a simplified version of it here:
https://ellie-app.com/vDY3pyWgB5ga1
(In the real app the binary data can be changed)
Everything works as intended, but I don’t like that the information how the binary data should be displayed is stored as a String. Instead I would like to use a more specific type.
You can find a variant (that doesn’t work) here:
https://ellie-app.com/vDXTMcBPFjwa1
I guess what I would need is something like
onInput : (a -> msg) -> Attribute msg
instead of
onInput : (String -> msg) -> Attribute msg
and
value : a -> Attribute msg
instead of
value : String -> Attribute msg
Do you have any ideas how the view function can be implemented without converting every ViewType to/from String?
Kinds regards, Tom