Я пытаюсь моделировать Тэйлор многочлен х^хМое Haskell функция падает на Скомпилируй
---Macularian for e^x
e :: (Num a) => a -> Int -> a
e value precsion = sum $ take precsion [((x^n)/product [1..n]) | x <- value, n <- [0..]]
Это моя ошибка
[email protected]:73-3:78 Could not deduce (a ~ [a]) from the context (Num a) bound by the type signature for e :: Num a => a -> Int -> a at /home/app/isolation-runner-work/projects/75872/session.207/src/Main.hs:2:6-29 a is a rigid type variable bound by the type signature for e :: Num a => a -> Int -> a at /home/app/isolation-runner-work/projects/75872/session.207/src/Main.hs:2:6 Relevant bindings include value :: a (bound at /home/app/isolation-runner-work/projects/75872/session.207/src/Main.hs:3:3) e :: a -> Int -> a (bound at /home/app/isolation-runner-work/projects/75872/session.207/src/Main.hs:3:1) …
Кстати, это не «крах» компилятора или вашей программы. Это просто ошибка типа. – chi