कम करें मैंने हाल ही में हास्केल ग्रहण-प्लगइन "एक्लिप्ससेपी" स्थापित किया है। सबकुछ बहुत अच्छी तरह से काम करता है जबकि एक सुविधा है जो मुझे बहुत गुस्सा करती है हेहे। मैं आउटपुट के चेतावनी स्तर को कम नहीं कर सकता। ग्रहण/यह प्लगइन "-वॉल" ध्वज को स्वतः जोड़ना प्रतीत होता है, जो टाइप-चीजों के खिलाफ बहुत संवेदनशील है। एक उदाहरण पर इस दिखाने दें:ग्रहण (प्रकार) चेतावनी स्तर
*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>
आप वास्तव में इस कोड को कैसे लिखेंगे ताकि चेतावनी पहली जगह में दिखाई न दे? –