-
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.
[new] Allow pattern matching in lambdas, and compile constructors (#22)
Allow lambda expressions to have multiple clauses employing pattern matching logic just like what is done for top level definitions. This improves expressiveness as previously we couldn't pattern match in kernels that were defined as lambdas created by classical functions. These multi-clause lambda expressions - "multilambdas" - are parsed inside curly braces, as many lambda expressions separated by a `|`. Closes #8, #17 --------- Co-authored-by: Alan Lawrence <[email protected]>
- Loading branch information
Showing
30 changed files
with
424 additions
and
301 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
module Brat.Checker.Quantity where | ||
|
||
data Quantity = None | One | Tons deriving Show | ||
|
||
qpred :: Quantity -> Maybe Quantity | ||
qpred None = Nothing | ||
qpred One = Just None | ||
qpred Tons = Just Tons | ||
data Quantity = None | One | Tons deriving (Enum, Show) |
Oops, something went wrong.