Idris2/tests/ideMode/ideMode005/LetBinders.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

28 lines
484 B
Idris

module LetBinders
private infix 1 :::
record List1 (a : Type) where
constructor (:::)
head : a
tail : List a
swap : List1 a -> List1 a
swap aas =
let (a ::: as) := aas in
let (b :: bs) = as
| [] => a ::: []
rest = a :: bs
in b ::: rest
identity : List (Nat, a) -> List (List a)
identity =
let
replicate : (n : Nat) -> a -> List a
replicate Z a = []
replicate (S n) a = a :: replicate n a
closure := uncurry replicate
in map closure