bff 0.2 → 0.3
raw patch · 5 files changed
+42/−38 lines, 5 filesdep +colourdep +data-accessordep ~Chartdep ~basedep ~hintnew-uploader
Dependencies added: colour, data-accessor
Dependency ranges changed: Chart, base, hint
Files
- Data/Zippable.hs +1/−1
- Data/Zippable/Definition.hs +1/−1
- MyInterpret.hs +9/−6
- StatsRender.hs +26/−25
- bff.cabal +5/−5
Data/Zippable.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -XTemplateHaskell -XFlexibleInstances -XFlexibleContexts -fallow-undecidable-instances #-}+{-# LANGUAGE TemplateHaskell, FlexibleInstances, FlexibleContexts, UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Zippable
Data/Zippable/Definition.hs view
@@ -47,7 +47,7 @@ -- | Zip the elements of two structures with the given CError computation. --- -- @'tryZipWith'' func x y = either 'throwCError' (Data.Traversable.mapM (uncurry func)) ('tryZip' x y)+ -- @'tryZipWith'' func x y = either 'throwCError' (Data.Traversable.mapM (uncurry func)) ('tryZip' x y)@ tryZipWith' ::(a -> b -> CError c) -> k a -> k b -> CError (k c) tryZipWith' func x y = either throwCError (Data.Traversable.mapM (uncurry func)) (tryZip x y)
MyInterpret.hs view
@@ -7,8 +7,7 @@ ) where --- import Mueval.Resources-import Language.Haskell.Interpreter.GHC+import Language.Haskell.Interpreter import Language.Haskell.Interpreter.GHC.Unsafe import Prelude hiding (catch)@@ -67,10 +66,10 @@ myInterpreter todo exp = timeoutIO $ do when (unsafe exp) $ throwDyn (MyException "Indicators for unsafe computations found in exp") - session <- newSession- withSession session $ do+ eResult <- runInterpreter $ do setUseLanguageExtensions False- setOptimizations All+ -- Not available in hint-3.2?+ -- setOptimizations All reset -- no need for temporary files I hope@@ -78,10 +77,14 @@ unsafeSetGhcOption "-fno-monomorphism-restriction" - -- liftIO $ Mueval.Resources.limitResources True setImports modules + liftIO $ putStrLn exp todo exp+ + case eResult of+ Left exception -> throw exception+ Right result -> return result formatInterpreterError (UnknownError s) = "Unknown Interpreter Error " ++ s formatInterpreterError (WontCompile es) = "Could not compile code:\n" ++ unlines (map errMsg es)
StatsRender.hs view
@@ -3,6 +3,9 @@ #-} import Graphics.Rendering.Chart+import Data.Accessor.Basic+import Data.Colour+ import System.IO import Data.List import StatsDef@@ -10,33 +13,31 @@ putGraph name statData filename = renderableToPDFFile r 600 400 filename where r = toRenderable $- defaultLayout1- { layout1_title = "Measurements \"" ++ name ++"\""- , layout1_plots = [- ("manual (put)", HA_Bottom, VA_Left,- toPlot $ defaultPlotLines - { plot_lines_values = [manualData]- , plot_lines_style = dashedLine 1 [4,4] (Color 0 0 0)- }- ),- ("automatic (bff get)", HA_Bottom, VA_Left,- toPlot $ defaultPlotLines - { plot_lines_values = [automaticData]- , plot_lines_style = solidLine 1 (Color 0 0 0)- }- )+ compose [+ set layout1_title $ "Measurements \"" ++ name ++"\""+ , set layout1_plots [ + Left $ toPlot $ compose [+ set plot_lines_title "manual (put)"+ , set plot_lines_style $ dashedLine 1 [4,4] (opaque black)+ , set plot_lines_values [manualData]+ ] defaultPlotLines ,+ Left $ toPlot $ compose [+ set plot_lines_title "automatic (bff get)"+ , set plot_lines_style $ solidLine 1 (opaque black)+ , set plot_lines_values [automaticData]+ ] defaultPlotLines ]- , layout1_vertical_axes = - linkedAxes' (autoScaledAxis (defaultAxis {axis_title =- "Average time per run in ms"- }))- , layout1_horizontal_axes = - linkedAxes' (autoScaledAxis (defaultAxis {axis_title =- "Size of original source"- }))- }+ , set layout1_left_axis $ compose [+ set laxis_title "Average time per run in ms",+ set laxis_generate (autoScaledAxis defaultLinearAxis)+ ] defaultLayoutAxis+ , set layout1_bottom_axis $ compose [+ set laxis_title "Size of original source",+ set laxis_generate (autoScaledAxis defaultLinearAxis)+ ] defaultLayoutAxis+ ] defaultLayout1 (manualData, automaticData) = unzip $ map f statData- f (s, m, a) = (Point (fromIntegral s) m, Point (fromIntegral s) a)+ f (s, m, a) = ((fromIntegral s, m), (fromIntegral s, a)) printTest :: String -> StatRunData -> IO () printTest name statData = do
bff.cabal view
@@ -1,5 +1,5 @@ name: bff-version: 0.2+version: 0.3 license: PublicDomain description: This is an implementation of the ideas presented in "Bidirectionalization@@ -55,7 +55,7 @@ Data.Derive.Zippable Data.Zippable.Definition build-depends:- base, containers, mtl, template-haskell, category-extras >= 0.53.5, derive >= 0.1.1,+ base >= 2 && < 4, containers, mtl, template-haskell, category-extras >= 0.53.5, derive >= 0.1.1, haskell98, bimap >= 0.2.3, unix executable bff-shell@@ -65,7 +65,7 @@ MyInterpret if flag(binaries) build-depends:- base, directory, hint+ base >= 2 && < 4, directory, hint >= 0.3.2 buildable: True else buildable: False@@ -77,7 +77,7 @@ MyInterpret if flag(binaries) build-depends:- base, directory, xhtml, cgi, hint, utf8-string+ base >= 2 && < 4, directory, xhtml, cgi, hint >= 0.3.2, utf8-string buildable: True else buildable: False@@ -112,6 +112,6 @@ if flag(render) buildable: True build-depends:- Chart >= 0.8+ Chart >= 0.12, data-accessor, colour else buildable: False