]> Git — Sourcephile - haskell/literate-web.git/blob - tests/Examples/Ex01.hs
1a47025e5b01bff89182c2e83e5f687e356171e4
[haskell/literate-web.git] / tests / Examples / Ex01.hs
1 {-# LANGUAGE NoMonomorphismRestriction #-}
2 {-# OPTIONS_GHC -Wno-missing-signatures #-}
3
4 module Examples.Ex01 where
5
6 import Control.Monad (Monad (..))
7 import Data.Text (Text)
8 import Literate.Web
9 import Symantic qualified as Sym
10
11 -- | Polymorphic expression describing the website,
12 -- to be instantiated to the various interpreters.
13 -- NoMonomorphismRestriction is used to avoid specifying manually
14 -- the inferred symantic classes.
15 router =
16 pathSegment "index" <.> response @Text @'[PlainText]
17 <+> "about" </> pathSegment "me"
18
19 content =
20 (Sym.endpoint (return "INDEX"), return "ABOUT")