# Flattening the output of Solve[]

I want to flatten the output of solve into a an un-nested list. For instance,

Solve[y[x] == x^2 + c, c]


yields

{{c -> -x^2 + y[x]}}


which I may reduce using Flatten[] to

eq=Flatten[%]
{c -> -x^2 + y[x]}


However, this is still not a list.

If I call List@@ on it, I get

List @@ Flatten[eq]
{c -> -x^2 + y[x]}


So the solution is not fully flattened.

Currently, I have to do

List @@ Flatten[eq][[1]]
{c, -x^2 + y[x]}


Ultimately I would like to be able to directly take answers from Solve and use functions like List @@ and Equals @@ on them to reassign the -> operator, rather than the programmatic way I currently do it which is using list references.

Is there a more elegant way to swap the [rule] operator for the Equal == or other operators?

edit:

Apply[#,1] or @@@ works, but is somewhat kludgy, as it does not fully flatten the list. For instance:

List @@@ Flatten[eq]
{{c, -x^2 + y[x]}}


My expected result either a list of depth 1 - in the case of flattening into one list, eg

{c, -x^2 + y[x]}


or in the case of using Equal or another assignment

c == -x + y[x]

• Like Equal @@@ Flatten[{{c -> -x^2 + y[x]}}]? – Kuba Sep 6 '16 at 13:36
• It is Apply[#, {1}] so almost the second :) – Kuba Sep 6 '16 at 13:39
• Isn't my first comment giving you the final solution? – Kuba Sep 6 '16 at 13:41
• Use First but what if there are two solutions? and please include an exact expected result in the question., – Kuba Sep 6 '16 at 13:50
• General approach: Or @@ And @@@ Solve[y[x] == x^2 + c^2 && b^2 == c, {b, c}] /. Rule -> Equal. Your List answer relies on the equation having exactly one solution; a general approach substituting Rule -> List can't work on it, but a specialized one could, such as Flatten[eq /. Rule -> List]. – Michael E2 Sep 6 '16 at 14:02