Skip to content

Instantly share code, notes, and snippets.

@Oipo
Last active July 6, 2017 21:45
Show Gist options
  • Save Oipo/136654b301e066d5c75e2e8a04b2823e to your computer and use it in GitHub Desktop.
Save Oipo/136654b301e066d5c75e2e8a04b2823e to your computer and use it in GitHub Desktop.
average xs = div (fromInteger (sum xs)) (fromInteger (length xs))
Couldn't match expected type ‘Integer’ with actual type ‘Int’
In the first argument of ‘fromInteger’, namely ‘(length xs)’
In the second argument of ‘div’, namely ‘(fromInteger (length xs))’
Failed, modules loaded: none.
average xs = div (fromInteger (sum xs)) ((length xs))
Couldn't match expected type ‘Float’ with actual type ‘Int’
In the second argument of ‘div’, namely ‘((length xs))’
In the expression: div (fromInteger (sum xs)) ((length xs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment