-
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.
Main pass to optimize layout when user annotates function
- Loading branch information
1 parent
583a207
commit c937d0c
Showing
5 changed files
with
478 additions
and
63 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
gibbon-compiler/examples/layout_bench/layout1ContentSearchRunPipeline.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 Basics | ||
import GenerateLayout1 | ||
|
||
type Text = Vector Char | ||
|
||
emphKeywordInContent :: Text -> Blog -> Blog | ||
{-# ANN emphKeywordInContent Layout1 #-} | ||
emphKeywordInContent keyword blogs = | ||
case blogs of | ||
End -> End | ||
Layout1 header id author date content tags rst -> let newContent = case content of | ||
Content block -> Content (emphasizeKeywordInBlock keyword block) | ||
newRst = emphKeywordInContent keyword rst | ||
in Layout1 header id author date newContent tags newRst | ||
|
||
-- main function | ||
gibbon_main = | ||
let blogs = mkBlogs_layout1 2 | ||
keyword :: Vector Char | ||
keyword = "a" | ||
newblgs = emphKeywordInContent keyword blogs | ||
in printPacked newblgs |
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.