-
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.
Compile Prim nodes to Hugr DFG (#34)
* Driveby cleanups of some misnamed `examples/` * Add monomorphic test so it compiles+validaties rather than having any type erasure issues (#18)
- Loading branch information
Showing
6 changed files
with
30 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
ha :: Nat | ||
ha = ?idx | ||
|
||
-- Holes can go in kernels | ||
f :: { Qubit -o Qubit, Bool } | ||
f = { q => q, ?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,15 @@ | ||
ext "to_float" to_float(i :: Int) -> Float | ||
|
||
map1({ Int -> Float }, List(Int)) -> List(Float) | ||
map1(_, []) = [] | ||
map1(f, x ,- xs) = f(x) ,- map1(f, xs) | ||
|
||
test1 :: List(Float) | ||
test1 = map1(to_float, [5]) | ||
|
||
map2({ {Int -> Float} -> Float}, List({Int->Float})) -> List(Float) | ||
map2(_, []) = [] | ||
map2(f, x ,- xs) = f(x) ,- map2(f, xs) | ||
|
||
test2 :: List(Float) | ||
test2 = map2({f => f(5)}, [to_float]) |
File renamed without changes.
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