Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Synopsis
- data Positive number
- refine :: (Num n, Ord n) => Prism' n (Positive n)
- natPrism :: (Integral n, Bits n) => Prism' Natural (Positive n)
- intPrism :: (Integral n, Bits n) => Prism' Integer (Positive n)
- textPrism :: (Integral n, Bits n) => Prism' Text (Positive n)
- stringPrism :: (Integral n, Bits n) => Prism' String (Positive n)
- data Natural
- data Integer
- type Prism' s a = Optic' A_Prism NoIx s a
- view :: forall k (is :: IxList) s a. Is k A_Getter => Optic' k is s a -> s -> a
- review :: forall k (is :: IxList) t b. Is k A_Review => Optic' k is t b -> b -> t
- preview :: forall k (is :: IxList) s a. Is k An_AffineFold => Optic' k is s a -> s -> Maybe a
Type constructor
Instances
Show number => Show (Positive number) Source # | |
Eq number => Eq (Positive number) Source # | |
Ord number => Ord (Positive number) Source # | |
Defined in NatOptics.Positive.Unsafe compare :: Positive number -> Positive number -> Ordering # (<) :: Positive number -> Positive number -> Bool # (<=) :: Positive number -> Positive number -> Bool # (>) :: Positive number -> Positive number -> Bool # (>=) :: Positive number -> Positive number -> Bool # max :: Positive number -> Positive number -> Positive number # min :: Positive number -> Positive number -> Positive number # |
Optics
Re-exports
Natural number
Invariant: numbers <= 0xffffffffffffffff use the NS
constructor
Instances
Arbitrary precision integers. In contrast with fixed-size integral types
such as Int
, the Integer
type represents the entire infinite range of
integers.
Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.
If the value is small (fit into an Int
), IS
constructor is used.
Otherwise IP
and IN
constructors are used to store a BigNat
representing respectively the positive or the negative value magnitude.
Instances
Bits Integer | Since: base-2.1 |
Defined in Data.Bits (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # | |
Enum Integer | Since: base-2.1 |
Ix Integer | Since: base-2.1 |
Num Integer | Since: base-2.1 |
Read Integer | Since: base-2.1 |
Integral Integer | Since: base-2.0.1 |
Defined in GHC.Real | |
Real Integer | Since: base-2.0.1 |
Defined in GHC.Real toRational :: Integer -> Rational # | |
Show Integer | Since: base-2.1 |
Eq Integer | |
Ord Integer | |
Lift Integer | |
review :: forall k (is :: IxList) t b. Is k A_Review => Optic' k is t b -> b -> t #
Retrieve the value targeted by a Review
.
>>>
review _Left "hi"
Left "hi"
preview :: forall k (is :: IxList) s a. Is k An_AffineFold => Optic' k is s a -> s -> Maybe a #
Retrieve the value targeted by an AffineFold
.
>>>
let _Right = prism Right $ either (Left . Left) Right
>>>
preview _Right (Right 'x')
Just 'x'
>>>
preview _Right (Left 'y')
Nothing