-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'layout_changes' of github.com:iu-parfunc/gibbon into la…
…yout_changes
- Loading branch information
Showing
26 changed files
with
1,247 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
682 changes: 682 additions & 0 deletions
682
gibbon-compiler/examples/layout_bench/Ghc/ghc/MainGhc.hs
Large diffs are not rendered by default.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout1ContentSearch.hs
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import MainGhc | ||
|
||
emphKeywordInContent :: Text -> Blog -> Blog | ||
emphKeywordInContent keyword blogs = | ||
case blogs of | ||
End -> End | ||
Layout1 header id author date content tags rst -> let --present = searchBlogContent keyword content | ||
--_ = printsym (quote "NEWLINE") | ||
--_ = printbool present | ||
--_ = printsym (quote "NEWLINE") | ||
newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
--_ = printsym (quote "NEWLINE") | ||
--_ = printPacked newContent | ||
--_ = printsym (quote "NEWLINE") | ||
newRst = emphKeywordInContent keyword rst | ||
in Layout1 header id author date newContent tags newRst | ||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout1 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInContent ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
20 changes: 20 additions & 0 deletions
20
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout1FindBlogs.hs
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import MainGhc | ||
|
||
insertKeywordInTagList :: Text -> Blog -> Blog | ||
insertKeywordInTagList keyword blogs = case blogs of | ||
End -> End | ||
Layout1 header id author date content tags rst -> let present = searchBlogTags keyword tags | ||
in if present then | ||
let newRst = insertKeywordInTagList keyword rst | ||
in Layout1 header id author date content tags newRst | ||
else insertKeywordInTagList keyword rst | ||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout1 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList insertKeywordInTagList ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
26 changes: 26 additions & 0 deletions
26
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout1TagSearch.hs
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import MainGhc | ||
|
||
emphKeywordInTag :: Text -> Blog -> Blog | ||
emphKeywordInTag keyword blogs = case blogs of | ||
End -> End | ||
Layout1 header id author date content tags rst -> let present = searchBlogTags keyword tags -- search the tags for the keyword | ||
--_ = printbool present | ||
in if (present) | ||
then let newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInTag keyword rst | ||
in Layout1 header id author date newContent tags newRst | ||
else | ||
let newRst = emphKeywordInTag keyword rst | ||
in Layout1 header id author date content tags newRst | ||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout1 400000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInTag ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
26 changes: 26 additions & 0 deletions
26
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout2ContentSearch.hs
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import MainGhc | ||
|
||
emphKeywordInContent :: Text -> Blog -> Blog | ||
emphKeywordInContent keyword blogs = | ||
case blogs of | ||
End -> End | ||
Layout2 content tags rst header id author date -> --let present = searchBlogContent keyword content | ||
-- in | ||
-- if present then | ||
let newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInContent keyword rst | ||
in Layout2 newContent tags newRst header id author date | ||
-- else | ||
-- let newRst = emphKeywordInContent keyword rst | ||
-- in Layout2 content tags newRst header id author date | ||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout2 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInContent ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
21 changes: 21 additions & 0 deletions
21
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout2FindBlogs.hs
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import MainGhc | ||
|
||
|
||
insertKeywordInTagList :: Text -> Blog -> Blog | ||
insertKeywordInTagList keyword blogs = case blogs of | ||
End -> End | ||
Layout2 content tags rst header id author date -> let present = searchBlogTags keyword tags | ||
in if present then | ||
let newRst = insertKeywordInTagList keyword rst | ||
in Layout2 content tags newRst header id author date | ||
else insertKeywordInTagList keyword rst | ||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout2 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList insertKeywordInTagList ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
27 changes: 27 additions & 0 deletions
27
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout2TagSearch.hs
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import MainGhc | ||
|
||
emphKeywordInTag :: Text -> Blog -> Blog | ||
emphKeywordInTag keyword blogs = case blogs of | ||
End -> End | ||
Layout2 content tags rst header id author date -> let present = searchBlogTags keyword tags -- search the tags for the keyword | ||
-- _ = printbool present | ||
in if (present) | ||
then let newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInTag keyword rst | ||
in Layout2 newContent tags newRst header id author date | ||
else | ||
let newRst = emphKeywordInTag keyword rst | ||
in Layout2 content tags newRst header id author date | ||
|
||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout2 400000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInTag ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
22 changes: 22 additions & 0 deletions
22
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout3ContentSearch.hs
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import MainGhc | ||
|
||
emphKeywordInContent :: Text -> Blog -> Blog | ||
emphKeywordInContent keyword blogs = | ||
case blogs of | ||
End -> End | ||
Layout3 tags rst content header id author date -> let --present = searchBlogContent keyword content | ||
newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInContent keyword rst | ||
in Layout3 tags newRst newContent header id author date | ||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout3 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInContent ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
20 changes: 20 additions & 0 deletions
20
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout3FindBlogs.hs
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import MainGhc | ||
|
||
insertKeywordInTagList :: Text -> Blog -> Blog | ||
insertKeywordInTagList keyword blogs = case blogs of | ||
End -> End | ||
Layout3 tags rst content header id author date -> let present = searchBlogTags keyword tags | ||
in if present then | ||
let newRst = insertKeywordInTagList keyword rst | ||
in Layout3 tags newRst content header id author date | ||
else insertKeywordInTagList keyword rst | ||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout3 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList insertKeywordInTagList ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
30 changes: 30 additions & 0 deletions
30
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout3TagSearch.hs
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import MainGhc | ||
|
||
emphKeywordInTag :: Text -> Blog -> Blog | ||
emphKeywordInTag keyword blogs = case blogs of | ||
End -> End | ||
Layout3 tags rst content header id author date -> let present = searchBlogTags keyword tags -- search the tags for the keyword | ||
--_ = printbool present | ||
in if present then | ||
let | ||
newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInTag keyword rst | ||
in Layout3 tags newRst newContent header id author date | ||
else | ||
let | ||
newRst = emphKeywordInTag keyword rst | ||
in Layout3 tags newRst content header id author date | ||
|
||
|
||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout3 400000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInTag ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
22 changes: 22 additions & 0 deletions
22
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout4ContentSearch.hs
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import MainGhc | ||
|
||
emphKeywordInContent :: Text -> Blog -> Blog | ||
emphKeywordInContent keyword blogs = | ||
case blogs of | ||
End -> End | ||
Layout4 tags content rst header id author date -> let --present = searchBlogContent keyword content | ||
newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInContent keyword rst | ||
in Layout4 tags newContent newRst header id author date | ||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout4 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInContent ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
20 changes: 20 additions & 0 deletions
20
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout4FindBlogs.hs
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import MainGhc | ||
|
||
insertKeywordInTagList :: Text -> Blog -> Blog | ||
insertKeywordInTagList keyword blogs = case blogs of | ||
End -> End | ||
Layout4 tags content rst header id author date -> let present = searchBlogTags keyword tags | ||
in if present then | ||
let newRst = insertKeywordInTagList keyword rst | ||
in Layout4 tags content newRst header id author date | ||
else insertKeywordInTagList keyword rst | ||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout4 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList insertKeywordInTagList ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
26 changes: 26 additions & 0 deletions
26
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout4TagSearch.hs
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import MainGhc | ||
|
||
emphKeywordInTag :: Text -> Blog -> Blog | ||
emphKeywordInTag keyword blogs = case blogs of | ||
End -> End | ||
Layout4 tags content rst header id author date -> let present = searchBlogTags keyword tags | ||
in if (present) then | ||
let newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInTag keyword rst | ||
in Layout4 tags newContent newRst header id author date | ||
else | ||
let newRst = emphKeywordInTag keyword rst | ||
in Layout4 tags content newRst header id author date | ||
|
||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout4 400000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInTag ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
22 changes: 22 additions & 0 deletions
22
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout5ContentSearch.hs
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import MainGhc | ||
|
||
emphKeywordInContent :: Text -> Blog -> Blog | ||
emphKeywordInContent keyword blogs = | ||
case blogs of | ||
End -> End | ||
Layout5 rst tags content header id author date -> let --present = searchBlogContent keyword content | ||
newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInContent keyword rst | ||
in Layout5 newRst tags newContent header id author date | ||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout5 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList emphKeywordInContent ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
21 changes: 21 additions & 0 deletions
21
gibbon-compiler/examples/layout_bench/Ghc/ghc/layout5FindBlogs.hs
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import MainGhc | ||
|
||
insertKeywordInTagList :: Text -> Blog -> Blog | ||
insertKeywordInTagList keyword blogs = case blogs of | ||
End -> End | ||
Layout5 rst tags content header id author date -> let present = searchBlogTags keyword tags | ||
in if present then | ||
let newRst = insertKeywordInTagList keyword rst | ||
in Layout5 newRst tags content header id author date | ||
else insertKeywordInTagList keyword rst | ||
|
||
|
||
|
||
-- main function | ||
main :: IO () | ||
main = | ||
do let blogs1 = mkBlogs_layout5 1000000 | ||
(newblog1, self1, batch1) <- benchFilterBlogsBasedOnKeywordInTagList insertKeywordInTagList ['a'] blogs1 1 | ||
putStrLn $ "Length of new Blogs is: " | ||
print (blogLength newblog1) | ||
putStrLn $ "Done." |
Oops, something went wrong.