Added haskell annotation to interactive code block (to see how github responds)
Getty Ritter
10 years ago
| 36 | 36 | S-expression data, and the third represents only a subset of possible |
| 37 | 37 | S-expressions. |
| 38 | 38 | |
| 39 |
~~~~ |
|
| 39 | ~~~~.haskell | |
| 40 | 40 | -- cons-based representation |
| 41 | 41 | data SExpr atom |
| 42 | 42 | = SCons (SExpr atom) (SExpr atom) |
| 67 | 67 | representation using the `asRich` and `asWellFormed` |
| 68 | 68 | functions. |
| 69 | 69 | |
| 70 |
~~~~ |
|
| 70 | ~~~~.haskell | |
| 71 | 71 | *Data.SCargot.General> decode spec "(a b)" |
| 72 | 72 | Right [SCons (SAtom "a") (SCons (SAtom "b") SNil)] |
| 73 | 73 | *Data.SCargot.General> decode (asRich spec) "(a b)" |