{-# LANGUAGE UndecidableInstances #-}

Ouch!

Don't worry, it's just me not liking UndecidableInstances.

So instead of passing the parameters as a list I want to pass them as
arguments:

\x p1 p2 p3 -> p1*x^2 + p2*x + p3

Why not use tuples?

\x (p1, p2, p3) -> p1 * x^2 + p2 * x + p3

Or a special list-like data type

data a :* b = ($*) a b

func :: Double -> (Double :* Double :* Double) -> Double
func x (p1 $* p2 $* p3) = p1 * x^2 + p2 * x + p3

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to