Haskell question: is it possible to cast a pattern of Int to a pattern of Double? Is there a nifty Tidal way to cast it?
Specifically, I want to cast a pattern produced by markovPat
so that it can be used as the first argument in select
:
let pat1 = "{1@3}%16"
pat2 = "1(3,8)"
pat3 = "1*8"
mpat = markovPat 8 1 [[3,5,2], [4,4,7], [2,1,3]]
d1 $ struct (select (mpat / 2) [pat1, pat2, pat3]) $ s "bd"
The above code results in the error:
<interactive>:390:22: error:
• Couldn't match type ‘Int’ with ‘Double’
Expected: Pattern Double
Actual: Pattern Int
• In the first argument of ‘(/)’, namely ‘mpat’
In the first argument of ‘select’, namely ‘(mpat / 2)’
In the first argument of ‘struct’, namely
‘(select (mpat / 2) [pat1, pat2, pat3])’
If I use squeeze
without the / 2
instead of using select
, the idea works, but I would really prefer to use select
instead.
Ideas?