Skip to content

Instantly share code, notes, and snippets.

@gerardpaapu
Created June 12, 2018 01:47
Show Gist options
  • Save gerardpaapu/0a2b13b2f06a44c47c7454af1ec87a40 to your computer and use it in GitHub Desktop.
Save gerardpaapu/0a2b13b2f06a44c47c7454af1ec87a40 to your computer and use it in GitHub Desktop.
module Main where
import Prelude
import Control.Monad.Eff.Console (logShow)
import Data.Array ((..))
import Data.Array as A
import Data.Foldable (sum)
import TryPureScript (render, withConsole)
result :: Int
result =
(0 .. 999)
# A.filter (multipleOf 3 `or` multipleOf 5)
# sum
where
multipleOf n m = m `mod` n == 0
or f g n = f n || g n
main = render =<< withConsole do
logShow result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment