Last active
June 30, 2018 23:36
-
-
Save kylecorbelli/72e3ae63beefb5e84d2e3a19dcd619d9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
main :: IO () | |
main = | |
putStrLn "what is your email address?" >> | |
getLine >>= \email -> | |
putStrLn . show $ view email | |
view :: Email -> Html | |
view email = | |
div | |
[ page email | |
] | |
page :: Email -> Html | |
page email = | |
div | |
[ topNav | |
, content email | |
] | |
topNav :: Html | |
topNav = | |
div | |
[ h1 [ "OurSite.com" ] | |
] | |
content :: Email -> Html | |
content email = | |
div | |
[ h1 [ "Custom Content for " ++ email ] | |
, left | |
, right email | |
] | |
left :: Html | |
left = | |
div | |
[ p [ "this is the left side" ] | |
] | |
right :: Email -> Html | |
right email = | |
div | |
[ article email | |
] | |
article :: Email -> Html | |
article email = | |
div | |
[ p [ "this is an article" ] | |
, widget email | |
] | |
widget :: Email -> Html | |
widget email = | |
div | |
[ p [ "Hey " ++ email ++ ", we've got a great offer for you!" ] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment