-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Closes #79 --------- Co-authored-by: Paul Cadman <git@paulcadman.dev>
- Loading branch information
1 parent
bc6ec82
commit f9ebce1
Showing
23 changed files
with
222 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
module Stdlib.Data.Bool; | ||
|
||
import Stdlib.Data.Bool.Base open public; | ||
import Stdlib.Trait.Eq open; | ||
import Stdlib.Trait.Ord open; | ||
import Stdlib.Trait.Show open; | ||
|
||
import Stdlib.Trait.Eq as Eq; | ||
open Eq using {Eq}; | ||
instance | ||
boolEqI : Eq Bool := | ||
mkEq | ||
λ { | ||
| true true := true | ||
| false false := true | ||
| _ _ := false | ||
}; | ||
|
||
import Stdlib.Trait.Ord as Ord; | ||
open Ord using {Ord}; | ||
instance | ||
boolOrdI : Ord Bool := | ||
mkOrd | ||
λ { | ||
| false false := EQ | ||
| false true := LT | ||
| true false := GT | ||
| true true := EQ | ||
}; | ||
|
||
import Stdlib.Trait.Show as Show; | ||
open Show using {Show}; | ||
|
||
module BoolTraits; | ||
Eq : Eq.Eq Bool := | ||
Eq.mkEq | ||
λ { | ||
| true true := true | ||
| false false := true | ||
| _ _ := false | ||
}; | ||
|
||
Ord : Ord.Ord Bool := | ||
Ord.mkOrd | ||
λ { | ||
| false false := Ord.EQ | ||
| false true := Ord.LT | ||
| true false := Ord.GT | ||
| true true := Ord.EQ | ||
}; | ||
|
||
Show : Show.Show Bool := | ||
Show.mkShow | ||
λ { | ||
| true := "true" | ||
| false := "false" | ||
}; | ||
end; | ||
instance | ||
showBoolI : Show Bool := | ||
mkShow | ||
λ { | ||
| true := "true" | ||
| false := "false" | ||
}; |
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
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
Oops, something went wrong.