Sfoglia il codice sorgente

Beginning implementation of Rivest flavor; beginnings of Tutorial module

Getty Ritter 10 anni fa
parent
commit
ee1800ba37
2 ha cambiato i file con 65 aggiunte e 0 eliminazioni
  1. 30 0
      Data/SExpression/Rivest.hs
  2. 35 0
      Data/SExpression/Tutorial.hs

+ 30 - 0
Data/SExpression/Rivest.hs

@@ -0,0 +1,30 @@
+module Data.SExpression.Rivest where
+
+import           Data.ByteString (ByteString)
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Base64 as B64
+import           Data.Text (Text)
+import qualified Data.Text as T
+
+newtype Atom = Atom { fromAtom :: ByteString } deriving (Eq, Show, Read)
+
+pToken :: Parser ByteString
+pToken = undefined
+
+pQuoted :: Maybe Int -> Parser ByteString
+pQuoted = do
+  char '"'
+  ss <- many1 quoteChar
+  char '"'
+  return ss
+
+pHex :: Parser ByteString
+pHex = undefined
+
+pVerbatim :: Int -> Parser ByteString
+pVerbatim = do
+  char ':'
+  take n
+
+pBase64Verbatim :: Parser ByteString
+pBase64 :: Parser ByteString

+ 35 - 0
Data/SExpression/Tutorial.hs

@@ -0,0 +1,35 @@
+{-| The @blah@ library attempts to be as general as possible, and to
+    support a wide range of use-cases for s-expressions. It is built
+    around a core of primitives which are then exposed in various
+    ways, and can be easily and flexibly extended. This tutorial
+    describes particular use-cases, and then shows how to adapt this
+    library to that use-case.
+-}
+
+module Data.SExpression.Tutorial
+  ( -- * Basic Usage and Organization
+    -- $usage
+    -- * Analyzing Scheme code
+    -- $scheme
+    -- * Building a Custom Config Format
+    -- $config
+    -- * Building a Custom Lisp
+    -- $lisp
+  ) where
+
+{- $usage
+
+-}
+
+{- $scheme
+
+-}
+
+
+{- $config
+
+-}
+
+{- $lisp
+
+-}