File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,15 +152,15 @@ module NonEmptyList =
152152 /// <param name =" value " >The element to add</param >
153153 /// <param name =" list " >The list to add to</param >
154154 /// <returns >A new list with the element added to the beginning.</returns >
155- let cons e { Head = x ; Tail = xs } = { Head = e ; Tail = x:: xs }
155+ let cons value ( { Head = x ; Tail = xs } as list ) = { Head = value ; Tail = x:: xs }
156156
157157 /// <summary >Splits the list in head and tail.</summary >
158158 /// <param name =" list " >The input list.</param >
159159 /// <returns >A tuple with the head and the tail of the original list.</returns >
160160 /// <exception cref =" T:System.ArgumentException " >Thrown when the input list tail is empty.</exception >
161161 let uncons ({ Head = x ; Tail = xs } as list ) =
162162 match xs with
163- | [] -> invalidArg ( nameof( list) ) " The input sequence has an empty tail"
163+ | [] -> invalidArg ( nameof list) " The input sequence has an empty tail"
164164 | _ -> x, ofList xs
165165
166166 /// <summary >Splits the NonEmptyList in head and tail.</summary >
You can’t perform that action at this time.
0 commit comments