यहां मैंने ghci में क्या करने की कोशिश की है:डेटा क्यों नहीं है। पाठ उदाहरण मेरे लिए काम करते हैं?
import Data.Text
strip " abc "
मुझे यह त्रुटि संदेश मिलता है:
<interactive>:1:6:
Couldn't match expected type `Text' against inferred type `[Char]'
In the first argument of `strip', namely `" abc "'
In the expression: strip " abc "
In the definition of `it': it = strip " abc "
मैं इसे काम करने की उम्मीद कर रहा था क्योंकि यह इस उत्तर सहित कई वेब पृष्ठों पर दिया गया था: In Haskell, how do you trim whitespace from the beginning and end of a string?
मैं क्या गलत कर रहा हूँ?
अतिभारित तार अपने .hs फ़ाइल की पहली पंक्ति को pragma जोड़कर सक्षम करने के लिए सबसे आसान कर रहे हैं: '{- # भाषा OverloadedStrings # -}' –