morley-1.12.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

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

Defined in Util.Positive

Show Positive Source # 
Instance details

Defined in Util.Positive

Generic Positive Source # 
Instance details

Defined in Util.Positive

Associated Types

type Rep Positive :: Type -> Type #

Methods

from :: Positive -> Rep Positive x #

to :: Rep Positive x -> Positive #

ToJSON Positive Source # 
Instance details

Defined in Util.Positive

FromJSON Positive Source # 
Instance details

Defined in Util.Positive

NFData Positive Source # 
Instance details

Defined in Util.Positive

Methods

rnf :: Positive -> () #

Buildable Positive Source # 
Instance details

Defined in Util.Positive

Methods

build :: Positive -> Builder #

type Rep Positive Source # 
Instance details

Defined in Util.Positive

type Rep Positive = D1 ('MetaData "Positive" "Util.Positive" "morley-1.12.0-inplace" 'True) (C1 ('MetaCons "PositiveUnsafe" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPositive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

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.