Last change
on this file since 84 was
84,
checked in by mulligan, 10 years ago
|
Lots of work on tidying up code.
|
File size:
1.2 KB
|
Line | |
---|
1 | (*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*) |
---|
2 | (* FILENAME: Word.ml *) |
---|
3 | (* DESCRIPTION: An ADT implementing standard 16 bit words, 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 = byte * byte |
---|
19 | end;; |
---|
20 | |
---|
21 | module WordFunctor(Bit: BIT) |
---|
22 | (Nibble: NIBBLE |
---|
23 | with type bit = Bit.bit) |
---|
24 | (Byte: BYTE |
---|
25 | with type bit = Bit.bit |
---|
26 | and type nibble = Nibble.nibble): WORD |
---|
27 | with type bit = Bit.bit |
---|
28 | and type nibble = Nibble.nibble |
---|
29 | and type byte = Byte.byte = |
---|
30 | struct |
---|
31 | type bit = Bit.bit |
---|
32 | type nibble = Nibble.nibble |
---|
33 | type byte = Byte.byte |
---|
34 | type word = (byte * byte) |
---|
35 | end;; |
---|
36 | |
---|
37 | module Word = WordFunctor(Bit) (Nibble) (Byte);; |
---|
Note: See
TracBrowser
for help on using the repository browser.