Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Split list without mutable values
let splitAt index lis = let rec loop a b ind toGo = match toGo with | [] -> (List.rev a, List.rev b) | head::tail -> if ind >= index then tail |> loop a (head::b) (ind + 1) else tail |> loop (head::a) b (ind + 1) loop [] [] 0 lis let list = [for i in 0..9 -> i] //Numbers from 0 to 9 inclusive let partA, partB = splitAt 5 list printfn "List: %A\nA: %A\nB: %A" list partA partB
run
|
edit
|
history
|
help
0
F#: Basic Immutability vs. Mutability
Musical Note Frequencies (Equal temperament)
Yet another Fibonacci
Recursion in F#
KR#2
FizzBuzz without Modulo in F#
code di ia
The wonders of F#
Average Square Error
Map.except