-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmodule_to_import.p
More file actions
36 lines (29 loc) · 859 Bytes
/
module_to_import.p
File metadata and controls
36 lines (29 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* vim: ft=plasma
* This is free and unencumbered software released into the public domain.
* See ../LICENSE.unlicense
*/
// The filename is module_example, note that they don't have to match by case
// or underscores.
module ModuleToImport
// Resources may be exported
export
resource MyRes from IO
// Types may be exported (the constructors and fields are exported too)
export
type MyMaybe('x) = Nothing
| Some(x : 'x)
// Or opaque-exported (the constructors and fields are not exported)
export opaque
type Tree('k, 'v) = Empty
| Node(
k : 'k,
v : 'v,
l : Tree('k, 'v),
r : Tree('k, 'v)
)
// Functions may be exported.
export
func test() uses IO {
print!("Hello from ModuleToImport\n")
}