https://github.com/Helium4Haskell/lvm
Raw File
Tip revision: a516e95b66e989f1364567e9b4f3292266659d08 authored by Hage, J. (J) on 24 August 2019, 08:00:47 UTC
Getting rid of pesky compile time warnings
Tip revision: a516e95
math.core
----------------------------------------------------------------
-- Daan Leijen (c) 2001
--
-- $Revision$
-- $Author$
-- $Date$
----------------------------------------------------------------
module Math where

import LvmLang
import Prelude

main
  = sum (map square (fromTo 1 100))

square :: Int -> Int
square x
  = (*) x x

sum :: [Int] -> Int
sum xs
  = foldlStrict (+) 0 xs
back to top