Idris2/tests/idris2/import005/Test.idr
Edwin Brady 028624a18d Add "import X as Y" properly
Instead of just the cursory name update that we used to do (which didn't
work properly anyway for a lot of reasons), now we add aliases for all
the names in the imported module.
So, like Idris 1, every global has a canonical name by which we can
refer to it, but it can also have aliases via "import ... as".
2020-07-04 20:26:49 +01:00

24 lines
518 B
Idris

module Test
export
pythag : Int -> List (Int, Int, Int)
pythag max
= [ (x,y,z) | z <- [1..max],
y <- [1..z],
x <- [1..y],
x * x + y * y == z * z ]
namespace Inside
-- Needs to be recursive (or at least refer to a name in this module)
-- to check that definitions are updated on import...as
export
fact : Nat -> Nat
fact Z = 1
fact (S k) = (S k) * fact k
public export
interface Needle a where
nardle : a -> a
noo : a -> a