module Chapter06 where
import Chapter02 (stdGravityMPS2)
type R = Double
yRock :: R -> R -> R
yRock :: R -> R -> R
yRock R
v0 R
t = R
0.5 forall a. Num a => a -> a -> a
* (-R
stdGravityMPS2) forall a. Num a => a -> a -> a
* R
t forall a. Floating a => a -> a -> a
** R
2 forall a. Num a => a -> a -> a
+ R
v0 forall a. Num a => a -> a -> a
* R
t
vRock :: R -> R -> R
vRock :: R -> R -> R
vRock R
v0 R
t = R
v0 forall a. Num a => a -> a -> a
- R
stdGravityMPS2 forall a. Num a => a -> a -> a
* R
t
greaterThanOrEq7' :: Int -> Bool
greaterThanOrEq7' :: Int -> Bool
greaterThanOrEq7' Int
n = Int
n forall a. Ord a => a -> a -> Bool
>= Int
7
isLongerThan :: Int -> String -> Bool
isLongerThan :: Int -> String -> Bool
isLongerThan Int
n String
s = forall (t :: * -> *) a. Foldable t => t a -> Int
length String
s forall a. Ord a => a -> a -> Bool
> Int
n
hasMoreThan6Elements :: [a] -> Bool
hasMoreThan6Elements :: forall a. [a] -> Bool
hasMoreThan6Elements [a]
as = forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
as forall a. Ord a => a -> a -> Bool
> Int
6
first1000Squares :: [Integer]
first1000Squares :: [Integer]
first1000Squares = [Integer
n forall a b. (Num a, Integral b) => a -> b -> a
^ Integer
2 | Integer
n <- [Integer
0 .. Integer
999]]
repeat' :: a -> [a]
repeat' :: forall a. a -> [a]
repeat' = forall a. (a -> a) -> a -> [a]
iterate forall a. a -> a
id
replicate' :: Int -> a -> [a]
replicate' :: forall a. Int -> a -> [a]
replicate' Int
n a
a = forall a. Int -> [a] -> [a]
take Int
n forall a b. (a -> b) -> a -> b
$ forall a. a -> [a]
repeat a
a