Created
June 1, 2017 20:06
-
-
Save buggymcbugfix/35f76d9f24bbf38eeaab891cf00c7baf to your computer and use it in GitHub Desktop.
example.gr
This file contains hidden or 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
-- Effectful example in Gram | |
-- Similar to Haskell | |
-- main :: IO a | |
-- main = readLn | |
echo : (Int -> <Int> {}) -> Int -> <Int> {W} | |
echo = \f -> \x -> let <a : Int> = write x in f x | |
dub : Int -> <Int> {} | |
dub = \x -> <x * 2> | |
foo : |Int| 2 -> |Int| 4 -> |Int| 2 | |
foo = \xBox -> \yBox -> let |x : Int| = xBox in | |
let |y : Int| = yBox in | |
|x + y + y| | |
main : <Int> {W} | |
main = echo dub 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment