-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ check ] Fix type-checking bug, add more example
- Loading branch information
Showing
5 changed files
with
59 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
# 0.1.6 | ||
|
||
+ Integrate `minitt-util` for CLI | ||
+ Fix type-checking bug | ||
+ Fix reduction bug | ||
|
||
# 0.1.5 | ||
|
||
|
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,20 @@ | ||
Parse successful. | ||
sign: set1 | ||
body: Rec {} | ||
sign: set1 | ||
body: Sum {} | ||
sign: Rec {} | ||
body: {||} | ||
sign: set1 | ||
body: Sum {False: Rec {}, True: Rec {}} | ||
sign: Sum {False: Rec {}, True: Rec {}} | ||
body: (@True {||}) | ||
sign: Sum {False: Rec {}, True: Rec {}} | ||
body: (@False {||}) | ||
sign: ((Sum {False: Rec {}} -> Sum {False: Rec {}, True: Rec {}}) -> (Sum {False: Rec {}, True: Rec {}} -> Sum {False: Rec {}, True: Rec {}})) | ||
body: (\ (cases {{ True: \ (\ (@False {||})); } or [0])) | ||
sign: ((Sum {} -> Sum {False: Rec {}, True: Rec {}}) -> (Sum {False: Rec {}} -> Sum {False: Rec {}, True: Rec {}})) | ||
body: (\ (cases {{ False: \ (\ (@True {||})); } or [0])) | ||
sign: (Sum {False: Rec {}, True: Rec {}} -> Sum {False: Rec {}, True: Rec {}}) | ||
body: (\ False => (\ (@True {||})); True => (\ (@False {||})); ) | ||
Checkmate, dram! |
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,30 @@ | ||
// | ||
// Created by Dependently-Typed Lambda Calculus on 2019-08-29 | ||
// simple-pattern-match | ||
// Author: ice10 | ||
// | ||
|
||
let Unit = Rec {}; | ||
let Bottom = Sum {}; | ||
|
||
val unit : Unit; | ||
let unit = {| |}; | ||
|
||
let Bool = Sum { True: Unit; False: Unit; }; | ||
|
||
val true : Bool; | ||
let true = @True unit; | ||
|
||
val false : Bool; | ||
let false = @False unit; | ||
|
||
val notTrue : (Sum { False: Unit; } -> Bool) | ||
-> Bool -> Bool; | ||
let notTrue = \f. case True u: false or f; | ||
|
||
val notFalse : (Bottom -> Bool) | ||
-> Sum { False: Unit; } -> Bool; | ||
let notFalse = \f. case False u: true or f; | ||
|
||
val not : Bool -> Bool; | ||
let not = notTrue (notFalse whatever); |
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