module Language.Drasil.Label.Type(
LblType(RP, Citation, URI), IRefProg(..)
, HasRefAddress(..), Referable(..)
, getAdd
, name, (+::+), raw, defer, prepend
) where
import Language.Drasil.UID (UID, HasUID)
data LblType =
RP IRefProg String
| Citation String
| URI String
data IRefProg =
Deferred UID
| RS String
| RConcat IRefProg IRefProg
| Name
class HasRefAddress b where
getRefAdd :: b -> LblType
class (HasUID s, HasRefAddress s) => Referable s where
refAdd :: s -> String
renderRef :: s -> LblType
getAdd :: LblType -> String
getAdd :: LblType -> String
getAdd (RP IRefProg
_ String
s) = String
s
getAdd (Citation String
s) = String
s
getAdd (URI String
s) = String
s
name :: IRefProg
name :: IRefProg
name = IRefProg
Name
(+::+) :: IRefProg -> IRefProg -> IRefProg
+::+ :: IRefProg -> IRefProg -> IRefProg
(+::+) = IRefProg -> IRefProg -> IRefProg
RConcat
raw :: String -> IRefProg
raw :: String -> IRefProg
raw = String -> IRefProg
RS
defer :: UID -> IRefProg
defer :: UID -> IRefProg
defer = UID -> IRefProg
Deferred
prepend :: String -> IRefProg
prepend :: String -> IRefProg
prepend String
s = String -> IRefProg
RS String
s IRefProg -> IRefProg -> IRefProg
+::+ String -> IRefProg
RS String
":" IRefProg -> IRefProg -> IRefProg
+::+ IRefProg
Name