summaryrefslogtreecommitdiff
path: root/testsuite/tests/programs/barton-mangler-bug/PlotExample.lhs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/programs/barton-mangler-bug/PlotExample.lhs')
-rw-r--r--testsuite/tests/programs/barton-mangler-bug/PlotExample.lhs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/programs/barton-mangler-bug/PlotExample.lhs b/testsuite/tests/programs/barton-mangler-bug/PlotExample.lhs
new file mode 100644
index 0000000000..66a13fbca7
--- /dev/null
+++ b/testsuite/tests/programs/barton-mangler-bug/PlotExample.lhs
@@ -0,0 +1,21 @@
+This file contains code that is explicitly designed to plot examples
+from the signal modeling language.
+
+> module PlotExample where
+
+> import Plot
+> import Physical
+> import Basic
+
+Our main task is to take a signal and a begin and start point (both
+reals) and convert it into something that plotExam can take in the
+Plot module.
+
+> plotExample:: (Signal s, Physical a, Physical b) =>
+> String -> [(Float, Float)] -> s a b -> Float -> Float -> String
+> plotExample fl expected sig s e = plotExam fl expected s e f
+> where f = toFloatFunc f'
+> f' = mapSignal sig
+
+> toFloatFunc:: (Physical a, Physical b) => (a -> b) -> Float -> Float
+> toFloatFunc f x = fromPhysical (f (toPhysical x))