HaXPath 0.3.0.0 → 0.3.0.1
raw patch · 4 files changed
+28/−9 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- HaXPath.cabal +1/−1
- src/HaXPath.hs +5/−4
- src/HaXPath/Schematic.hs +17/−4
CHANGELOG.md view
@@ -1,3 +1,8 @@+## 0.3.0.1++* Make documentation display on Hackage+* Add mising Haddock+ ## 0.3.0.0 * Remove dependency on `text`
HaXPath.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.18 name: HaXPath-version: 0.3.0.0+version: 0.3.0.1 synopsis: An XPath-generating embedded domain specific language. description: An XPath-generating embedded domain specific language, allowing construction and composition of type-safe XPaths in Haskell.
src/HaXPath.hs view
@@ -335,7 +335,7 @@ instance IsExpression (Node' s) where toExpression = unNode --- | An XPath beginning from some context `c` (either the root context or the current context).+-- | An XPath beginning from some context @c@ (either the root context or the current context). newtype Path' c s = Path { unPath :: Expression s } -- | 'Path'' specialised so it can be shown as 'P.String'.@@ -359,7 +359,8 @@ -- | Type to indicate the XPath begins from the document root. data RootContext --- | Class of valid types for the type parameter `c` in 'Path'. Library users should not create instances of this class.+-- | Class of valid types for the type parameter @c@ in 'Path''. Library users should not create instances of this+-- class. class IsContext c where toPathBegin :: proxy c -> PathBegin @@ -412,8 +413,8 @@ Showed (Node' s) = s Showed (DocumentRoot' s) = s --- | Constraint for path-like types - i.e. they either a 'Path' or otherwise can be converted to one using abbreviated--- syntax rules.+-- | Constraint for path-like types - i.e. either a 'Path'' or otherwise a type that can be converted to one using+-- abbreviated syntax rules. type PathLike p = IsContext (Context p) -- | Type class for the XPath @/@ operator. It can operate on multiple types as the axes can be inferred based on
src/HaXPath/Schematic.hs view
@@ -111,14 +111,18 @@ false :: S.IsString s => Bool' as s false = Bool X.false --- | The type of simple numeric expressions which depend on the value of the attribute(s) @as@.+-- | The type of simple numeric expressions which depend on the value of the attribute(s) @as@ and can be showed as the+-- string type @s@. newtype Number' (as :: [Type]) s = Number { unNumber :: X.Number' s } +-- | 'Number'' specialised so it can be shown as 'P.String' type Number as = Number' as P.String --- | The type of simple text expressions which depend on the value of the attribute(s) @as@.+-- | The type of simple text expressions which depend on the value of the attribute(s) @as@ and can be showed as the+-- string type @s@. newtype Text' (as :: [Type]) s = Text { unText :: X.Text' s } +-- | 'Text'' specialised so it can be shown as 'P.String' type Text as = Text' as P.String -- | The type of path expressions which can be showed as the string type @s@ and are formed by these steps:@@ -132,12 +136,16 @@ -- | 'Path'' specialised so it can be shown as 'P.String'. type Path c axis n rn = Path' c axis n rn P.String +-- | An XPath beginning from the document root for the schema @sc@, returning a node of type @rn@. type AbsolutePath' sc rn = Path' X.RootContext Self (DocumentRoot sc) rn +-- | 'AbsolutePath'' specialised so it can be shown as 'P.String' type AbsolutePath sc rn = (AbsolutePath' sc rn) P.String +-- | An XPath beginning from the current context. type RelativePath' = Path' X.CurrentContext +-- | 'RelativePath'' specialised so it can be shown as 'P.String' type RelativePath axis n rn = RelativePath' axis n rn P.String instance S.IsString s => S.IsString (Text' as s) where@@ -260,6 +268,7 @@ -- | Return the name of the attribute. attributeName :: S.IsString s => proxy a -> s +-- | Type family which returns the node attribute(s) used within a given expression. type family AttributesUsed t where AttributesUsed (Bool' as s) = as AttributesUsed (Text' as s) = as@@ -321,9 +330,10 @@ fromInteger = Number . P.fromInteger negate = unary P.negate --- | Type of an XPath node of type @n@.+-- | Type of an XPath node of type @n@ which can be showed as the string type @s@. newtype Node' (n :: Type) s = Node { unNode :: X.Node' s } +-- | 'Node'' specialised so it can be shown as 'P.String'. type Node n = Node' n P.String -- | Type class of node types.@@ -364,9 +374,11 @@ type instance Relatives n Self = '[n] --- | Type of the document root for the schema @s@. Useful in forming an XPaths which must begin from the root.+-- | Type of the document root for the schema @sc@ which can be showed as the string type @s@. Useful in forming an+-- XPaths which must begin from the root. newtype DocumentRoot' sc s = DocumentRoot { unDocumentRoot :: X.DocumentRoot' s } +-- | 'DocumentRoot'' specialised so it can be shown as 'P.String'. type DocumentRoot sc = DocumentRoot' sc P.String type instance Relatives (DocumentRoot' sc s) Ancestor = '[]@@ -378,6 +390,7 @@ root' :: DocumentRoot' sc s root' = DocumentRoot X.root' +-- | 'root'' specialised so it can be shown as 'P.String'. root :: DocumentRoot sc root = root'