git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add 'otherwise'.
commit701eb26f40e57b1f8c708ec70f3065b3cdd27314 authorPhil Freeman <paf31@cantab.net> dateFri 14 Nov 2014, 15:00 (12 years ago) parent801dedb
2 files changed+12−3
examples/passing/Guards.purs+7−2 prelude/prelude.purs+5−1
examples/passing/Guards.purs+7−2
@@ -12,7 +12,12 @@ module Main where
1212 z -> z * 3 + 1
1313
1414 min :: forall a. (Ord a) => a -> a -> a
15− min n m | n < m = n
16− | m <= n = m
15+ min n m | n < m = n
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
1722
1823 main = Debug.Trace.trace $ min "Done" "ZZZZ"
prelude/prelude.purs+5−1
@@ -1,5 +1,6 @@
11module Prelude
2− ( flip
2+ ( otherwise
3+ , flip
34 , const
45 , asTypeOf
56 , Semigroupoid, (<<<), (>>>)
@@ -23,6 +24,9 @@ module Prelude
2324 , Unit(..), unit
2425 ) where
2526
27+ otherwise :: Boolean
28+ otherwise = true
29+
2630 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
2731 flip f b a = f a b
2832