[project @ 1997-09-03 15:33:15 by simonm]
[ghc-hetmet.git] / ghc / tests / programs / barton-mangler-bug / PlotExample.lhs
1 This file contains code that is explicitly designed to plot examples
2 from the signal modeling language.
3
4 > module PlotExample where
5
6 > import Plot
7 > import Physical
8 > import Basic
9
10 Our main task is to take a signal and a begin and start point (both
11 reals) and convert it into something that plotExam can take in the
12 Plot module.
13
14 > plotExample:: (Signal s, Physical a, Physical b) =>
15 >               String -> s a b -> Float -> Float -> IO()
16 > plotExample fl sig s e = plotExam fl s e f
17 >                    where f  = toFloatFunc f'
18 >                          f' = mapSignal sig
19
20 > toFloatFunc:: (Physical a, Physical b) => (a -> b) -> Float -> Float
21 > toFloatFunc f x = fromPhysical (f (toPhysical x))