I am working with a Haskell libraby that discribes digital circuits (Lava), its function inputs and outputs are of the type signal ( Signal Bool , Signal Int) , as far as i know there is not a function that converts from a Signal Int to Int, I know there are several arithmetic operations that we can use with the type Signal Int, but not all arithmetic operations are possible. I wrote this function that is suppose to convert from Signal Int to Int ( just for the values that I need).
signalInt2int :: Signal Int -> Int
signalInt2int x = case x of
0 -> 0
1 -> 1
15 -> 15
_ -> 1000
Just for trying I only wrote these 4 possibilities, the problem is whenever I call this function no matter what the input is, the output is always 1000. I make sure to use an input of the type Signal Int. Here is what I get.
Can anyone point out where the problem is? I will be grateful for your help.