title: Creating ByteString from String representation of chars in Haskell
body: <p>I'm trying to create Char8 ByteString from String of already converted to bytes Chars.</p>
  <p>For example for String &quot;65&quot; I want ByteString on which unpack method will give me &quot;A&quot;. Because 65 is equal to <code>chr 65</code>. It would be better if this method will able to work with digits in hex representation. So I want something like this:</p>
  <pre><code>toByteString :: String -&gt; ByteString
  toByteString s = **** s
  
  --Numbers bettwen 0 and 255 or 00 and ff
  someBS = toByteString &quot; 72 97 115 107 104 101 108 108&quot; -- evaluates to ByteString
  
  str :: String
  str bs = unpack someBS -- evaluates to &quot;Haskhell&quot; 
  
  </code></pre>
  <p>I already tried to find something what I want in documentation  for <code>ByteString.Char8</code> and <code>Char</code>, but it seems that there is no built in methods for my purpose in these libraries. Maybe I'm missing something.</p>
  <p>I think there is must be a way to create ByteString from chars and somehow it's not obvious enough to find it</p>