Exercises part 2
-
Define a wrapper record for integral values and implement
Monoidso that(<+>)corresponds to(.&.).Hint: Have a look at the functions available from interface
Bitsto find a value suitable as the neutral element. -
Define a wrapper record for integral values and implement
Monoidso that(<+>)corresponds to(.|.). -
Use bitwise operations to implement a function, which tests if a given value of type
Bits64is even or not. -
Convert a value of type
Bits64to a string in binary representation. -
Convert a value of type
Bits64to a string in hexadecimal representation.Hint: Use
shiftRand(.&. 15)to access subsequent packages of four bits.