forked from gluon-lang/gluon
-
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.
- Loading branch information
1 parent
4d4daea
commit e893f50
Showing
19 changed files
with
91 additions
and
102 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
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,12 +1,12 @@ | ||
let { run, monad, assert_ieq } = import "std/test.glu" | ||
let { run, applicative, monad, assert_ieq } = import "std/test.glu" | ||
let prelude = import "std/prelude.glu" | ||
let { Num } = prelude | ||
let { (>>=), return, (>>), join, map, lift2, forM_ } | ||
= prelude.make_Monad monad | ||
let { pure } = applicative | ||
let { (>>) } = prelude.make_Monad monad applicative | ||
let { (+), (-), (*) } = prelude.num_Int | ||
|
||
let l = lazy (\_ -> 123 + 57) | ||
|
||
assert_ieq (force (lazy \_ -> 2)) 2 >> | ||
return () >> | ||
pure () >> | ||
assert_ieq 180 (force l) |
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,15 +1,14 @@ | ||
let prelude = import "std/prelude.glu" | ||
let { run, monad, assert_eq, assert_ieq } = import "std/test.glu" | ||
let { run, applicative, monad, assert_eq, assert_ieq } = import "std/test.glu" | ||
let stream = import "std/stream.glu" | ||
let { Ord, Num, List, Option } = prelude | ||
let { (<) } = prelude.make_Ord prelude.ord_Int | ||
let { (+) } = prelude.num_Int | ||
let { (>>=), return, (>>), join, map, lift2, forM_ } | ||
= prelude.make_Monad monad | ||
let { (>>) } = prelude.make_Monad monad applicative | ||
|
||
let s = stream.from (\i -> if i < 5 then Some i else None) | ||
|
||
let assert_leq = assert_eq (prelude.show_List prelude.show_Int) (prelude.eq_List prelude.eq_Int) | ||
|
||
assert_ieq (stream.fold (+) 0 s) 10 >> | ||
assert_ieq (stream.fold (+) 0 s) 10 >> | ||
assert_leq (stream.fold (\h l -> Cons h l) Nil s) (Cons 4 (Cons 3 (Cons 2 (Cons 1 (Cons 0 Nil))))) |
Oops, something went wrong.