Guest User

Untitled

a guest
Feb 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. module Main where
  2.  
  3. import Prelude
  4. import Control.Monad.Eff.Console (logShow)
  5. import Control.Bind
  6. import Data.Maybe
  7. import TryPureScript
  8.  
  9. -- Find Pythagorean triples using an array comprehension.
  10. maybeSum :: Maybe Number -> Maybe Number -> Maybe Number
  11. maybeSum a b =
  12. bind a (\n ->
  13. bind b (\m ->
  14. pure (n + m)))
  15.  
  16. main = bind (withConsole (logShow (maybeSum (pure 1.0) (pure 2.0)))) render
Add Comment
Please, Sign In to add comment