-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci]
- Loading branch information
Zilin Chen
authored and
Zilin Chen
committed
Mar 6, 2018
1 parent
1e3f85e
commit cb22a04
Showing
4 changed files
with
57 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- | ||
-- Copyright 2017, NICTA | ||
-- | ||
-- This software may be distributed and modified according to the terms of | ||
-- the GNU General Public License version 2. Note that NO WARRANTY is provided. | ||
-- See "LICENSE_GPLv2.txt" for details. | ||
-- | ||
-- @TAG(NICTA_GPL) | ||
-- | ||
|
||
type A | ||
type B = {f1 : U8, f2 : U8, f3 : A} | ||
|
||
quxx : (B take f3, A, A) -> B | ||
quxx (b,x,y) = let b' = b {f3=x} | ||
and b'' = b' {f3=y} | ||
in b'' |
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,18 @@ | ||
-- | ||
-- Copyright 2017, NICTA | ||
-- | ||
-- This software may be distributed and modified according to the terms of | ||
-- the GNU General Public License version 2. Note that NO WARRANTY is provided. | ||
-- See "LICENSE_GPLv2.txt" for details. | ||
-- | ||
-- @TAG(NICTA_GPL) | ||
-- | ||
|
||
type A | ||
type B = {f1 : U8, f2 : U8, f3 : A} | ||
|
||
foo : B -> (B take f3, A, A) | ||
foo b = let b' {f3=x} = b | ||
and b'' {f3=y} = b' | ||
in (b'',x,y) | ||
|
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,19 @@ | ||
-- | ||
-- Copyright 2017, NICTA | ||
-- | ||
-- This software may be distributed and modified according to the terms of | ||
-- the GNU General Public License version 2. Note that NO WARRANTY is provided. | ||
-- See "LICENSE_GPLv2.txt" for details. | ||
-- | ||
-- @TAG(NICTA_GPL) | ||
-- | ||
|
||
type A | ||
type B = {f1 : U8, f2 : U8, f3 : A} | ||
|
||
-- can put multiple times | ||
bar : B take (f1) -> B | ||
bar b = let b' = b {f1 = 1} | ||
and b'' = b' {f1 = 2} | ||
in b'' | ||
|