3 ms·
A tip about formatting: if you indent by 4 spaces, you get monospaced text that doesn't swallow single line breaks. Thus: l1 = nil l2 = cons 1 l1
by nerdponx 4y ago
A tip about formatting: if you indent by 4 spaces, you get monospaced text that doesn't swallow single line breaks.
Thus:
l1 = nil
l2 = cons 1 l1
length nil = 0
length (cons x xs) = 1 + length xs
And:
blink : Bool -> Stream Nat
head : Stream A -> A
head (blink True) = 0
head (blink False) = 1
tail : Stream A -> Stream A
tail (blink True) = blink False
tail (blink False) = blink True
- still_grokking 4y agoTwo spaces are sufficient. And with https://github.com/plibither8/refined-hacker-news https://github.com/plibither8/refined-hacker-news you get even nice gray boxes around code. Enjoy!