Skip to content

Commit d2b2a5d

Browse files
Drop Effect wrapper on doctype (#52)
* Drop Effect wrapper on doctype * Update Bower dependencies to master or main * Drop unneeded map now that Effect is gone
1 parent 40472a3 commit d2b2a5d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Notable changes to this project are documented in this file. The format is based
66

77
Breaking changes:
88
- Migrate FFI to ES modules (#51 by @JordanMartinez)
9+
- Unwrap returned `Effect` for `doctype` (#52 by @JordanMartinez)
910

1011
New features:
1112

src/Web/DOM/Document.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export const origin = getEffProp("origin");
1212
export const compatMode = getEffProp("compatMode");
1313
export const characterSet = getEffProp("characterSet");
1414
export const contentType = getEffProp("contentType");
15-
export const _doctype = getEffProp("doctype");
15+
export function _doctype(doc) {
16+
return doc["doctype"];
17+
}
1618
export const _documentElement = getEffProp("documentElement");
1719

1820
export function getElementsByTagName(localName) {

src/Web/DOM/Document.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ foreign import compatMode :: Document -> Effect String
8989
foreign import characterSet :: Document -> Effect String
9090
foreign import contentType :: Document -> Effect String
9191

92-
doctype :: Document -> Effect (Maybe DocumentType)
93-
doctype = map toMaybe <<< _doctype
92+
doctype :: Document -> Maybe DocumentType
93+
doctype = toMaybe <<< _doctype
9494

95-
foreign import _doctype :: Document -> Effect (Nullable DocumentType)
95+
foreign import _doctype :: Document -> Nullable DocumentType
9696

9797
documentElement :: Document -> Effect (Maybe Element)
9898
documentElement = map toMaybe <<< _documentElement

0 commit comments

Comments
 (0)