Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buggymcbugfix/35f76d9f24bbf38eeaab891cf00c7baf to your computer and use it in GitHub Desktop.
Save buggymcbugfix/35f76d9f24bbf38eeaab891cf00c7baf to your computer and use it in GitHub Desktop.
example.gr
-- 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