this package에 정의 된 Stream
유형을 사용하려고합니다. 나에게이 오류 메시지가 제공Haskell에 설치된 패키지에서 유형 생성자를 가져올 수 없습니다.
import Stream
tail' :: Stream a -> Stream a
tail' (Cons x s) = s
: 음모와 함께 설치 한 후, 나는 빠른 테스트로 스트림에 꼬리 함수를 정의하려고 약간의 검색 후
test.hs:3:14: error:
Not in scope: type constructor or class `Stream'
Perhaps you meant `StreamT' (imported from Stream)
test.hs:3:26: error:
Not in scope: type constructor or class `Stream'
Perhaps you meant `StreamT' (imported from Stream)
test.hs:4:12: error: Not in scope: data constructor `Cons'
Failed, modules loaded: none.
을, 나는 문제가 될 줄 알았는데 모듈을 가져 오면 형식 생성자 Stream
과 생성자 Cons
이 자동으로 가져 오기되지 않습니다. 그래서 나는
test.hs:1:20: error: Module `Stream' does not export `Stream'
test.hs:1:28: error: Module `Stream' does not export `Cons'
Failed, modules loaded: none.
를 얻을이 수수께끼 된 후
import Stream (Stream, Cons)
tail' :: Stream a -> Stream a
tail' (Cons x s) = s
로 변경되었습니다. 설치된 패키지를 변경하고 Stream
및 Cons
을 내보내기 목록에 추가해야합니까? 또는 모듈을 올바르게 가져 오지 못했습니까?
링크 한 패키지에만'Data.Stream'이 있습니다. 다른 것을 가져와야합니다. –