morley-1.0.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Util.Positive

Description

Definition of Positive type and related utilities.

Synopsis

Documentation

newtype Positive Source #

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.

Constructors

PositiveUnsafe 

Fields

Instances
Eq Positive Source # 
Instance details

Defined in Util.Positive

Data Positive Source # 
Instance details

Defined in Util.Positive

Methods

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 :: (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 # 
Instance details

Defined in Util.Positive

Show Positive Source # 
Instance details

Defined in Util.Positive

ToJSON Positive Source # 
Instance details

Defined in Util.Positive

FromJSON Positive Source # 
Instance details

Defined in Util.Positive

Buildable Positive Source # 
Instance details

Defined in Util.Positive

Methods

build :: Positive -> Builder #

lengthNE :: NonEmpty a -> Positive Source #

Count length of non-empty list.

replicateNE :: Positive -> a -> NonEmpty a Source #

Produce a non empty list consisting of the given value.