Yes, now there is an app for that. Apple has been over protective of the iPhone and particularly bluetooth isn’t of much use except for AD2P audio or the games / apps that use it. However, now BTstack Keyboard is live on cydia costing $5 for this amazing feel of typing on your iPhone using a bluetooth keyboard. Engadget did a video with this, and it works well for almost everything ranging from Text messages to Safari.
Given the powerhouse that iPhone is with the amazing app store apps, I might well try docking an iPhone on my desk instead of a laptop someday.