git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge garyb's changes to the Prelude
commit980f38a24f9d0b6aee2e5e4f3098113ed3442441 authorPhil Freeman <paf31@cantab.net> dateWed 19 Feb 2014, 15:44 (13 years ago) parent4f0ea32
1 file changed+12
prelude/prelude.purs+12
prelude/prelude.purs+12
@@ -608,6 +608,11 @@ module Arrays where
608608 filter _ [] = []
609609 filter p (x:xs) | p x = x : filter p xs
610610 filter p (_:xs) = filter p xs
611+
612+ find :: forall a. (a -> Boolean) -> [a] -> Maybe a
613+ find _ [] = Nothing
614+ find p (x:xs) | p x = Just x
615+ find p (_:xs) = find p xs
611616
612617 isEmpty :: forall a. [a] -> Boolean
613618 isEmpty [] = true
@@ -1140,3 +1145,10 @@ module ST where
11401145 \ return f;\
11411146 \}" :: forall a r. (forall h. Eff (st :: ST h | r) (STArray h a)) -> Eff r [a]
11421147
1148+module Enum where
1149+
1150+ import Maybe
1151+
1152+ class Enum a where
1153+ toEnum :: Number -> Maybe a
1154+ fromEnum :: a -> Number