Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /tests/trunk/bugs/tests.obsolete/bug922.sml
ViewVC logotype

Annotation of /tests/trunk/bugs/tests.obsolete/bug922.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 548 - (view) (download)
Original Path: sml/trunk/tests/bugs/tests/bug922.sml

1 : dbm 548 (* bug922.sml *)
2 :     (* 922. failure of functor currying *)
3 :    
4 :     signature Index =
5 :     sig
6 :     type A
7 :     type I
8 :     val index : A -> I
9 :     end;
10 :    
11 :     signature Square =
12 :     sig
13 :     structure Source : Index
14 :     structure Target : Index
15 :     val top : Source.A -> Target.A
16 :     val bottom : Source.I -> Target.I
17 :     end;
18 :    
19 :     signature FunctorSig =
20 :     sig
21 :     type 'a C
22 :     val map : ('a -> 'b) -> 'a C -> 'b C
23 :     end;
24 :    
25 :     functor MapIndex (structure F:FunctorSig) (structure In:Index) : Index =
26 :     struct
27 :     type A = In.A F.C
28 :     type I = In.I F.C
29 :     val index = F.map In.index
30 :     end;
31 :    
32 :     functor MapSquare (structure G:FunctorSig) (structure Sq:Square) : Square =
33 :     struct
34 :     structure Source = MapIndex (structure F = G) (structure In = Sq.Source)
35 :     structure Target = MapIndex (structure F = G) (structure In = Sq.Target)
36 :     val top = G.map Sq.top
37 :     val bottom = G.map Sq.bottom
38 :     end;

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0