summaryrefslogtreecommitdiff
path: root/examples/passing/TopLevelCase.purs
blob: a0ade1baafb1b70d2bb5f1d864b9264f50fdd9cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Main where

foreign import jsMod
  """
  function jsMod(x) {
    return function (y) {
      return x % y;
    };
  }
  """ :: Number -> Number -> Number

infixl 7 %
(%) = jsMod

gcd :: Number -> Number -> Number
gcd 0 x = x
gcd x 0 = x
gcd x y | x > y = gcd (x % y) y
gcd x y = gcd (y % x) x

guardsTest (x:xs) | x > 0 = guardsTest xs
guardsTest xs = xs

data A = A

parseTest A 0 = 0

main = Debug.Trace.trace "Done"