f :: String -> Bool -> D
f s b = (if b then A else B) (read s)
Name:
Anonymous2011-12-13 1:47
f s b = if b then A (read s) else B (read s)
But I see your point, creating a function with two types like that would be nice. Maybe it can be made to work with type families.