The wonder Halicarnassus has a special ability (second stage on side A, all stages on side B) that let's the player choose a card from the discard pile.
(Note: In this question it is discussed if the player may choose cards that get discarded in the same round (→ yes, because the special ability is used in the end of that round).)
Instead of building the card for free, can the player also choose to build the wonder (paying the corresponding costs), or to discard the card for 3 gold?