Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Z-n functions
Synopsis
- newtype Z i = Z {
- z_modulus :: i
- z_mod :: Integral i => Z i -> i -> i
- z5 :: Num i => Z i
- z7 :: Num i => Z i
- z12 :: Num i => Z i
- z16 :: Num i => Z i
- is_z_n :: (Num a, Ord a) => a -> a -> Bool
- lift_unary_Z :: Integral i => Z i -> (t -> i) -> t -> i
- lift_binary_Z :: Integral i => Z i -> (s -> t -> i) -> s -> t -> i
- z_add :: Integral i => Z i -> i -> i -> i
- z_sub :: Integral i => Z i -> i -> i -> i
- z_sub_unsigned :: (Integral i, Ord i) => Z i -> i -> i -> i
- z_mul :: Integral i => Z i -> i -> i -> i
- z_negate :: Integral i => Z i -> i -> i
- z_fromInteger :: Integral i => Z i -> Integer -> i
- z_signum :: t -> u -> v
- z_abs :: t -> u -> v
- to_Z :: Integral i => Z i -> i -> i
- from_Z :: (Integral i, Num n) => i -> n
- z_univ :: Integral i => Z i -> [i]
- z_complement :: Integral i => Z i -> [i] -> [i]
- z_quot :: Integral i => Z i -> i -> i -> i
- z_rem :: Integral i => Z i -> i -> i -> i
- div_err :: Integral i => String -> i -> i -> i
- z_div :: Integral i => Z i -> i -> i -> i
- z_quotRem :: Integral i => Z i -> i -> i -> (i, i)
- z_divMod :: Integral i => Z i -> i -> i -> (i, i)
- z_toInteger :: Integral i => Z i -> i -> i
- integral_to_digit :: Integral t => t -> Char
- is_z16 :: Integral t => t -> Bool
- z16_to_char :: Integral t => t -> Char
- z16_set_pp :: Integral t => [t] -> String
- z16_seq_pp :: Integral t => [t] -> String
- z16_vec_pp :: Integral t => [t] -> String
Documentation
lift_unary_Z :: Integral i => Z i -> (t -> i) -> t -> i Source #
lift_binary_Z :: Integral i => Z i -> (s -> t -> i) -> s -> t -> i Source #
z_add :: Integral i => Z i -> i -> i -> i Source #
Add two Z.
map (z_add z12 4) [1,5,6,11] == [5,9,10,3]
z_sub :: Integral i => Z i -> i -> i -> i Source #
The underlying type i is presumed to be signed...
z_sub z12 0 8 == 4
import Data.Word {- base -} z_sub z12 (0::Word8) 8 == 8 ((0 - 8) :: Word8) == 248 248 `mod` 12 == 8
z_sub_unsigned :: (Integral i, Ord i) => Z i -> i -> i -> i Source #
Allowing unsigned i is rather inefficient...
z_sub_unsigned z12 (0::Word8) 8 == 4
z_complement :: Integral i => Z i -> [i] -> [i] Source #
Z of z_univ
not in given set.
z_complement z5 [0,2,3] == [1,4] z_complement z12 [0,2,4,5,7,9,11] == [1,3,6,8,10]
z_toInteger :: Integral i => Z i -> i -> i Source #
Z16
integral_to_digit :: Integral t => t -> Char Source #
Type generalised intToDigit
.
map integral_to_digit [0 .. 15] == "0123456789abcdef"
z16_to_char :: Integral t => t -> Char Source #
Alias for integral_to_digit
.
z16_set_pp :: Integral t => [t] -> String Source #
z16_to_char
in braces, {1,2,3}.
z16_seq_pp :: Integral t => [t] -> String Source #
z16_to_char
in arrows, 1,2,3.
z16_vec_pp :: Integral t => [t] -> String Source #
z16_to_char
in brackets, [1,2,3].