This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on the article 'Combinators for logic programming' by Michael Spivey and Silvija Seres. | |
let rec inf_seq n = seq { yield n; yield! inf_seq (n+1) } | |
let rec lzw f l1 l2 = | |
LazyList.delayed ( fun () -> | |
match l1,l2 with | |
|LazyList.Nil, _ -> l2 | |
|_, LazyList.Nil -> l1 | |
|LazyList.Cons(p1,tail1),LazyList.Cons(p2,tail2) |
NewerOlder