mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-20 01:41:44 +03:00
75032a7164
* 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.
28 lines
484 B
Idris
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
|