-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hw3 #12
Hw3 #12
Conversation
Test/TestsHw3.fs
Outdated
[<Fact>] | ||
let MergeTest () = | ||
let expected = List.sort [] | ||
let mutable lst = MyList.fromList [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем ему быть изменяемым?
Test/TestsHw3.fs
Outdated
[<Fact>] | ||
let BubbleTest () = | ||
let expected = List.sort [] | ||
let mutable lst = MyList.fromList [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
И тут тоже.
src/LibHw3/Library.fs
Outdated
match list with | ||
| Empty -> Empty | ||
| Cons (pivot, tail) -> | ||
let less = fromList (List.filter (fun x -> compare x pivot < 0) (toList tail)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Конврттировать туда-обратно --- плохая затея. Много лишних телодвижений.
src/LibHw3/Library.fs
Outdated
match list with | ||
| Empty -> Empty | ||
| Cons (elem, tl) when func elem -> Cons (elem, filter func tl) | ||
| Cons (elem, Empty) when func elem = false -> Empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Реально надо писать прям = false
? Просто логически выражением не обойтись?
Новая ветка HW3. Исправил тип MyList и добавил новые тесты для него.