생산자가 Producer ByteString IO()
이고 파이프가 Pipe ByteString a IO()
인 경우 효과를 어떻게 작성합니까? 실행하면 IO a
가됩니까?생산자와 파이프를 연결하여 결과 추출
여기에 최선을 시도입니다 :
그것은 다음과 같은 실패{-# LANGUAGE ScopedTypeVariables #-}
import Pipes
import Data.ByteString
run :: forall a. IO a
run = runEffect $
(undefined :: Producer ByteString IO()) >-> (undefined :: Pipe ByteString a IO())
: 일반적으로
Couldn't match type `Void' with `()'
Expected type: IO a
Actual type: IO()
In the expression:
runEffect
$ (undefined :: Producer ByteString IO())
>-> (undefined :: Pipe ByteString a IO())
In an equation for `run':
run
= runEffect
$ (undefined :: Producer ByteString IO())
>-> (undefined :: Pipe ByteString a IO())
전체 소스 및 오류 메시지입니까? 그것은 매우 이상하게 보인다! 결국 그것은 Void와()를 통합하려고 시도하지만 Void는 예상되는 유형에 나타나지 않는다고 말합니다. –
@DanielWagner'Void'가 나타납니다 ('Effect'타입 별명의 서명에 있음). (http://hackage.haskell.org/package/pipes-4.0.0/docs/Pipes-Core.html#t:Effect). 코드와 오류에 대해서는 업데이트를 참조하십시오. –
문제의 해결책에 관계없이 GHC 본부에 오류가 얼마나 나쁜지 불평합니다! –