Integral is the Haskell type class for whole-number types. It provides integer division, remainders, related division operations, and conversion to Integer. section 10.1.1
Its main operations include:
- Contrast Integral division with Fractional division, where (/) and recip operate on floating-point values. section 10.5
Counting audio samples
A sample count cannot contain half a sample, so convert a calculated Double with round: samplesPerPeriod hz = round $ sampleRate / hz and samplesPerSecond duration = round $ duration * sampleRate. Both functions return Int. section 10.1.1
