Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit c7287bf

Browse files
committed
Documentation fixes for functions that now return Maybe
1 parent d55af00 commit c7287bf

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/DOM/Node/HTMLCollection.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import DOM.Node.Types (Element, HTMLCollection, ElementId)
1414
-- | The number of elements in a HTMLCollection.
1515
foreign import length :: forall eff. HTMLCollection -> Eff (dom :: DOM | eff) Int
1616

17-
-- | The element in a HTMLCollection at the specified index, or null if no such
17+
-- | The element in a HTMLCollection at the specified index, or Nothing if no such
1818
-- | element exists.
1919
item :: forall eff. Int -> HTMLCollection -> Eff (dom :: DOM | eff) (Maybe Element)
2020
item i = map toMaybe <<< _item i
2121

2222
foreign import _item :: forall eff. Int -> HTMLCollection -> Eff (dom :: DOM | eff) (Nullable Element)
2323

2424
-- | The first element with the specified name or ID in a HTMLCollection, or
25-
-- | null if no such element exists.
25+
-- | Nothing if no such element exists.
2626
namedItem :: forall eff. ElementId -> HTMLCollection -> Eff (dom :: DOM | eff) (Maybe Element)
2727
namedItem id = map toMaybe <<< _namedItem id
2828

src/DOM/Node/Node.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ foreign import nodeName :: Node -> String
5757
foreign import baseURI :: forall eff. Node -> Eff (dom :: DOM | eff) String
5858

5959
-- | The document the node belongs to, unless the node is a document in which
60-
-- | case the value is null.
60+
-- | case the value is Nothing.
6161
ownerDocument :: forall eff. Node -> Eff (dom :: DOM | eff) (Maybe Document)
6262
ownerDocument = map toMaybe <<< _ownerDocument
6363

@@ -81,26 +81,26 @@ foreign import hasChildNodes :: forall eff. Node -> Eff (dom :: DOM | eff) Boole
8181
-- | The children of the node.
8282
foreign import childNodes :: forall eff. Node -> Eff (dom :: DOM | eff) NodeList
8383

84-
-- | The first child of the node, or null if the node has no children.
84+
-- | The first child of the node, or Nothing if the node has no children.
8585
firstChild :: forall eff. Node -> Eff (dom :: DOM | eff) (Maybe Node)
8686
firstChild = map toMaybe <<< _firstChild
8787

8888
foreign import _firstChild :: forall eff. Node -> Eff (dom :: DOM | eff) (Nullable Node)
8989

9090

91-
-- | The last child of the node, or null if the node has no children.
91+
-- | The last child of the node, or Nothing if the node has no children.
9292
lastChild :: forall eff. Node -> Eff (dom :: DOM | eff) (Maybe Node)
9393
lastChild = map toMaybe <<< _lastChild
9494

9595
foreign import _lastChild :: forall eff. Node -> Eff (dom :: DOM | eff) (Nullable Node)
9696

97-
-- | The previous sibling node, or null if there is no previous sibling.
97+
-- | The previous sibling node, or Nothing if there is no previous sibling.
9898
previousSibling :: forall eff. Node -> Eff (dom :: DOM | eff) (Maybe Node)
9999
previousSibling = map toMaybe <<< _previousSibling
100100

101101
foreign import _previousSibling :: forall eff. Node -> Eff (dom :: DOM | eff) (Nullable Node)
102102

103-
-- | The next sibling node, or null if there is no next sibling.
103+
-- | The next sibling node, or Nothing if there is no next sibling.
104104
nextSibling :: forall eff. Node -> Eff (dom :: DOM | eff) (Maybe Node)
105105
nextSibling = map toMaybe <<< _nextSibling
106106

src/DOM/Node/NodeList.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import DOM.Node.Types (Node, NodeList)
1313
-- | The number of items in a NodeList.
1414
foreign import length :: forall eff. NodeList -> Eff (dom :: DOM | eff) Int
1515

16-
-- | The item in a NodeList at the specified index, or null if no such node
16+
-- | The item in a NodeList at the specified index, or Nothing if no such node
1717
-- | exists.
1818
item :: forall eff. Int -> NodeList -> Eff (dom :: DOM | eff) (Maybe Node)
1919
item i = map toMaybe <<< _item i

src/DOM/Node/NonDocumentTypeChildNode.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import Data.Nullable (Nullable, toMaybe)
1010
import DOM (DOM)
1111
import DOM.Node.Types (Element, NonDocumentTypeChildNode)
1212

13-
-- | The previous sibling that is an element, or null if no such element exists.
13+
-- | The previous sibling that is an element, or Nothing if no such element exists.
1414
previousElementSibling :: forall eff. NonDocumentTypeChildNode -> Eff (dom :: DOM | eff) (Maybe Element)
1515
previousElementSibling = map toMaybe <<< _previousElementSibling
1616

1717
foreign import _previousElementSibling :: forall eff. NonDocumentTypeChildNode -> Eff (dom :: DOM | eff) (Nullable Element)
1818

19-
-- | The next sibling that is an element, or null if no such element exists.
19+
-- | The next sibling that is an element, or Nothing if no such element exists.
2020
nextElementSibling :: forall eff. NonDocumentTypeChildNode -> Eff (dom :: DOM | eff) (Maybe Element)
2121
nextElementSibling = map toMaybe <<< _nextElementSibling
2222

src/DOM/Node/ParentNode.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import DOM.Node.Types (NodeList, ParentNode, Element, HTMLCollection)
2222
-- | The child elements for the node.
2323
foreign import children :: forall eff. ParentNode -> Eff (dom :: DOM | eff) HTMLCollection
2424

25-
-- | The first child that is an element, or null if no such element exists.
25+
-- | The first child that is an element, or Nothing if no such element exists.
2626
firstElementChild :: forall eff. ParentNode -> Eff (dom :: DOM | eff) (Maybe Element)
2727
firstElementChild = map toMaybe <<< _firstElementChild
2828

2929
foreign import _firstElementChild :: forall eff. ParentNode -> Eff (dom :: DOM | eff) (Nullable Element)
3030

31-
-- | The last child that is an element, or null if no such element exists.
31+
-- | The last child that is an element, or Nothing if no such element exists.
3232
lastElementChild :: forall eff. ParentNode -> Eff (dom :: DOM | eff) (Maybe Element)
3333
lastElementChild = map toMaybe <<< _lastElementChild
3434

@@ -44,7 +44,7 @@ derive newtype instance ordQuerySelector :: Ord QuerySelector
4444
derive instance newtypeQuerySelector :: Newtype QuerySelector _
4545

4646
-- | Finds the first child that is an element that matches the selector(s), or
47-
-- | null if no such element exists.
47+
-- | Nothing if no such element exists.
4848
querySelector :: forall eff. QuerySelector -> ParentNode -> Eff (dom :: DOM | eff) (Maybe Element)
4949
querySelector qs = map toMaybe <<< _querySelector qs
5050

0 commit comments

Comments
 (0)