갈루아의 반서재

728x90


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
blackbriar-0.0.0: build (lib)
Preprocessing library blackbriar-0.0.0...
[11 of 12] Compiling Handler.Echo     ( src/Handler/Echo.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Echo.o )
[12 of 12] Compiling Application      ( src/Application.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Application.o )
 
/src/Application.hs:50:1: error:
    Illegal view pattern:  fromPathPiece -> Just dyn_anHx
    Use ViewPatterns to enable view patterns
 
--  While building package blackbriar-0.0.0 using:
      /root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:blackbriar --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
Type help for available commands. Press enter to force a rebuild.
^Cuser interrupt
yesod: Received ExitFailure 1 when running
Raw command: stack build --fast --file-watch blackbriar:lib --exec "/root/.stack/snapshots/x86_64-linux/lts-9.14/8.0.2/bin/yesod devel-signal" --flag blackbriar:dev --flag blackbriar:library-only
cs


위와 같이 에러가 발생하는 경우 package.yaml 파일을 열어 `dependencies:`  섹션 다음에 다음을 추가해주면 된다. 

default-extensions: ViewPatterns

    Illegal view pattern:  fromPathPiece -> Just dyn_anHx
    Use ViewPatterns to enable view patterns


package.yaml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
name:    blackbriar
version: "0.0.0"
 
dependencies:
 
# Due to a bug in GHC 8.0.1, we block its usage
# See: https://ghc.haskell.org/trac/ghc/ticket/12130
- base >=4.8.2.0 && <4.9 || >=4.9.1.0 && <5
 
# version 1.0 had a bug in reexporting Handler, causing trouble
- classy-prelude-yesod >=0.10.2 && <1.0 || >=1.1
 
- yesod >=1.4.3 && <1.5
- yesod-core >=1.4.30 && <1.5
...
- wai
 
default-extensions: ViewPatterns
cs



728x90