On asking questions
How to create a function that does an if check and then returns a value?
If this really were your question, this would answer it:
fun :: () -> String
fun () = if 5 > 6 then "You're nuts!" else "Obviously!"
But perhaps your title should be "Multiple increasing sequences in Haskell".
I have this piece of python code that I would like to translate to Haskell: [...]
I want to be able to create a function in Haskell that can do this.
So you want to translate some code; but what is your question? Are you asking for others to translate it, or give hints as to how to translate particular bits? Or more generally how to translate from one programming paradigm into another?
How can others enable you to create such a function in Haskell? If you're stuck at "How do I even make a function and an if-clause?", then perhaps should your question be How to get started with Haskell? Remember you clicked the "Ask Question" button, not the "Make Demands" button. ;-)
This program essentially take take from an input such as
1
5
1 2 9 6 8
where the first line is the number of test cases and the second line being the number of numbers in the specific test case, and the third line being the test case itself. It is looking for the multiple increasing sequences within the test case
This seems to be the actual question, except you don't really say what the "multiple increasing sequences" problem is. If you want help on problem solving, you have to state the problem.
On structuring your algorithm in Haskell
Without knowing exactly what your problem is, it seems that it consists of n
sub-problems parsed from standard input; each sub-problem being contained in an array of integers. So you can at least build the following two parts:
Extracting the problem via I/O:
import Control.Monad (replicateM)
-- Read a line that contains an Int.
readInt :: IO Int
readInt = undefined
-- Read a line that contains multiple Ints.
readInts :: IO [Int]
readInts = fmap (map read . words) getLine
-- Read n problems.
readProblems :: IO [[Int]]
readProblems = readInt >>= \n -> replicateM n (readInt >> readInts)
Solving a problem without I/O:
solveProblem :: [Int] -> Int
solveProblem ns = undefined
Piecing those parts together:
main :: IO ()
main = do
problems <- readProblems
forM problems (print . solveProblem)