Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //module a
- //let four = 2 + 2
- //
- //6 / 5
- //
- //true || false
- //
- //2 + 2 = 4
- //
- //333333333333333333333333333333333333333333333333333I
- //
- //6. / 5.
- //
- //let v = 7 + 5
- //
- //9 - v
- //
- //max 1 2
- //
- //(2 - 2) - 2
- //
- //min 99 (min (min 5 1) (min 1 2))
- let rec fac n = if n = 0 then 1 else n * fac (n - 1)
- fac 4
- let square x = x * x
- square 4
- //let square (x:float) = x*x
- let add x y = x + y
- 1 |>add<| 2
- let a = [1;3;4]
- let k = [1;2] @ [3;5]
- 1::[2;3;4]
- 1::2::3::4::[]
- [100..2..200]
- let mix = [3;3;4;6]
- List.nth mix 3
- List.head []
- List.head [1]
- List.tail [1]
- let isEmpty x = x = []
- let rec len xs =
- match xs with
- |[] -> 0
- |y::ys -> 1 + len ys
- len [5..10]
- Seq.take 4 [1..10]
- Seq.take 5 (Seq.initInfinite (fon -> i + 1))
- let rec get n list = if n = 0 then List.head list
- else get (n - 1) (List.tail list)
- let rec elem el list =
- match list with
- |[] -> false
- |x::xs -> if el = x then true else elem el xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement