Haskell Programming Assignment, "Couldn't match expected type ‘Int’ with actual type ‘[a0] -> Int’ "and a few more Errors | بلاگ Int’ "and a few more Errors,back soft"/> Int’ "and a few more Errors"/>

Haskell Programming Assignment, "Couldn't match expected type ‘Int’ with actual type ‘[a0] -> Int’ "and a few more Errors

تعرفه تبلیغات در سایت

آخرین مطالب

امکانات وب

Vote count: 0

The assignment i have: A function numOccurences that takes a value and a list, returning the number of times that value appears in the list. I am learning haskell and am getting frustrated, this is my code for this

numOccurences:: b ->[a] -> Int
numOccurences n [ls]
  |([ls] !! n==True) =  (numOccurences(n (tail [ls])))+1
  |otherwise = 0

The Errors i am getting are as followed: https://imgur.com/a/0lTBn

Please help? The assignment is due on the 16th of April, 2018

asked 2 mins ago
Alexandria Brelsford

...
نویسنده : استخدام کار بازدید : 10 تاريخ : شنبه 25 فروردين 1397 ساعت: 8:41