From 9d549ab683ba4d98a295dc156ea4b81f57f383a7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 26 Jan 2013 16:09:41 -0800 Subject: RST writer: Use `.. code:: language` for code blocks with language. Closes #721. Also fixed whitespace in lhs tests. --- tests/lhs-test-markdown.native | 2 +- tests/lhs-test.html | 4 ++-- tests/lhs-test.html+lhs | 4 ++-- tests/lhs-test.latex | 4 ++-- tests/lhs-test.latex+lhs | 4 ++-- tests/lhs-test.markdown | 4 ++-- tests/lhs-test.markdown+lhs | 4 ++-- tests/lhs-test.native | 2 +- tests/lhs-test.rst | 6 +++--- tests/lhs-test.rst+lhs | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/lhs-test-markdown.native b/tests/lhs-test-markdown.native index 28275f3eb..63037d9e3 100644 --- a/tests/lhs-test-markdown.native +++ b/tests/lhs-test-markdown.native @@ -1,6 +1,6 @@ [Header 1 ("lhs-test",[],[]) [Str "lhs",Space,Str "test"] ,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",Space,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"] -,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry \n -- arr (\\op (x,y) -> x `op` y) " +,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" ,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] ,CodeBlock ("",[],[]) "f *** g = first f >>> second g" ,Para [Str "Block",Space,Str "quote:"] diff --git a/tests/lhs-test.html b/tests/lhs-test.html index a0d05055e..9cea03a9f 100644 --- a/tests/lhs-test.html +++ b/tests/lhs-test.html @@ -30,8 +30,8 @@ code > span.er { color: #ff0000; font-weight: bold; }

lhs test

unsplit is an arrow that takes a pair of values and combines them to return a single value:

unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
-unsplit = arr . uncurry       
-          -- arr (\op (x,y) -> x `op` y) 
+unsplit = arr . uncurry + -- arr (\op (x,y) -> x `op` y)

(***) combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).

f *** g = first f >>> second g

Block quote:

diff --git a/tests/lhs-test.html+lhs b/tests/lhs-test.html+lhs index 347009c5a..9be283671 100644 --- a/tests/lhs-test.html+lhs +++ b/tests/lhs-test.html+lhs @@ -30,8 +30,8 @@ code > span.er { color: #ff0000; font-weight: bold; }

lhs test

unsplit is an arrow that takes a pair of values and combines them to return a single value:

> unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
-> unsplit = arr . uncurry       
->           -- arr (\op (x,y) -> x `op` y) 
+> unsplit = arr . uncurry +> -- arr (\op (x,y) -> x `op` y)

(***) combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).

f *** g = first f >>> second g

Block quote:

diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex index 4a37a2a67..db81e18c7 100644 --- a/tests/lhs-test.latex +++ b/tests/lhs-test.latex @@ -72,8 +72,8 @@ return a single value: \begin{Shaded} \begin{Highlighting}[] \OtherTok{unsplit ::} \NormalTok{(}\DataTypeTok{Arrow} \NormalTok{a) }\OtherTok{=>} \NormalTok{(b }\OtherTok{->} \NormalTok{c }\OtherTok{->} \NormalTok{d) }\OtherTok{->} \NormalTok{a (b, c) d} -\NormalTok{unsplit }\FunctionTok{=} \NormalTok{arr }\FunctionTok{.} \FunctionTok{uncurry} - \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y) } +\NormalTok{unsplit }\FunctionTok{=} \NormalTok{arr }\FunctionTok{.} \FunctionTok{uncurry} + \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y)} \end{Highlighting} \end{Shaded} diff --git a/tests/lhs-test.latex+lhs b/tests/lhs-test.latex+lhs index df1801bf3..80c1eb16b 100644 --- a/tests/lhs-test.latex+lhs +++ b/tests/lhs-test.latex+lhs @@ -53,8 +53,8 @@ return a single value: \begin{code} unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) +unsplit = arr . uncurry + -- arr (\op (x,y) -> x `op` y) \end{code} \texttt{(***)} combines two arrows into a new arrow by running the two arrows diff --git a/tests/lhs-test.markdown b/tests/lhs-test.markdown index 261021bb7..47ec920d3 100644 --- a/tests/lhs-test.markdown +++ b/tests/lhs-test.markdown @@ -6,8 +6,8 @@ a single value: ~~~~ {.sourceCode .literate .haskell} unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) +unsplit = arr . uncurry + -- arr (\op (x,y) -> x `op` y) ~~~~ `(***)` combines two arrows into a new arrow by running the two arrows on a diff --git a/tests/lhs-test.markdown+lhs b/tests/lhs-test.markdown+lhs index e6f0088c5..41dfba912 100644 --- a/tests/lhs-test.markdown+lhs +++ b/tests/lhs-test.markdown+lhs @@ -5,8 +5,8 @@ lhs test a single value: > unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -> unsplit = arr . uncurry -> -- arr (\op (x,y) -> x `op` y) +> unsplit = arr . uncurry +> -- arr (\op (x,y) -> x `op` y) `(***)` combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the diff --git a/tests/lhs-test.native b/tests/lhs-test.native index dc6c0588e..3a22d1f8a 100644 --- a/tests/lhs-test.native +++ b/tests/lhs-test.native @@ -1,6 +1,6 @@ [Header 1 ("",[],[]) [Str "lhs",Space,Str "test"] ,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",Space,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"] -,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry \n -- arr (\\op (x,y) -> x `op` y) " +,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" ,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] ,CodeBlock ("",[],[]) "f *** g = first f >>> second g" ,Para [Str "Block",Space,Str "quote:"] diff --git a/tests/lhs-test.rst b/tests/lhs-test.rst index 37ad099af..3de2d9ff6 100644 --- a/tests/lhs-test.rst +++ b/tests/lhs-test.rst @@ -4,11 +4,11 @@ lhs test ``unsplit`` is an arrow that takes a pair of values and combines them to return a single value: -:: +.. code:: haskell unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d - unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) + unsplit = arr . uncurry + -- arr (\op (x,y) -> x `op` y) ``(***)`` combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the diff --git a/tests/lhs-test.rst+lhs b/tests/lhs-test.rst+lhs index 6b6ffb860..eec79c546 100644 --- a/tests/lhs-test.rst+lhs +++ b/tests/lhs-test.rst+lhs @@ -5,8 +5,8 @@ lhs test return a single value: > unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -> unsplit = arr . uncurry -> -- arr (\op (x,y) -> x `op` y) +> unsplit = arr . uncurry +> -- arr (\op (x,y) -> x `op` y) ``(***)`` combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the -- cgit v1.2.3