Skip to content

Instantly share code, notes, and snippets.

@sleexyz
Created September 17, 2017 20:12
Show Gist options
  • Save sleexyz/8a8c1af8cadcf68f5d485cb4559a10e7 to your computer and use it in GitHub Desktop.
Save sleexyz/8a8c1af8cadcf68f5d485cb4559a10e7 to your computer and use it in GitHub Desktop.
stackMod :: [ Signal a -> Signal a] -> Signal a -> Signal a
stackMod mods sig = mconcat $ ($sig) <$> mods
sig :: Signal Word8
sig =
-- nest [ embed (12 * x + y) | x <- [0..1] >>= replicate 4 | y <- cycle [12, 7, 10, -5]]
nest [ embed (5 * x) | x <- [0..12] >>= replicate 1 ]
& fmap (`mod` 30) & fmap (`mod` 20)
& fmap (`mod` 20) & fmap (`mod` 14)
& stackMod
[ id
, fmap (+7)
, fmap (+12)
]
& fmap (+60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment