(html (head (title "sph-lib (sph lang parser type-signature)") (link (@ (rel "stylesheet") (type "text/css") (href "/css/sph.css"))) (meta (@ (name "viewport") (content "width=device-width,initial-scale=1"))) #f) (body () (div (@ (class top)) (nav (a (@ (href "/")) "start") ", " (a (@ (href "/feed.xml")) "feed")) "") (div (@ (class "middle")) (div (@ (class mtime) (title "last modification time of the current page")) "2023-04-05") (section (h1 "(sph lang parser type-signature)") (div (p "a parser and writer for a type signature notation.") (p "part of " (a (@ (href "../../sph-lib.html")) "sph-lib")) ((section (@ (class "library-description")) (h1 "library description") (div (p "input/output") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "expressions separated by: \"->\"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: input -> output")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: input ->")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "output arguments are optional. if left-out the output is unspecified")) (p "multiple arguments") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "expressions separated by a space character: \" \"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a b c -> d")) (p "alternative data-types") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "expressions separated by a slash: \"/\"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a b/c/d -> e")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a port/string/integer -> e")) (p "alternative names") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "expressions separated by a colon: \":\"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a b:c:d -> e")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "data-types always come first")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "data-type:helpful-alternative-name:another-alternative-name")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a port:input-port:source -> e")) (p "optional arguments") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "enclosed with square brackets: []")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a [b c] ->\td")) (p "repetition") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "none or many consecutive occurences of an expression")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "expression followed by a space character and three dots: \" ...\"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: a b ... c ... -> d")) (p "function-name specification") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "identifier followed by a space character and two colons: \" ::\"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: name :: a b -> c")) (p "procedures, dictionaries") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "a function signature enclosed with curly brackets: \"{\" \"}\"")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "unlimited nesting")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: {a ->}")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example with data-type: procedure:{a ... -> list:b}")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example: hashtable:{key -> value}")) (p "lists, vectors, pairs, and more") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "using scheme read syntax")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example list: (a (b c))")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example vector: #(a #(b c))")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example using both: (integer #(char ...))")) (p "multiline signatures") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "two colons followed by a newline, optionally followed by one or multiple")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "input expressions per line separated by newlines, a line with only a \"->\",")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "optionally followed by output expression separated by newlines,")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "ending with end-of-string or two successive newline characters")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "example")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp")) "::")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp")) "a")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp")) "b")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp")) "->")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp")) "c")) (p " ") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp") (*ENTITY* "nbsp")) "line outside of signature")) (p "examples") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "list any [symbol:exclusive/inclusive] -> (list:left list:right)")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "procedure:{any -> boolean} procedure:{list:matched-elements -> list:replacements} list:source -> list")) (p "multiline example") (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "::")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "procedure:{alist:header procedure:fold-lines:{string:line any:result procedure:next:{any:result -> any} -> any} result -> any}")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "procedure:{header port result ->} any port [string]")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "->")) (p (((*ENTITY* "nbsp") (*ENTITY* "nbsp")) "any")))) (section (@ (class "library-name")) (h1 "module name") (p "(sph lang parser type-signature)")) (section (@ (class "library-exports")) (h1 "exported bindings") (div (div (@ (class "doc-bindings")) (div (@ (id "doc-b-" "parsed-type-signature->string") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "parsed-type-signature->string") " " (span (@ (class "first-sig")) "a [line-prefix] ->")) (div (@ (class "rest-sig")) (div "list [string] -> string")) (div (@ (class "description")) (("\\\"line-prefix\\\" could be indent space")))) (div (@ (id "doc-b-" "peg-type-signature") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "peg-type-signature") " " (span (@ (class "first-sig")) "str strlen at ->")) "" "") (div (@ (id "doc-b-" "string->parsed-type-signature") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "string->parsed-type-signature") " " (span (@ (class "first-sig")) "a ->")) (div (@ (class "rest-sig")) (div "string -> list/boolean")) "") (div (@ (id "doc-b-" "type-signature-simplify-tree") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "type-signature-simplify-tree") " " (span (@ (class "first-sig")) "a ->")) "" (div (@ (class "description")) (("this simplify a few cases like over-nested elements and no-arguments"))))))))))) ()))