Skip to content

Instantly share code, notes, and snippets.

@jeetu7
Created April 17, 2020 10:14
Show Gist options
  • Save jeetu7/619f68c637d0d6dff972352774491a79 to your computer and use it in GitHub Desktop.
Save jeetu7/619f68c637d0d6dff972352774491a79 to your computer and use it in GitHub Desktop.
module Main
import Data.List
mySum : List Double -> Double
mySum [] = 0
mySum (x :: xs) = x + mySum xs
ms : List Double
ms = [1.0, 2.0, 3.0]
bs : List Double
bs = []
main : IO ()
main = do printLn $ sum ms
printLn $ mySum ms
printLn $ mySum bs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment