Re: [elm-discuss] Convert Char to Int?

2017-01-27 Thread Duane Johnson
On Thu, Jan 26, 2017 at 11:52 PM, Peter Damoc  wrote:

> What does this mean? KeyCode is an alias to Int so, at least in theory,
> you should have the actual Int value of the Char.
> What happens if you display this Int value? How does it differ from what
> you need?
>

I was basing my comment on the documentation:

Keyboard keys can be represented as integers. These are called key codes.
> You can use toCode and fromCode to convert between key codes and characters.


And the `Char.toKeyCode` function describes its purpose as:

Convert to key code.


But it turns out you're right, there is a simple conversion to integer
happening under the hood.

I think what I'm concerned about is that these strings may be treated as
Unicode and some unintentional conversion will happen without my knowing.
But I haven't tried yet.

Thanks for your help on this.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Convert Char to Int?

2017-01-26 Thread Duane Johnson
Big picture:

I'm writing a visual display algorithm of a binary ".hex" file that is the
result of compiling code on the Arduino platform. I load the file into the
browser via HTTP.getString, and then attempt to display the values.

Problem:

I'm unable to find a way to represent this binary data stream as a series
of 16-bit integers. I've attempted String.toList which results in a (List
Char) type, but what should I do with Char? Char.toCode and Char.fromCode
seem specifically tuned for use with keyboard events.

Is there a way to handle a binary data series in Elm?

Thanks,
Duane Johnson

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.