Craft3e 0.2.0.1 → 0.2.0.2
raw patch · 4 files changed
+32/−8 lines, 4 filesdep +open-browserPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: open-browser
API changes (from Hackage documentation)
- Test: checkInverse :: String -> Bool
- Test: prop_Hufmann :: [Char] -> Property
+ PicturesSVG: invert :: Picture -> Picture
+ Test: double :: Integer -> Integer
+ Test: ex :: Integer
+ Test: pic1 :: Picture
+ Test: pic2 :: Picture
+ Test: trip :: Integer -> Integer
Files
- Craft3e.cabal +3/−2
- PicturesSVG.hs +6/−2
- Test.hs +18/−0
- refresh.html +5/−4
Craft3e.cabal view
@@ -1,6 +1,6 @@ name: Craft3e-version: 0.2.0.1+version: 0.2.0.2 license: MIT license-file: LICENSE copyright: (c) Addison Wesley@@ -42,7 +42,8 @@ old-locale == 1.0.*, time >= 1.1 && < 2.0, mtl >= 1.1 && < 2.3,- HUnit >= 1.2.0+ HUnit >= 1.2.0,+ open-browser >= 0.1.0.0 && < 0.5.0.0 exposed-modules: Chapter1
PicturesSVG.hs view
@@ -19,7 +19,9 @@ module PicturesSVG where import System.IO+import Web.Browser ( openBrowser ) + -- Pictures represened by a type of trees, so this is a deep -- embedding. @@ -86,8 +88,8 @@ flipV (Over pic1 pic2) = (flipV pic1) `Over` (flipV pic2) flipV pic = FlipV pic -negative = Negative-+negative = Negative+invert = Negative invertColour = Negative -- Convert an Image to a Picture@@ -198,6 +200,8 @@ outh <- openFile "svgOut.xml" WriteMode hPutStrLn outh newFile hClose outh+ res <- openBrowser "refresh.html"+ return () -- Preamble and postamble: boilerplate XML code.
+ Test.hs view
@@ -0,0 +1,18 @@+module Test where ++import PicturesSVG+ +ex :: Integer+ex = 3+4++double :: Integer -> Integer+double x = 2*x++trip :: Integer -> Integer+trip y = 3*y++pic1 :: Picture+pic1 = horse `beside` flipV (invert horse)++pic2 :: Picture+pic2 = pic1 `above` invert pic1
refresh.html view
@@ -1,15 +1,16 @@ <html> <head>-<meta http-equiv="refresh" content=2>+<!--<meta http-equiv="refresh" content=2>+--> </head> <body>-<h1>SVG Pictures</h1>-<p>This page will display pictures rendered by the <code>render</code>+<h1>PicturesSVG</h1>+<!--<p>This page displays pictures rendered by the <code>render</code> function from <code>PicturesSVG</code>, as in <pre> render ((horse `beside` (flipV horse)) `above` ((flipV horse) `beside` horse)) </pre>-The module should be run in the directory containing this html file.</p>+--> <iframe src="svgOut.xml" width="600" height="400">