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
{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes, | |
TemplateHaskell, MultiParamTypeClasses #-} | |
import Yesod | |
import Control.Applicative | |
import Data.Text (Text) | |
data MFormExample = MFormExample | |
mkYesod "MFormExample" [parseRoutes| | |
/ RootR GET |
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
{-# LANGUAGE QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, | |
OverloadedStrings, TypeFamilies #-} | |
import Yesod | |
import Yesod.Form.Jquery | |
import Data.Time (Day) | |
import Data.Text (Text) | |
import Control.Applicative ((<$>), (<*>)) | |
data Synopsis = Synopsis |
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
{-# LANGUAGE QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, | |
OverloadedStrings, TypeFamilies #-} | |
import Yesod | |
import Yesod.Form.Jquery | |
import Data.Time (Day) | |
import Data.Text (Text) | |
import Control.Applicative ((<$>), (<*>)) | |
data Synopsis = Synopsis |
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
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings #-} | |
import Yesod | |
import Network.HTTP.Types (encodePath) | |
import Blaze.ByteString.Builder.Char.Utf8 (fromText) | |
import qualified Data.Text as T | |
import qualified Data.Text.Encoding as TE | |
import Control.Arrow ((***)) | |
import Data.Monoid (mappend) | |
data Slash = Slash |
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
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-} | |
import Text.Shakespeare.Text | |
import qualified Data.Text.Lazy.IO as TLIO | |
import Data.Text (Text) | |
import Control.Monad (forM_) | |
data Item = Item | |
{ itemName :: Text | |
, itemQty :: Int | |
} |
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
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Text.Hamlet (HtmlUrlI18n, ihamlet) | |
import Text.Blaze.Html (toHtml) | |
import Text.Blaze.Html.Renderer.String (renderHtml) | |
data MyRoute = Home | Time | Stylesheet |
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
foo { bar: baz } |
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
{-# LANGUAGE OverloadedStrings #-} -- we're using Text below | |
{-# LANGUAGE QuasiQuotes #-} | |
import Text.Hamlet (HtmlUrl, hamlet) | |
import Data.Text (Text) | |
import Text.Blaze.Html.Renderer.String (renderHtml) | |
data MyRoute = Home | Time | Stylesheet | |
render :: MyRoute -> [(Text, Text)] -> Text | |
render Home _ = "/home" |
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
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Text.Hamlet (HtmlUrl, hamlet) | |
import Text.Blaze.Html.Renderer.String (renderHtml) | |
import Data.Text (Text) | |
data MyRoute = Home | |
render :: MyRoute -> [(Text, Text)] -> Text | |
render Home _ = "/home" |
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
-- Just ignore the quasiquote stuff for now, and that shamlet thing. | |
-- It will be explained later. | |
{-# LANGUAGE QuasiQuotes #-} | |
import Text.Hamlet (shamlet) | |
import Text.Blaze.Html.Renderer.String (renderHtml) | |
import Data.Char (toLower) | |
import Data.List (sort) | |
data Person = Person | |
{ name :: String |