>
type 'a ListLazy =
| Cons of 'a * Lazy<'a ListLazy>
| Nil
module List = begin
module Lazy = begin
val single : h:'a -> 'a ListLazy
val cons : h:'a -> l:'a ListLazy -> 'a ListLazy
val head : _arg1:'a ListLazy -> 'a
val tail : _arg1:'a ListLazy -> 'a ListLazy
val iter : f:('a -> unit) -> _arg1:'a ListLazy -> unit
val map : f:('a -> 'b) -> _arg1:'a ListLazy -> 'b ListLazy
val fold : f:('a -> 'b -> 'a) -> init:'a -> _arg1:'b ListLazy -> 'a
val foldBack :
f:('a -> Lazy<'b> -> 'b) -> init:'b -> _arg1:'a ListLazy -> 'b
val unfold : f:('a -> ('b * 'a) option) -> init:'a -> 'b ListLazy
val reduce : f:('a -> 'a -> 'a) -> _arg1:'a ListLazy -> 'a
val reduceBack : f:('a -> Lazy<'a> -> 'a) -> _arg1:'a ListLazy -> 'a
val skip :
n:System.Numerics.BigInteger -> _arg1:'a ListLazy -> 'a ListLazy
val take :
n:System.Numerics.BigInteger -> _arg1:'a ListLazy -> 'a ListLazy
val append : l1:'a ListLazy -> l2:'a ListLazy -> 'a ListLazy
val concat : _arg1:'a ListLazy ListLazy -> 'a ListLazy
val ofList : _arg1:'a list -> 'a ListLazy
val toList : l:'a ListLazy -> 'a list
end
end
>
val fib : System.Numerics.BigInteger ListLazy = Cons (0,Value is not created.)
val fibSquared : System.Numerics.BigInteger ListLazy =
Cons (0,Value is not created.)
> 0 1 1 2 3 5 8 13 21 34 val it : unit = ()
> 0 1 1 4 9 25 64 169 441 1156 val it : unit = ()
Runtime errors when skipping/taking on empty sequences (F# Seq)
> 0 1 1 2 3 5 8 13 21 34 System.InvalidOperationException: The input sequence has an insufficient number of elements.
at Microsoft.FSharp.Collections.SeqModule+Take@999[System.Numerics.BigInteger].GenerateNext (IEnumerable`1& next) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.Numerics.BigInteger].MoveNextImpl () [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[System.Numerics.BigInteger].System-Collections-IEnumerator-MoveNext () [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Collections.SeqModule.Iterate[BigInteger] (Microsoft.FSharp.Core.FSharpFunc`2 action, IEnumerable`1 source) [0x00000] in <filename unknown>:0
at <StartupCode$FSI_0047>.$FSI_0047.main@ () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Stopped due to error
No runtime errors when skipping/taking on empty lists