Commit 1a8926a5 authored by Kai-Oliver Prott's avatar Kai-Oliver Prott
Browse files

Revert splitting of Prelude

parent 5cbfd658
module Control.Applicative where
infixl 4 <*>, <*, *>
--- Typeclass for Applicative-Functors
class Functor f => Applicative f where
pure :: a -> f a
(<*>) :: f (a -> b) -> f a -> f b
(*>) :: f a -> f b -> f b
m *> n = (id <$ m) <*> n
(<*) :: f a -> f b -> f a
(<*) = liftA2 const
liftA2 :: (a -> b -> c) -> f a -> f b -> f c
liftA2 f x = (<*>) (fmap f x)
instance Applicative Maybe where
pure = Just
Just f <*> Just a = Just (f a)
Nothing <*> Just _ = Nothing
Just _ <*> Nothing = Nothing
Nothing <*> Nothing = Nothing
module Control.Applicative
(Applicative(..), liftA, liftA3) where
--- Lift a function to actions.
--- This function may be used as a value for `fmap` in a `Functor` instance.
......
......@@ -6,6 +6,10 @@ newtype Identity a = Identity { runIdentity :: a }
instance Functor Identity where
fmap f (Identity a) = Identity $ f a
instance Applicative Identity where
pure = Identity
Identity f <*> Identity a = Identity (f a)
instance Monad Identity where
m >>= k = k (runIdentity m)
return a = Identity a
......@@ -28,11 +28,11 @@ SetFunctions
Sort
Syystem.Console.ANSI.Codes
System.Directory
System.Environment (wegen Data.Global muss es raus)
System.Environment (wegen Abhängigkeit von Data.Global muss es raus)
System.FilePath
System.Process
System.Random
Test.*
Text.Show (Der Großteil ist noch dabei)
Text.Show (Der Großteil ist noch dabei in der Prelude)
Traversal
ValueSequence
This diff is collapsed.
......@@ -17,31 +17,31 @@
<library>prim_standard</library>
<entry>prim_applyGroundNormalForm[raw]</entry>
</primitive>
<primitive name="prim_Int_plus" arity="2">
<primitive name="prim_plusInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_plus</entry>
</primitive>
<primitive name="prim_Int_minus" arity="2">
<primitive name="prim_minusInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_minus</entry>
</primitive>
<primitive name="prim_Int_times" arity="2">
<primitive name="prim_timesInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_times</entry>
</primitive>
<primitive name="prim_Int_div" arity="2">
<primitive name="prim_divInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_div</entry>
</primitive>
<primitive name="prim_Int_mod" arity="2">
<primitive name="prim_modInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_mod</entry>
</primitive>
<primitive name="prim_Int_quot" arity="2">
<primitive name="prim_quotInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_quot</entry>
</primitive>
<primitive name="prim_Int_rem" arity="2">
<primitive name="prim_remInt" arity="2">
<library>prim_standard</library>
<entry>prim_Int_rem</entry>
</primitive>
......@@ -195,24 +195,92 @@
<entry>prim_leqNumber</entry>
</primitive>
<primitive name="prim_Float_plus" arity="2">
<primitive name="prim_plusFloat" arity="2">
<library>prim_float</library>
<entry>prim_Float_plus</entry>
</primitive>
<primitive name="prim_Float_minus" arity="2">
<primitive name="prim_minusFloat" arity="2">
<library>prim_float</library>
<entry>prim_Float_minus</entry>
</primitive>
<primitive name="prim_Float_times" arity="2">
<primitive name="prim_timesFloat" arity="2">
<library>prim_float</library>
<entry>prim_Float_times</entry>
</primitive>
<primitive name="prim_Float_div" arity="2">
<primitive name="prim_divFloat" arity="2">
<library>prim_float</library>
<entry>prim_Float_div</entry>
</primitive>
<primitive name="prim_i2f" arity="1">
<primitive name="prim_intToFloat" arity="1">
<library>prim_float</library>
<entry>prim_i2f</entry>
</primitive>
<primitive name="prim_logFloat" arity="1">
<library>prim_float</library>
<entry>prim_log</entry>
</primitive>
<primitive name="prim_expFloat" arity="1">
<library>prim_float</library>
<entry>prim_exp</entry>
</primitive>
<primitive name="prim_sqrtFloat" arity="1">
<library>prim_float</library>
<entry>prim_sqrt</entry>
</primitive>
<primitive name="prim_sinFloat" arity="1">
<library>prim_float</library>
<entry>prim_sin</entry>
</primitive>
<primitive name="prim_cosFloat" arity="1">
<library>prim_float</library>
<entry>prim_cos</entry>
</primitive>
<primitive name="prim_tanFloat" arity="1">
<library>prim_float</library>
<entry>prim_tan</entry>
</primitive>
<primitive name="prim_asinFloat" arity="1">
<library>prim_float</library>
<entry>prim_asin</entry>
</primitive>
<primitive name="prim_acosFloat" arity="1">
<library>prim_float</library>
<entry>prim_acos</entry>
</primitive>
<primitive name="prim_atanFloat" arity="1">
<library>prim_float</library>
<entry>prim_atan</entry>
</primitive>
<primitive name="prim_sinhFloat" arity="1">
<library>prim_float</library>
<entry>prim_sinh</entry>
</primitive>
<primitive name="prim_coshFloat" arity="1">
<library>prim_float</library>
<entry>prim_cosh</entry>
</primitive>
<primitive name="prim_tanhFloat" arity="1">
<library>prim_float</library>
<entry>prim_tanh</entry>
</primitive>
<primitive name="prim_asinhFloat" arity="1">
<library>prim_float</library>
<entry>prim_asinh</entry>
</primitive>
<primitive name="prim_acoshFloat" arity="1">
<library>prim_float</library>
<entry>prim_acosh</entry>
</primitive>
<primitive name="prim_atanhFloat" arity="1">
<library>prim_float</library>
<entry>prim_atanh</entry>
</primitive>
<primitive name="prim_truncateFloat" arity="1">
<library>prim_float</library>
<entry>prim_truncate</entry>
</primitive>
<primitive name="prim_roundFloat" arity="1">
<library>prim_float</library>
<entry>prim_round</entry>
</primitive>
</primitives>
......@@ -211,7 +211,7 @@ prim_hPutChar external
--- Puts a string to an output handle.
hPutStr :: Handle -> String -> IO ()
hPutStr _ [] = done
hPutStr _ [] = return ()
hPutStr h (c:cs) = hPutChar h c >> hPutStr h cs
--- Puts a string with a newline to an output handle.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment