monus-weighted-search-0.1.0.0: Efficient search weighted by an ordered monoid with monus.
Copyright(c) Donnacha Oisín Kidney 2021
Maintainermail@doisinkidney.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Monus.Dist

Description

A Monus for discrete distances.

Synopsis

Documentation

newtype Dist Source #

A very simple Monus, based on the addition Monoid on Natural numbers. This represents discrete distances.

Constructors

Dist 

Fields

Instances

Instances details
Enum Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

succ :: Dist -> Dist #

pred :: Dist -> Dist #

toEnum :: Int -> Dist #

fromEnum :: Dist -> Int #

enumFrom :: Dist -> [Dist] #

enumFromThen :: Dist -> Dist -> [Dist] #

enumFromTo :: Dist -> Dist -> [Dist] #

enumFromThenTo :: Dist -> Dist -> Dist -> [Dist] #

Eq Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

(==) :: Dist -> Dist -> Bool #

(/=) :: Dist -> Dist -> Bool #

Integral Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

quot :: Dist -> Dist -> Dist #

rem :: Dist -> Dist -> Dist #

div :: Dist -> Dist -> Dist #

mod :: Dist -> Dist -> Dist #

quotRem :: Dist -> Dist -> (Dist, Dist) #

divMod :: Dist -> Dist -> (Dist, Dist) #

toInteger :: Dist -> Integer #

Data Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dist -> c Dist #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Dist #

toConstr :: Dist -> Constr #

dataTypeOf :: Dist -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Dist) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dist) #

gmapT :: (forall b. Data b => b -> b) -> Dist -> Dist #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dist -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dist -> r #

gmapQ :: (forall d. Data d => d -> u) -> Dist -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Dist -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dist -> m Dist #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dist -> m Dist #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dist -> m Dist #

Num Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

(+) :: Dist -> Dist -> Dist #

(-) :: Dist -> Dist -> Dist #

(*) :: Dist -> Dist -> Dist #

negate :: Dist -> Dist #

abs :: Dist -> Dist #

signum :: Dist -> Dist #

fromInteger :: Integer -> Dist #

Ord Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

compare :: Dist -> Dist -> Ordering #

(<) :: Dist -> Dist -> Bool #

(<=) :: Dist -> Dist -> Bool #

(>) :: Dist -> Dist -> Bool #

(>=) :: Dist -> Dist -> Bool #

max :: Dist -> Dist -> Dist #

min :: Dist -> Dist -> Dist #

Read Dist Source # 
Instance details

Defined in Data.Monus.Dist

Real Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

toRational :: Dist -> Rational #

Show Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

showsPrec :: Int -> Dist -> ShowS #

show :: Dist -> String #

showList :: [Dist] -> ShowS #

Ix Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

range :: (Dist, Dist) -> [Dist] #

index :: (Dist, Dist) -> Dist -> Int #

unsafeIndex :: (Dist, Dist) -> Dist -> Int #

inRange :: (Dist, Dist) -> Dist -> Bool #

rangeSize :: (Dist, Dist) -> Int #

unsafeRangeSize :: (Dist, Dist) -> Int #

Generic Dist Source # 
Instance details

Defined in Data.Monus.Dist

Associated Types

type Rep Dist :: Type -> Type #

Methods

from :: Dist -> Rep Dist x #

to :: Rep Dist x -> Dist #

Semigroup Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

(<>) :: Dist -> Dist -> Dist #

sconcat :: NonEmpty Dist -> Dist #

stimes :: Integral b => b -> Dist -> Dist #

Monoid Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

mempty :: Dist #

mappend :: Dist -> Dist -> Dist #

mconcat :: [Dist] -> Dist #

Arbitrary Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

arbitrary :: Gen Dist #

shrink :: Dist -> [Dist] #

Bits Dist Source # 
Instance details

Defined in Data.Monus.Dist

NFData Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

rnf :: Dist -> () #

Monus Dist Source # 
Instance details

Defined in Data.Monus.Dist

Methods

(|-|) :: Dist -> Dist -> Dist Source #

type Rep Dist Source # 
Instance details

Defined in Data.Monus.Dist

type Rep Dist = D1 ('MetaData "Dist" "Data.Monus.Dist" "monus-weighted-search-0.1.0.0-inplace" 'True) (C1 ('MetaCons "Dist" 'PrefixI 'True) (S1 ('MetaSel ('Just "runDist") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

type Graph a = a -> [(a, Dist)] Source #

A simple graph with Dist-weighted edges.

Note that the algorithms in this package can use any monus, not just Dist: we specialise here just for simplicity of presentation.