Line | |
---|
1 | (*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*) |
---|
2 | (* FILENAME: Byte.ml *) |
---|
3 | (* DESCRIPTION: An ADT implementing standard 8 bit bytes, and common *) |
---|
4 | (* operations on them. *) |
---|
5 | (* CREATED: 13/09/2010, Dominic Mulligan *) |
---|
6 | (* BUGS: *) |
---|
7 | (*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*) |
---|
8 | |
---|
9 | open Bit;; |
---|
10 | open Nibble;; |
---|
11 | open Byte;; |
---|
12 | |
---|
13 | module type WORD = |
---|
14 | sig |
---|
15 | type bit |
---|
16 | type nibble |
---|
17 | type byte |
---|
18 | type word |
---|
19 | end;; |
---|
20 | |
---|
21 | module Word(Bit: BIT) |
---|
22 | (Nibble: NIBBLE with type bit = Bit.bit) |
---|
23 | (Byte: BYTE with type bit = Bit.bit and type nibble = Nibble.nibble): WORD |
---|
24 | with type bit = Bit.bit |
---|
25 | and type nibble = Nibble.nibble |
---|
26 | and type byte = Byte.byte = |
---|
27 | struct |
---|
28 | type bit = Bit.bit |
---|
29 | type nibble = Nibble.nibble |
---|
30 | type byte = Byte.byte |
---|
31 | type word = (byte * byte) |
---|
32 | end;; |
---|
Note: See
TracBrowser
for help on using the repository browser.