title: Swap Two Nibbles Byte
signature: swapTwoNibblesByte :: Integer -> Integer
  swapTwoNibblesByte x = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> String
  driver x expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME x) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (57) (147) )
  
      printf "TEST-1...%s\n" (driver (99) (54) )
  
      printf "TEST-2...%s\n" (driver (66) (36) )
  
      printf "TEST-3...%s\n" (driver (97) (22) )
  
      printf "TEST-4...%s\n" (driver (95) (245) )
  
      printf "TEST-5...%s\n" (driver (42) (162) )
  
      printf "TEST-6...%s\n" (driver (95) (245) )
  
      printf "TEST-7...%s\n" (driver (89) (149) )
  
      printf "TEST-8...%s\n" (driver (3) (48) )
  
      printf "TEST-9...%s\n" (driver (84) (69) )
  
source_py: def swap_two_nibbles_byte(x):
      return (((x & 15) << 4) | ((x & 240) >> 4))
source_cpp: int swap_two_nibbles_byte(int x) {
    return ( ( x & 0x0F ) << 4 | ( x & 0xF0 ) >> 4 );
  }