-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rationalize H.Prelude exports and adapt H.ghci accordingly.
As part of this patch, remove the 'Show' class - or rather, make it private and rename it. It was being annoying before, because its name would clash with the standard type class from the Prelude. Now the H REPL only has H.Prelude imported by default. So the prompt is no longer cabalistic.
- Loading branch information
Showing
17 changed files
with
92 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
{-# LANGUAGE QuasiQuotes #-} | ||
module Main | ||
where | ||
module Main where | ||
|
||
import Fib | ||
|
||
import qualified H.Prelude as H | ||
import Language.R.QQ | ||
|
||
p x = [r| print(x_hs) |] >> return () | ||
|
||
main :: IO () | ||
main = H.withEmbeddedR H.defaultConfig $ H.runRegion $ do | ||
H.print =<< [r| "test" |] | ||
H.print =<< [r| 1+2 |] | ||
p =<< [r| "test" |] | ||
p =<< [r| 1+2 |] | ||
H.io $ putStrLn "[r| neg_hs(TRUE, 5L) |]" | ||
H.print =<< [r| neg_hs(TRUE, 5L) |] | ||
p =<< [r| neg_hs(TRUE, 5L) |] | ||
H.io $ putStrLn "[r| neg_hs(FALSE, 6L) |]" | ||
H.print =<< [r| neg_hs(FALSE, 6L) |] | ||
p =<< [r| neg_hs(FALSE, 6L) |] | ||
H.io $ putStrLn "[r| neg_hs(NA, 7L) |]" | ||
H.print =<< [r| neg_hs(NA, 7L) |] | ||
p =<< [r| neg_hs(NA, 7L) |] | ||
H.io $ putStrLn "[r| fib_hs(1L) |]" | ||
H.print =<< [r| fib_hs(1L) |] | ||
p =<< [r| fib_hs(1L) |] | ||
H.io $ putStrLn "[r| fib_hs(10L) |]" | ||
H.print =<< [r| fib_hs(10L) |] | ||
p =<< [r| fib_hs(10L) |] | ||
H.io $ putStrLn "[r| fact_hs(0L) |]" | ||
H.print =<< [r| fact_hs(0L) |] | ||
p =<< [r| fact_hs(0L) |] | ||
H.io $ putStrLn "[r| fact_hs(7L) |]" | ||
H.print =<< [r| fact_hs(7L) |] | ||
p =<< [r| fact_hs(7L) |] | ||
H.io $ putStrLn "[r| factSexp_hs(7L) |]" | ||
H.print =<< [r| factSexp_hs(7L) |] | ||
p =<< [r| factSexp_hs(7L) |] |
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
Oops, something went wrong.