최근에 Haskell Eclipse 플러그인 "EclipseFP"를 설치했습니다. 나를 화나게하는 기능이 하나있는 반면 모든 기능은 꽤 잘 작동합니다. hehe. 출력의 경고 수준을 줄일 수 없습니다. 이클립스/플러그인은 "-Wall"플래그를 자동으로 추가하는 것으로 보이는데 이는 형식에 매우 민감합니다. 의이 예에서이 보여 드리죠 :Eclipse (유형) 경고 수준 줄이기
*Main> head [1,2,3]
<interactive>:1:11:
Warning: Defaulting the following constraint(s) to type `Integer'
(Num a0) arising from the literal `3'
In the expression: 3
In the first argument of `head', namely `[1, 2, 3]'
In the expression: head [1, 2, 3]
<interactive>:1:11:
Warning: Defaulting the following constraint(s) to type `Integer'
(Num a0) arising from the literal `3' at <interactive>:1:11
(Show a0) arising from a use of `print' at <interactive>:1:1-12
In the expression: 3
In the first argument of `head', namely `[1, 2, 3]'
In the expression: head [1, 2, 3]
1
*Main>
네, 그건 정말 짜증나입니다. 이것은 "내장"기능과 사용자 정의 기능으로 인해 발생합니다. 또 다른 하나
factorial :: (Integral a) => a -> a
factorial 1 = 1
factorial n = n * factorial (n-1)
*Main> factorial 3
<interactive>:1:1:
Warning: Defaulting the following constraint(s) to type `Integer'
(Integral a0) arising from a use of `factorial'
at <interactive>:1:1-9
(Num a0) arising from the literal `3' at <interactive>:1:11
In the expression: factorial 3
In an equation for `it': it = factorial 3
<interactive>:1:1:
Warning: Defaulting the following constraint(s) to type `Integer'
(Integral a0) arising from a use of `factorial'
at <interactive>:1:1-9
(Num a0) arising from the literal `3' at <interactive>:1:11
(Show a0) arising from a use of `print' at <interactive>:1:1-11
In the expression: factorial 3
In an equation for `it': it = factorial 3
6
*Main>
경고가 처음에 나타나지 않으므로 실제로이 코드를 작성 하시겠습니까? –