How to get a constructor as a function from the (G)ADT argument in Haskell? Is it possible to do something like this?
data Ex1 = C1 Int | C2 Int -- | .....
| C3
fun :: Ex1 -> Ex1
fun C3 = C3
fun (c i) = c $ i^2
It is not appropriate for me to.
fun (C1 i) = C1 $ i^2
fun (C2 i) = C2 $ i^2