-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6670 from roc-lang/glue-abilities
Add abilities for glue types
- Loading branch information
Showing
2 changed files
with
17 additions
and
15 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,11 +1,13 @@ | ||
interface TypeId | ||
exposes [TypeId, fromU64, toU64] | ||
exposes [TypeId, typeIDfromU64, typeIDtoU64] | ||
imports [] | ||
|
||
TypeId := U64 implements [Eq, Hash] | ||
TypeId := U64 implements [Eq, Hash, Inspect, Encoding] | ||
|
||
toU64 : TypeId -> U64 | ||
toU64 = \@TypeId x -> x | ||
# renamed here so we can import the functions directly as a workaround for | ||
# https://github.com/roc-lang/roc/issues/5477 | ||
typeIDtoU64 : TypeId -> U64 | ||
typeIDtoU64 = \@TypeId x -> x | ||
|
||
fromU64 : U64 -> TypeId | ||
fromU64 = @TypeId | ||
typeIDfromU64 : U64 -> TypeId | ||
typeIDfromU64 = @TypeId |
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