Skip to content
/ Ruby Public

Executing Haskell within Ruby by using another process

License

Notifications You must be signed in to change notification settings

Azabuhs/Ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 17, 2015
a8f3d39 · Jan 17, 2015

History

6 Commits
Dec 11, 2014
Dec 11, 2014
Jan 17, 2015
Dec 11, 2014
Dec 11, 2014
Dec 11, 2014
Dec 11, 2014
Dec 11, 2014
Dec 11, 2014
Dec 11, 2014

Repository files navigation

Haskell On Ruby

require GHC

require 'haskell'

# Invoke sandbox for executing ghc
Haskell.invoke_sandbox!(File.expand_path('../', __FILE__))

Haskell.compile <<-HASKELL
  add :: Integer -> Integer -> Integer
  add x y = x + y
  result = add 1 2
HASKELL

while Haskell.compiling?
  # wait for....
end

p Haskell.execute
#=> 3

# Don't forget to revoke sandbox
Haskell.revoke_sandbox!

About

Executing Haskell within Ruby by using another process

Resources

License

Stars

Watchers

Forks

Packages

No packages published