drasil-database-0.1.1.0: A framework for code and document generation for scientific software - Database SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Drasil.Database.UID

Description

Unique Identifier used across Drasil.

Synopsis

Documentation

data UID Source #

A UID is a 'unique identifier' for things that we will put into our database of information. We use a newtype wrapper to make sure we are only using UIDs where desired.

Instances

Instances details
ToJSON UID Source # 
Instance details

Defined in Drasil.Database.UID

Methods

toJSON :: UID -> Value

toEncoding :: UID -> Encoding

toJSONList :: [UID] -> Value

toEncodingList :: [UID] -> Encoding

ToJSONKey UID Source # 
Instance details

Defined in Drasil.Database.UID

Methods

toJSONKey :: ToJSONKeyFunction UID

toJSONKeyList :: ToJSONKeyFunction [UID]

Generic UID Source # 
Instance details

Defined in Drasil.Database.UID

Associated Types

type Rep UID :: Type -> Type #

Methods

from :: UID -> Rep UID x #

to :: Rep UID x -> UID #

Show UID Source # 
Instance details

Defined in Drasil.Database.UID

Methods

showsPrec :: Int -> UID -> ShowS #

show :: UID -> String #

showList :: [UID] -> ShowS #

Eq UID Source # 
Instance details

Defined in Drasil.Database.UID

Methods

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

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

Ord UID Source # 
Instance details

Defined in Drasil.Database.UID

Methods

compare :: UID -> UID -> Ordering #

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

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

(>) :: UID -> UID -> Bool #

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

max :: UID -> UID -> UID #

min :: UID -> UID -> UID #

type Rep UID Source # 
Instance details

Defined in Drasil.Database.UID

type Rep UID = D1 ('MetaData "UID" "Drasil.Database.UID" "drasil-database-0.1.1.0-5oPj4CLw7PwuDH58oM3Qz" 'False) (C1 ('MetaCons "UID" 'PrefixI 'True) (S1 ('MetaSel ('Just "_namespace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [String]) :*: S1 ('MetaSel ('Just "_baseName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))

class HasUID c where Source #

The most basic item: having a unique identifier key, here a UID.

Methods

uid :: Getter c UID Source #

Provides a unique id for internal Drasil use.

Instances

Instances details
HasUID Chunk Source # 
Instance details

Defined in Drasil.Database.Chunk

Methods

uid :: Getter Chunk UID Source #

mkUid :: String -> UID Source #

Smart constructor for UIDs from raw Values.

nsUid :: String -> UID -> UID Source #

Nest a UID under a namespace.

(+++) :: HasUID a => a -> String -> UID Source #

Append a suffix to a thing with a UID and get the resulting UID.

(+++.) :: UID -> String -> UID Source #

Append a suffix to a UID.

(+++!) :: (HasUID a, HasUID b) => a -> b -> UID Source #

Merge the UIDs of two chunks through simple concatenation.

showUID :: HasUID a => a -> String Source #

Get something's UID as a Value.