git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add 'otherwise'.
701eb26Phil Freeman
examples/passing/Guards.purs+7−2
@@ -12,7 +12,12 @@ module Main where
12 z -> z * 3 + 1
12 z -> z * 3 + 1
13
13
14 min :: forall a. (Ord a) => a -> a -> a
14 min :: forall a. (Ord a) => a -> a -> a
15− min n m | n < m = n
15+ min n m | n < m = n
16− | m <= n = m
16+ | otherwise = m
17+
18+ max :: forall a. (Ord a) => a -> a -> a
19+ max n m = case unit of
20+ _ | m < n -> n
21+ | otherwise -> m
17
22
18 main = Debug.Trace.trace $ min "Done" "ZZZZ"
23 main = Debug.Trace.trace $ min "Done" "ZZZZ"
prelude/prelude.purs+5−1
@@ -1,5 +1,6 @@
1module Prelude
1module Prelude
2+ ( otherwise
2− ( flip
3+ , flip
3 , const
4 , const
4 , asTypeOf
5 , asTypeOf
5 , Semigroupoid, (<<<), (>>>)
6 , Semigroupoid, (<<<), (>>>)
@@ -23,6 +24,9 @@ module Prelude
23 , Unit(..), unit
24 , Unit(..), unit
24 ) where
25 ) where
25
26
27+ otherwise :: Boolean
28+ otherwise = true
29+
26 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
30 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
27 flip f b a = f a b
31 flip f b a = f a b
28
32