hmt-base-0.20: Haskell Music Theory Base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Music.Theory.Enum

Description

Enumeration functions.

Synopsis

Documentation

genericFromEnum :: (Integral i, Enum e) => e -> i Source #

Generic variant of fromEnum (p.263).

genericToEnum :: (Integral i, Enum e) => i -> e Source #

Generic variant of toEnum (p.263).

enum_from_to_cyclic :: (Bounded a, Enum a) => a -> a -> [a] Source #

Variant of enumFromTo that, if p is after q, cycles from maxBound to minBound.

import Data.Word
enum_from_to_cyclic (254 :: Word8) 1 == [254,255,0,1]

enum_from_to_reverse :: Enum a => a -> a -> [a] Source #

Variant of enumFromTo that, if p is after q, enumerates from q to p.

enum_from_to_reverse 5 1 == [5,4,3,2,1]
enum_from_to_reverse 1 5 == enumFromTo 1 5

enum_univ :: (Bounded t, Enum t) => [t] Source #

All elements in sequence.

(enum_univ :: [Data.Word.Word8]) == [0 .. 255]

enum_list_gaps :: (Enum t, Eq t) => [t] -> [t] Source #

List of Enum values not in sorted input list.

enum_list_gaps "abdh" == "cefg"

enum_set_gaps :: (Enum t, Eq t, Ord t) => [t] -> [t] Source #