title: Safe conversion to Word8
body: <p>Take a look at the following snippet:</p>
  
  <pre><code>Prelude&gt; import Data.Word
  Prelude&gt; data Foo = Foo Word8 deriving Show
  Prelude&gt; Foo 4
  Foo 4
  Prelude&gt; Foo 44
  Foo 44
  Prelude&gt; Foo 444
  Foo 188
  </code></pre>
  
  <p>I'm a bit surprised that 444 is implicitly converted to 188 like in unsafe C. It looks pretty error-prone to me. What's the idiomatic way to deal with such conversions safely in Haskell?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>It seems this is just polymorphic behavior of literals and modern compiler warns about this. The most important is that type system doesn't allow such implicit truncation. <code>Foo (444 :: Int)</code> generates type mismatch, so this is completely safe if value is known in run-time only.</p>