feat(syn): add `coding`
[haskell/literate-web.git] / tests / Examples / Ex02.hs
index 0b6d6161bfe85e5f652a323bb61081e74d3136bd..131f3dae6bfb1a81cd2b97b0110e57711305f5e0 100644 (file)
@@ -1,4 +1,5 @@
 {-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE PartialTypeSignatures #-}
 {-# LANGUAGE NoMonomorphismRestriction #-}
 {-# OPTIONS_GHC -Wno-missing-signatures #-}
 
@@ -17,11 +18,22 @@ data Route
 -- from the 'Route' algebraic data-type
 -- a function transforming Eithers-of-Tuples into a 'Route'.
 router =
-  dataType @Route $
-    pathSegment "index"
-      <+> "about"
-      </> pathSegment "me"
+  dataType @Route
+    $ pathSegment "index" -- <.> response @Char @'[PlainText]
+    <+> "about"
+    </> pathSegment "me"
+
+-- <. response2 @Char @'[PlainText]
 
 content = \case
-  Index -> return "INDEX"
+  -- In   -> Out
+  Index{} -> return "INDEX"
   About -> return "ABOUT"
+
+-- c0 = compile CompilerEnv{} router content
+
+address_IndexMe :: Address
+address_IndexMe = address router Index
+
+address_AboutMe :: Address
+address_AboutMe = address router About