Changes between Version 2 and Version 3 of Language
- Timestamp:
- 06/24/09 07:52:04 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Language
v2 v3 1 1 2 2 == Modules == 3 Modules start with an optional module identifier, followed by a list of export and import declarations. Export declarations must come before import declarations. 3 4 4 Modules start with an optional module identifier, followed by a list of export and import declarations. Export declarations must come before import declarations. 5 {{{ 6 Module 7 ::= module ModuleId where ModuleBody 8 | ModuleBody 9 }}} 5 10 6 [[br]] 7 8 module 9 = '''module''' moduleId '''where''' moduleBody [[br]] 10 | moduleBody 11 [[br]] 11 {{{ 12 ModuleBody 13 ::= { exportDecl;* importDecl;* topDecl;+ } 14 }}} 12 15 13 16 14 moduleBody 15 = '''{''' {exportDecl;}* {importDecl;}* {topDecl;}+ '''}''' 16 [[br]] 17 === Exports === 18 When there is an explicit export list, only those identifiers mentioned are exported from the module. If there is no export list then all identifiers are implicitly exported. 19 20 {{{ 21 ExportDecl 22 ::= export Var 23 | export type Con 24 }}} 17 25 18 26 19 exportDecl 20 = '''export''' var [[br]] 21 | '''export''' '''type''' con 22 [[br]] 27 === Imports === 28 Foreign imports define the type of an external symbol. 29 30 {{{ 31 ImportDecl 32 ::= import <moduleId> 33 | import { <moduleId>;+ } 34 | foreign import "<string>" <var> :: Type 35 }}} 23 36 24 37 25 importDecl26 = '''import''' moduleId [[br]]27 | '''import {''' {moduleId}+ '''}'''
