2012-11-03 4 views
0

프로젝트에 acid-state을 사용하려고하는데이 데모를 실행하는 데 문제가 있습니다.acid-state 예제 오류

내 64 비트 상자에 this example collection에서 HelloWorld.hs을 실행하면 같은 일뿐만 아니라 HelloWorldNoTH.hs으로 발생하는 오류

acid-state.hs:26:7: 
    No instance for (MonadState 
         HelloWorldState (Update HelloWorldState)) 
     arising from a use of `put' 
    Possible fix: 
     add an instance declaration for 
     (MonadState HelloWorldState (Update HelloWorldState)) 
    In the expression: put (HelloWorldState newValue) 
    In an equation for `writeState': 
     writeState newValue = put (HelloWorldState newValue) 

acid-state.hs:29:43: 
    No instance for (MonadReader 
         HelloWorldState (Query HelloWorldState)) 
     arising from a use of `ask' 
    Possible fix: 
     add an instance declaration for 
     (MonadReader HelloWorldState (Query HelloWorldState)) 
    In a stmt of a 'do' block: HelloWorldState string <- ask 
    In the expression: 
     do { HelloWorldState string <- ask; 
      return string } 
    In an equation for `queryState': 
     queryState 
      = do { HelloWorldState string <- ask; 
       return string } 

에게 나에게 제공합니다. 32 비트 시스템에서는 오류가 표시되지 않습니다. 여기에 무슨 일이 일어나고 있는거야? 필요한 구성 요소를 설치하지 않았습니까 (또는 부적절하게 설치 했습니까?)?

나는 Cabal 0.14.0과 함께, (haskell-platform 패키지를 통해 설치된) 64 비트 데비안 휘지에서 "The Glorious Glasgow Haskell Compilation System, version 7.4.1"을 실행 중입니다. 기계 자체는 64 비트 Core i3입니다. 데모를 성공적으로 실행 한 32 비트 시스템은 분명하지 않습니다.

+0

이 질문에 이전 한 (모나드 변압기 인스턴스를 가져 오는 두 문제는) 내가 뭔가가 당신의/데비안의 하스켈 플랫폼 설치에 깨진 생각합니다. 아마도 쓸모없는 제안 : (1)''ghc-pkg check'',''cabal install hsenv', 새로운 프로젝트 디렉토리와 hsenv,''cabal update & cabal install cabal'','cabal update' 0.16), 그리고 마지막으로'cabal install acid-state uststack-server'를 사용했다. – Fixnum

+0

'HelloWorld.hs' 코드 예제가 데비안 패키지로 컴파일 된 것을 확인할 수 있습니다. 어쩌면'rm -rf ~/.ghc'을 시도하고'libghc-acid-state-dev'를 설치하여 직접 라이브러리를 컴파일하지 않아도됩니다. –

답변

0

이것은 실행중인 아키텍처와는 전혀 관련이 없습니다 (결론에 도달하는 데 유감스럽게 생각합니다).

일부 구성이 잘못되었거나 일부 충돌하는 cabal 라이브러리가 설치되어있는 것으로 나타났습니다. 내 .ghc을 지우고 적절한 라이브러리를 다시 설치하면 트릭이 나옵니다. 데비안이나 비교에 경우 :

rm -r ~/.ghc/* 
cabal install acid-state