Idris2/tests/idris2/misc/lazy001/Lazy.idr
André Videla 75032a7164
Emit warning for fixities with no export modifiers (#3234)
* Emit warning for fixities with no export modifiers

This is to help update all the existing code to program with explicit
fixity export directives in preparation for the behavioral change where
they will become private by default.
2024-04-03 15:41:57 +01:00

22 lines
416 B
Idris

private infixr 5 ::
namespace List
public export
data List a = Nil | (::) a (List a)
namespace Stream
public export
data Stream a = (::) a (Inf (Stream a))
ones : Stream Integer
ones = num :: ones
where
num : Integer -- gratuitous where for a regression test!
num = 1
data Nat = Z | S Nat
take : Nat -> Stream a -> List a
take Z xs = Nil
take (S k) (x :: xs) = List.(::) x (take k xs)