Safe Haskell | None |
---|---|
Language | Haskell2010 |
Definition of Positive
type and related utilities.
Synopsis
- newtype Positive = PositiveUnsafe {}
- mkPositive :: (Integral i, Buildable i) => i -> Either Text Positive
- lengthNE :: NonEmpty a -> Positive
- replicateNE :: Positive -> a -> NonEmpty a
Documentation
Integer values starting from 1.
We define our own datatype in order to have Data
instance for it,
which can not be derived for third-party types without exported constructor.
Instances
Eq Positive Source # | |
Data Positive Source # | |
Defined in Util.Positive gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Positive -> c Positive # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Positive # toConstr :: Positive -> Constr # dataTypeOf :: Positive -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Positive) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Positive) # gmapT :: (forall b. Data b => b -> b) -> Positive -> Positive # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Positive -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Positive -> r # gmapQ :: (forall d. Data d => d -> u) -> Positive -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Positive -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Positive -> m Positive # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Positive -> m Positive # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Positive -> m Positive # | |
Ord Positive Source # | |
Defined in Util.Positive | |
Show Positive Source # | |
Generic Positive Source # | |
ToJSON Positive Source # | |
Defined in Util.Positive | |
FromJSON Positive Source # | |
NFData Positive Source # | |
Defined in Util.Positive | |
Buildable Positive Source # | |
Defined in Util.Positive | |
type Rep Positive Source # | |
Defined in Util.Positive |
replicateNE :: Positive -> a -> NonEmpty a Source #
Produce a non empty list consisting of the given value.