-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42a3476
commit 094c6e9
Showing
6 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Equal | ||
LessThan | ||
GreaterThan | ||
LessThan | ||
GreaterThan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- Deriving Ord | ||
module test086; | ||
|
||
import Stdlib.Data.Fixity open; | ||
import Stdlib.Data.Bool open; | ||
import Stdlib.Data.Pair open; | ||
import Stdlib.Trait.Ord open; | ||
import Stdlib.System.IO open; | ||
|
||
syntax alias compare := Ord.cmp; | ||
|
||
type T := | ||
| One | ||
| Two | ||
| Three | ||
| Four; | ||
|
||
deriving instance | ||
ordT : Ord T; | ||
|
||
main : IO := | ||
printLn (compare One One) | ||
>>> printLn (compare One Two) | ||
>>> printLn (compare Two One) | ||
>>> printLn (compare (One, One) (One, Three)) | ||
>>> printLn (compare (Four, Four) (Four, Three)); |