I am a beginner in Haskell and I wanted to know if it was possible to print individual elements of a given list. I tried solving this problem but have failed. This is the code:

```
main :: IO()
main = do
    let list = [1,2,3]
    let size = length list
    let temp = print_elem list size
    print temp

print_elem :: [Int] -> Int -> Int
print_elem xs x = do
    let size = length xs
    let idx = size - x
    let element = xs !! idx
    putStr (show element)
    putStr(" ")
    let dummy = print_elem (xs (x-1))
    return " "

```

I wanted to print something like this

```
1 2 3

```

If I simply use `putStr (show list)` it will display `[1,2,3]` and I don't want that.

But when I run this code multiple errors occur

```
printelem.hs:14:5: error:
    * Couldn't match expected type `Int' with actual type `IO b0'
    * In a stmt of a 'do' block: putStr (show element)
      In the expression:
        do let size = length xs
           let idx = size - x
           let element = xs !! idx
           putStr (show element)
           ....
      In an equation for `print_elem':
          print_elem xs x
            = do let size = ...
                 let idx = ...
                 let element = ...
                 ....
   |
14 |     putStr (show element)
   |     ^^^^^^^^^^^^^^^^^^^^^

printelem.hs:16:29: error:
    * Couldn't match expected type `Int -> [Int]'
                  with actual type `[Int]'
    * The function `xs' is applied to one argument,
      but its type `[Int]' has none
      In the first argument of `print_elem', namely `(xs (x - 1))'
      In the expression: print_elem (xs (x - 1))
   |
16 |     let dummy = print_elem (xs (x-1))
   |                             ^^^^^^^^

```

How do you fix this issue?