haskell - Is there a way to `fromIntegral . fromEnum` that works with all Integers? -


<पूर्व> & gt; (इन्ट्राग्रील से इन्नम) सच्चा 1

अच्छा।

  & gt; (इन्ट्राग्रल से एन्नम) (10000 :: इंट) 10000  

अच्छा।

  λ (से इंटेग्राल से। एनएम) 100000000000000000000 7766279631452241920  

अच्छा नहीं।

मैं कुछ कोडिंग data.bits के साथ बैटिंग कर रहा हूं और Bool , इंट और पूर्णांक पूर्णांक फ़ील्ड बहुत बड़ी हो सकती हैं।

अपडेट

मैं जो करने की कोशिश कर रहा हूं, इस तरह से ऐसा लग रहा है:

 < कोड> से एक्सचेंज :: एक्सचेंज - & gt; पूर्णांक से एक्सचेंज ई = पठार संयोजित करें बिट्स 0 इकट्ठा करें, जहां गठबंधन बीट्स = ((। |)। ($ E)) collectBits = [(`shiftL 127 127)। चकनाचूर । DoCommand, (`shiftL` 126)। चकनाचूर । ReadComplete, (`shiftL '116)। इंटरएग्रल से DestId, (`shiftL` 64)। पता, पेलोड, (`shiftL` 108)। इंटरएग्रल से मुखौटा, (`shiftL` 104)। इंटरएग्रल से से कॉमांड कमांड] tobit :: Enum a = & gt; ए - & gt; पूर्णांक toBits = से इंटरएग्रल  यदि संभव हो तो  toBits / fromIntegral  का कारक करना चाहते हैं। 


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -