Created
June 12, 2018 01:47
-
-
Save gerardpaapu/0a2b13b2f06a44c47c7454af1ec87a40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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