Skip to content

Commit

Permalink
Merge pull request #7 from lukewilliamboswell/remove-nat
Browse files Browse the repository at this point in the history
Fix for removal of `Nat`
  • Loading branch information
Hasnep authored Mar 3, 2024
2 parents a4dded2 + 469e776 commit 4bd31c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Html.roc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ interface Html
imports [Attribute.{ Attribute, attribute }, SafeStr.{ SafeStr, escape, dangerouslyMarkSafe }]

## An HTML node, either an HTML element or some text inside an HTML element.
Node : [Element Str Nat (List Attribute) (List Node), Text Str, UnescapedHtml Str]
Node : [Element Str U64 (List Attribute) (List Node), Text Str, UnescapedHtml Str]

## Create a `Text` node containing a string.
##
Expand Down Expand Up @@ -198,7 +198,7 @@ element = \tagName ->
Element tagName totalSize attrs children

## Internal helper to calculate the size of a node
nodeSize : Node -> Nat
nodeSize : Node -> U64
nodeSize = \node ->
when node is
Text content ->
Expand Down
4 changes: 2 additions & 2 deletions src/SafeStr.roc
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ expect
toStr (dangerouslyMarkSafe badStr) == badStr

## The SafeStr equivalent of Str.withCapacity
withCapacity : Nat -> SafeStr
withCapacity : U64 -> SafeStr
withCapacity = \capacity ->
@SafeStr (Str.withCapacity capacity)

expect toStr (withCapacity 10) == ""

## The SafeStr equivalent of Str.reserve
reserve : SafeStr, Nat -> SafeStr
reserve : SafeStr, U64 -> SafeStr
reserve = \@SafeStr str, additionalCapacity ->
@SafeStr (Str.reserve str additionalCapacity)

Expand Down

0 comments on commit 4bd31c3

Please sign in to comment.