git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add drop and take to prelude, add Eff.Unsafe module
commit3f63a371360ff914b210e41520a36ff2900eb6a3 authorPhil Freeman <paf31@cantab.net> dateThu 27 Feb 2014, 14:30 (13 years ago) parent695ab61
1 file changed+18
prelude/prelude.purs+18
prelude/prelude.purs+18
@@ -651,6 +651,16 @@ module Data.Array where
651651 all _ [] = true
652652 all p (a:as) = p a && all p as
653653
654+ drop :: forall a. Number -> [a] -> [a]
655+ drop 0 xs = xs
656+ drop _ [] = []
657+ drop n (x:xs) = drop (n - 1) xs
658+
659+ take :: forall a. Number -> [a] -> [a]
660+ take 0 _ = []
661+ take _ [] = []
662+ take n (x:xs) = x : take (n - 1) xs
663+
654664 instance (Prelude.Show a) => Prelude.Show [a] where
655665 show xs = "[" ++ joinWith (map show xs) "," ++ "]"
656666
@@ -999,6 +1009,14 @@ module Control.Monad.Eff where
9991009 \ };\
10001010 \}" :: forall e a. [a] -> (a -> Eff e {}) -> Eff e {}
10011011
1012+module Control.Monad.Eff.Unsafe where
1013+
1014+ import Control.Monad.Eff
1015+
1016+ foreign import unsafeInterleaveEff
1017+ "function unsafeInterleaveEff(f) {\
1018+ \ return f;\
1019+ \}" :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a
10021020
10031021module Random where
10041022