Hi Haskell Cafe,<br><br>I tried using type families over functions, but when I try it complains that the two lines marked conflict with each other.<br><br>class Broadcast a where<br> type Return a<br> broadcast :: a -> Return a<br>
<br>instance Broadcast [a -> r] where<br> type Return [a -> r] = a -> [r] -- Conflict!<br> broadcast fs a = []<br><br>instance Broadcast [a -> b -> r] where<br> type Return [a -> b -> r] = a -> b -> [r] -- Conflict!<br>
broadcast fs a b = []<br><br>Given that in Haskell, every function of n+1 arguments is also a function of n arguments, this is likely the cause of the conflict.<br><br>In this case, currying is not my friend.<br><br>Unfortunately this means I'm stuck with numbered function names:<br>
<br>bc0 :: [r] -> [r]<br>bc0 rs = rs<br><br>bc1 :: [a -> r] -> a -> [r]<br>bc1 [] a = []<br>bc1 (r:rs) a = (r a):bc1 rs a<br><br>bc2 rs a b = rs `bc1` a `bc1` b<br><br>bc3 rs a b c = rs `bc1` a `bc1` b `bc1` c<br>
<br>-- etc<br><br>Cheers,<br><br>-John<br><br>