CreatingRhythms-1.8.0.7
Copyright(c) Eric Bailey 2025
LicenseMIT
Maintainereric@ericb.me
Stabilitystable
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Rhythm.Binary.FoldSequences

Description

Binary fold sequences.

Synopsis

Ergonomic

foldSequence :: Int -> Integer -> Integer -> [Integer] Source #

See foldSequence'.

>>> foldSequence 7 2 3
[1,1,0,1,1,0,0]

Safe

foldSequence' :: forall n m. (KnownNat n, KnownNat m) => Finite (2 ^ m) -> Vector n (Finite 2) Source #

Generate a fold sequence of n terms with m bits from function number f \(\in \{0,\dotsc,2^m-1\}\).

>>> map getFinite $ VS.toList $ foldSequence' @7 @2 3
[1,1,0,1,1,0,0]