After fixing that: 7.hs:2:67: Not in scope: `join'
7.hs:5:23: Not in scope: `shiftR'
7.hs:5:39: Not in scope: `.&.'
7.hs:7:19: Not in scope: `genericIndex'
7.hs:17:41: Not in scope: `.&.'
7.hs:17:105: Not in scope: `join'
7.hs:18:52: Not in scope: `shiftR'
7.hs:19:64: Not in scope: `join'
7.hs:22:25: Not in scope: `join'
7.hs:26:23: Not in scope: `shiftL'
After importing Control.Monad, Data.List and Data.Bits: 7.hs:26:25:
No instance for (Monad ((->) Integer))
arising from a use of `join' at 7.hs:26:25-57
Possible fix:
add an instance declaration for (Monad ((->) Integer))
In the first argument of `(*)', namely
`join (*) (recFactorial $ div n 2)'
In the expression: join (*) (recFactorial $ div n 2) * swing n
In the definition of `recFactorial':
recFactorial n | n < 2 = 1
| True = join (*) (recFactorial $ div n 2) * swing n
Name:
tehmeh2009-06-19 18:13
>>50
def fact(x): return (1 if x==0 else x * fact(x-1))