Skip to content

Instantly share code, notes, and snippets.

@kylecorbelli
Last active June 30, 2018 23:36
Show Gist options
  • Save kylecorbelli/72e3ae63beefb5e84d2e3a19dcd619d9 to your computer and use it in GitHub Desktop.
Save kylecorbelli/72e3ae63beefb5e84d2e3a19dcd619d9 to your computer and use it in GitHub Desktop.
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