forked from B-Lang-org/bsc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename TApp -> TStrCat, implement TNumToStr
- Loading branch information
Showing
11 changed files
with
64 additions
and
17 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
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,32 @@ | ||
package TNumToStr where | ||
|
||
data (WrapStr :: $ -> *) s = WrapStr | ||
data (WrapNum :: # -> *) s = WrapNum | ||
|
||
printWrapStr :: WrapStr s -> Action | ||
printWrapStr _ = $display (stringOf s) | ||
|
||
a :: WrapStr (TNumToStr 42) | ||
a = WrapStr | ||
|
||
class FoldNumsStr a s | a -> s where {} | ||
|
||
instance (FoldNumsStr a s) => FoldNumsStr (WrapNum i, a) (TStrCat (TNumToStr i) (TStrCat "_" s)) where {} | ||
instance FoldNumsStr (WrapNum i) (TNumToStr i) where {} | ||
instance FoldNumsStr () "" where {} | ||
|
||
b :: (FoldNumsStr (WrapNum 1, WrapNum 22, WrapNum 333) s) => WrapStr s | ||
b = WrapStr | ||
|
||
c :: (FoldNumsStr () s) => WrapStr s | ||
c = WrapStr | ||
|
||
sysTNumToStr :: Module Empty | ||
sysTNumToStr = module | ||
|
||
rules | ||
when True ==> do | ||
printWrapStr a | ||
printWrapStr b | ||
printWrapStr c | ||
$finish |
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,3 @@ | ||
42 | ||
1_22_333 | ||
|
File renamed without changes.