I am trying to make a column of random numbers changing every second, but I get different error messages:
import Random
main = flow down
[ asText (Random.range 0 100 (every second))
, asText (Random.range 0 100 (every second))
]
gives a parse error. What is wrong with my square bracket [
?
Parse error at (line 5, column 1):
unexpected '['
expecting newline, spaces or end of input
Indent Maybe?
Once I indent, the example does compile but I just get <signal>
instead of the actual number
main = flow down
[ asText (Random.range 0 100 (every second))
, asText (Random.range 0 100 (every second))
]
lift
for signals?
Finally when I tried to use lift
it gives me other confusion
main = flow down
[ lift asText (Random.range 0 100 (every second))
, lift asText (Random.range 0 100 (every second))
]
The error message is that I have the wrong type for lift
.
Type error on line 5, column 5 to 9:
lift
Expected Type: Signal Element
Actual Type: Element
No flow down
just a list
If I forget flow down it still doesn't cooperate:
main = lift asText
[ (Random.range 0 100 (every second))
, (Random.range 0 100 (every second))
]
I get an error message that _List
was expected:
Type error between lines 5 and 7:
[Random.range 0 100 (every second),
Random.range 0 100 (every second)]
Expected Type: _List
Actual Type: Signal
?
Am I using Random.range
correctly? I have not changed it from the original example:
How do I get it to cooprate with lift
and flow down
?