git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add drop and take to prelude, add Eff.Unsafe module
3f63a37Phil Freeman
prelude/prelude.purs+18
@@ -651,6 +651,16 @@ module Data.Array where
651 all _ [] = true
651 all _ [] = true
652 all p (a:as) = p a && all p as
652 all p (a:as) = p a && all p as
653
653
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+
654 instance (Prelude.Show a) => Prelude.Show [a] where
664 instance (Prelude.Show a) => Prelude.Show [a] where
655 show xs = "[" ++ joinWith (map show xs) "," ++ "]"
665 show xs = "[" ++ joinWith (map show xs) "," ++ "]"
656
666
@@ -999,6 +1009,14 @@ module Control.Monad.Eff where
999 \ };\
1009 \ };\
1000 \}" :: forall e a. [a] -> (a -> Eff e {}) -> Eff e {}
1010 \}" :: forall e a. [a] -> (a -> Eff e {}) -> Eff e {}
1001
1011
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
1002
1020
1003module Random where
1021module Random where
1004
1022