I have a Haskell program which takes a file as an input and convert it into a binary search tree.
import System.IO data Tree a = EmptyBST | Node a (Tree a)
You can't really escape the IO monad (except through unsafe functions) but there's no actual need to do that in your case:
main = do f <- fileRead let newtree = ins 5 f putStr $ show newtree
(live demo: here)