Copyright | (C) 2018 Google Inc. |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
bitOrigins :: DataRepr' -> ConstrRepr' -> [BitOrigin] Source #
Given a type size and one of its constructor this function will yield a specification of which bits the whole type is made up of. I.e., a construction plan on how to make the whole data structure, given its individual constructor fields.
bitOrigins' :: DataRepr' -> ConstrRepr' -> [BitOrigin] Source #
Same as bitOrigins, but each item in result list represents a single bit.
bitRanges :: Integer -> [(Int, Int)] Source #
Determine consecutively set bits in word. Will produce ranges from high to low. Examples:
bitRanges 0b10 == [(1,1)] bitRanges 0b101 == [(2,2),(0,0)] bitRanges 0b10011001111 == [(10,10),(7,6),(3,0)]
isContinuousMask :: Integer -> Bool Source #
Result of various utilty functions. Indicates the origin of a certain bit: either a literal from the constructor (or an undefined bit), or from a literal.