{-# LANGUAGE NoMonomorphismRestriction #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}

module Examples.Ex01 where

import Control.Monad (Monad (..))
import Data.Text (Text)
import Literate.Web

-- | Polymorphic expression describing the website,
-- to be instantiated to the various interpreters.
-- NoMonomorphismRestriction is used to avoid specifying manually
-- the inferred symantic classes.
router =
  pathSegment "index"
    <.> response @Text @'[PlainText]
    <+> "about"
    </> pathSegment "me"

content =
  ( compilerEndpoint (return "INDEX")
  , return "ABOUT"
  )

-- c0 = compile CompilerEnv{} router content
-- m0 = siteManifest router

address_Index, address_About :: Address
(address_Index :!: address_About) = address router