Skip to content

Commit

Permalink
Revert "replace List.chop with List.splitAt"
Browse files Browse the repository at this point in the history
This reverts commit cde206b.

# Conflicts:
#	src/fsharp/SignatureConformance.fs
  • Loading branch information
vasily-kirichenko committed Jun 5, 2018
1 parent 4673707 commit 9e379d9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,22 @@ module List =
| [] -> None
| h::t -> if f h then Some (h,n) else findi (n+1) f t


let take n l =
if n = List.length l then l else
let rec loop acc n l =
match l with
| [] -> List.rev acc
| x::xs -> if n<=0 then List.rev acc else loop (x::acc) (n-1) xs

loop [] n l

let rec drop n l =
match l with
| [] -> []
| _::xs -> if n=0 then l else drop (n-1) xs


let splitChoose select l =
let rec ch acc1 acc2 l =
match l with
Expand Down

0 comments on commit 9e379d9

Please sign in to comment.