2012-01-25 4 views

답변

8

the documentation에 따르면,이 작업을해야합니다 : 컴파일 할 때

mySample :: StdGen -> Int -> [a] -> [a] 
mySample g n xs = fst $ sampleState (sample n xs) g 

는 그러나, 나는 중복 인스턴스 오류를 얻을. 그래도 이것을 컴파일 할 수 있습니다.

mySample :: StdGen -> Int -> [a] -> [a] 
mySample g n xs = evalState (runRVar (sample n xs) StdRandom) g 
관련 문제