Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides types and functions for PostgreSQL's ltree
https://www.postgresql.org/docs/current/ltree.html
You will want to use a specific implementation, e.g. postgresql-simple-ltree
.
Synopsis
- newtype LTree = LTree {}
- data Label
- map :: (Label -> Label) -> LTree -> LTree
- fromList :: [Label] -> LTree
- toList :: LTree -> [Label]
- rootLabel :: LTree -> Maybe Label
- parentLabel :: LTree -> Maybe Label
- parent :: LTree -> Maybe LTree
- numLabels :: LTree -> Int
- mkLabel :: Text -> Either String Label
- unsafeMkLabel :: Text -> Label
- uuidToLabel :: UUID -> Label
- empty :: LTree
- null :: LTree -> Bool
- singleton :: Label -> LTree
- snoc :: LTree -> Label -> LTree
- render :: LTree -> Text
- unsafeUncheckedParse :: Text -> LTree
- parse :: Text -> Either String LTree
- isImmediateParentOf :: LTree -> LTree -> Bool
- isImmediateChildOf :: LTree -> LTree -> Bool
- parseUUIDFromLabel :: Label -> Either String UUID
- allLabelsUnique :: LTree -> Bool
Documentation
Wrapper for Postgres' ltree
(label tree) type.
Wrapper for a single label in an ltree
.
The constructor IS NOT exported to ensure we only construct valid
labels. See mkLabel
for constructing a Label
.
unsafeMkLabel :: Text -> Label Source #
uuidToLabel :: UUID -> Label Source #
unsafeUncheckedParse :: Text -> LTree Source #
isImmediateParentOf :: LTree -> LTree -> Bool Source #
Test whether the first LTree
is an immediate parent of the second;
e.g. a.b
is an immediate parent of a.b.c