Skip to content

Instantly share code, notes, and snippets.

@dimitris-papadimitriou-chr
Last active July 6, 2019 22:00
Show Gist options
  • Save dimitris-papadimitriou-chr/59c4c24a1c94e03f20c848a0ce5a201f to your computer and use it in GitHub Desktop.
Save dimitris-papadimitriou-chr/59c4c24a1c94e03f20c848a0ce5a201f to your computer and use it in GitHub Desktop.
Func<int, ILazyComonad<int>> CofreeAna = null;
CofreeAna = n => new LazyCofree(n + 1, new Lazy(() => new IdentiyF(CofreeAna(n + 1))));
var stream = CofreeAna(0);
var t = stream.Next().Map(x => x * 2).Next().Next().Map(x => x * 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment