Calculate and use a linear equation based on sets of x and y values
I'd structure your program in a slightly different way. First, instead of passing around two arrays of float, why don't you introduce a Point data structure and work with it?
It would save you from checking that you get passed two array of the same length, which looks quite neat to me.

I think you could also consider introducing a Coefficients data structure to hold your pair of slope and intercept value. If you do that it will be much clearer what your function does.

Since you eventually want to have a function you can play with, you could create a toFunction :: Coefficients -&gt; Float -&gt;Float. In this way you decouple the computation of the coefficients that best fit with your data and the construction of the corresponding curve. This enables you to play not only with the curves you fit from data but also with curves you can define from their coefficients.

I think that a nicer way to compute the value could be by putting as much math as possible in some temporary variables you define in the where block. That could allow you to separate the high level computation you need to perform with all the other smaller steps required to compute some other intermediate results you need.

If you apply the changes I suggested you should come up with code similar to the following:

type Point = (Float, Float)
type Coefficients = (Float, Float)

toFunction :: Coefficients -&gt; Float -&gt; Float
toFunction (s, i) x = s * x + i

slope :: [Point] -&gt; Float
slope [] = error "Empty list of points"
slope (_ : []) = error "Single point"
slope points = (n*sumCoorProds - (sumX*sumY))/ (n*sumSquares - (sumX*sumX))
  where
    n = fromIntegral $ length points
    (xs, ys) = unzip points
    sumCoorProds = sum $ map ( \(x, y) -&gt; x * y ) points
    sumSquares   = sum $ map ( \(x) -&gt; x * x ) xs
    sumX         = sum xs
    sumY         = sum ys

intercept :: [Point] -&gt; Float
intercept points = (sumY - (s * sumX)) / n
      where
      (xs, ys) = unzip points
      n = fromIntegral $ length points
      s = slope points
      sumX = sum xs
      sumY = sum ys

getCoefficients :: [Point] -&gt; Coefficients
getCoefficients points = (slope points, intercept points)