Difference between revisions of "fromMaybes"

From TidalCycles userbase
Jump to: navigation, search
(Created page with "<languages/> <translate> <!--T:1--> {{DISPLAYTITLE:fromMaybes}} Type: <source inline>fromMaybes :: [Maybe a] -> Pattern a</source> <!--T:2--> '''fromMaybes...")
 
(No difference)

Latest revision as of 20:44, 24 December 2020


Type: fromMaybes :: [Maybe a] -> Pattern a

fromMaybes is much like listToPat but when it encounters a Nothing it puts a gap in the pattern and when it encounters Just x puts x in the pattern.

d1 $ n (fromMaybes [Just 0, Nothing, Just 2]) # s "superpiano"

is equivalent to

d1 $ n "0 ~ 2" # s "superpiano"

See also: listToPat,fromList