Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
Resolves   #854.
  • Loading branch information
evhub committed Oct 20, 2024
1 parent f8b11d7 commit 01047ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ point(1,2) |> (==)$(point(1,2)) |> print
_Showcases matching to data types and the default equality operator. Values defined by the user with the `data` statement can be matched against and their contents accessed by specifically referencing arguments to the data type's constructor._

```coconut
class Tree
data Tree
data Empty() from Tree
data Leaf(n) from Tree
data Node(l, r) from Tree
Expand All @@ -1338,7 +1338,7 @@ Empty() |> depth |> print
Leaf(5) |> depth |> print
Node(Leaf(2), Node(Empty(), Leaf(3))) |> depth |> print
```
_Showcases how the combination of data types and match statements can be used to powerful effect to replicate the usage of algebraic data types in other functional programming languages._
_Showcases how the combination of data types and match statements can be used to powerful effect to replicate the usage of algebraic data types in other functional programming languages. Note that for `Tree` to be used for each case rather than `Empty`/`Leaf`/`Node`, `Tree` needs to be a `data` type to ensure that [`data` matching rather than `class` matching](#semantics-specification) is performed._

```coconut
def duplicate_first([x] + xs as l) =
Expand Down

0 comments on commit 01047ba

Please sign in to comment.