It is impossible at all
Reverse to combine not (generally) possible.
When you have a list of static signal sizes, you can combine them into a list of static size lists. But when you go the other way, there is no guarantee that the lists in the signal are static in size. Therefore, you cannot simply create a list from it.
(If you could, then the normal value of the List type could have a variable size without showing Signal around the type, and you would dynamically create and destroy signals in the list. These are two things that prohibit Elm.)
But with some limitations ...
Of course, if you know that the list in the signal is static in size, you can write a specific function based on this assumption; this function will then fail at runtime if there is a case where your assumption of static size lists was wrong.
unsafe : Maybe a -> a unsafeHead m = case m of Just a -> a Nothing -> Debug.crash "unsafe: You're out of luck. The `Maybe` was not a `Just`. " uncombine : Int -> Signal (List a) -> List (Signal a) uncombine n sig = if n == 0 then [] else Signal.map (List.head >> unsafe) sig :: uncombine (n-1) (Signal.map (List.tail >> unsafe) sig)
(I am pretty sure this issue was discussed on the elm-discuss mailing list once, but I can no longer find it)
source share