Thanks again - all compiles with Alice 1.4 now. FWIW I pasted the patch below. The changes are pretty trivial, most of the changed lines are from Makefile.depends which is auto generated anyway IIRC.

Now to figure out how to write a parser ...

Andreas Rossberg wrote:
...
That's because Alice 1.4 implements SML's equality types correctly, and the Parsec implementation obviously does violate that (i.e. is not valid SML).

The double tick in ''4 denotes an equality type (because op= is used), and does not unify with the token type because that is not an equality type according to its specification in the TOKEN signature. You either need to change the specification to eqtype. Or rather, you use the operator Toke.equal instead of op=, which seems to match the intension better (in fact I believe that the use of polymorphic equality op= in that line actually is a slip-up).
# HG changeset patch
# User paul sorenson <[EMAIL PROTECTED]>
# Date 1179012252 -36000
# Node ID 78267055755b09b26fe6e42eb5710b2cdc9356fa
# Parent  e88d9155adb9f9d69fea6a65a19698bced0c86b3
Added "open Fn" to reflect new location of curry.
"op=" changed to Token.equal.

diff -r e88d9155adb9 -r 78267055755b AliceMakefile
--- a/AliceMakefile    Sun May 13 09:20:12 2007 +1000
+++ b/AliceMakefile    Sun May 13 09:24:12 2007 +1000
@@ -10,7 +10,7 @@ export ROOT
export ROOT

ifndef EXT
-  EXT := ozf
+  EXT := alc
endif
export EXT

@@ -62,7 +62,7 @@ depend: Makefile.depend

Makefile.depend: $(FILTERED_SOURCES)
    $(ALICEDEP) $(FILTERED_SOURCES) > Makefile.depend
- +
-include Makefile.depend

components: Makefile.depend $(COMPONENTS)
diff -r e88d9155adb9 -r 78267055755b Makefile.depend
--- a/Makefile.depend    Sun May 13 09:20:12 2007 +1000
+++ b/Makefile.depend    Sun May 13 09:24:12 2007 +1000
@@ -1,34 +1,34 @@ ERROR-sig.ozf: \
-ERROR-sig.ozf: \
-    TOKEN-sig.ozf
+ERROR-sig.alc: \
+    TOKEN-sig.alc

-MkError.ozf: \
-    ERROR-sig.ozf \
-    TOKEN-sig.ozf
+MkError.alc: \
+    ERROR-sig.alc \
+    TOKEN-sig.alc

-PRIM-sig.ozf: \
-    TOKEN-sig.ozf \
-    ERROR-sig.ozf
+PRIM-sig.alc: \
+    TOKEN-sig.alc \
+    ERROR-sig.alc

-MkPrim.ozf: \
-    TOKEN-sig.ozf \
-    PRIM-sig.ozf \
-    MkError.ozf \
-    /home/dreamer/programming/ps/alice/install/lib/utility/Ctrl.ozf
+MkPrim.alc: \
+    TOKEN-sig.alc \
+    PRIM-sig.alc \
+    MkError.alc \
+    /usr/share/alice/lib/utility/Ctrl.alc

-COMBINATORS-sig.ozf: \
-    PRIM-sig.ozf
+COMBINATORS-sig.alc: \
+    PRIM-sig.alc

-MkCombinators.ozf: \
-    COMBINATORS-sig.ozf \
-    PRIM-sig.ozf
+MkCombinators.alc: \
+    COMBINATORS-sig.alc \
+    PRIM-sig.alc

-CharParser.ozf: \
-    PRIM-sig.ozf \
-    TOKEN-sig.ozf \
-    MkPrim.ozf \
-    MkCombinators.ozf \
-    /home/dreamer/programming/ps/alice/install/lib/utility/Ctrl.ozf
+CharParser.alc: \
+    PRIM-sig.alc \
+    TOKEN-sig.alc \
+    MkPrim.alc \
+    MkCombinators.alc \
+    /usr/share/alice/lib/utility/Ctrl.alc

-HighscoreParser.ozf: \
-    CharParser.ozf
+HighscoreParser.alc: \
+    CharParser.alc

diff -r e88d9155adb9 -r 78267055755b MkError.aml
--- a/MkError.aml    Sun May 13 09:20:12 2007 +1000
+++ b/MkError.aml    Sun May 13 09:24:12 2007 +1000
@@ -1,5 +1,8 @@ import signature ERROR   from "ERROR-sig
import signature ERROR   from "ERROR-sig"
import signature TOKEN   from "TOKEN-sig"
+
+(* curry has moved to Fn *)
+open Fn

functor MkError (T: TOKEN) :> ERROR where
                    type Token.position = T.position and
diff -r e88d9155adb9 -r 78267055755b MkPrim.aml
--- a/MkPrim.aml    Sun May 13 09:20:12 2007 +1000
+++ b/MkPrim.aml    Sun May 13 09:24:12 2007 +1000
@@ -12,6 +12,8 @@ import structure Ctrl       from "x-alic
import structure Ctrl       from "x-alice:/lib/utility/Ctrl"

open Ctrl
+(* curry has moved to Fn *)
+open Fn


functor MkPrim (T: TOKEN) :> PRIM where @@ -188,7 +190,7 @@ struct

    val errorToString  = Error.toString Error.englishMsgCfg

-    fun char c = satisfy (curry op= c) <?> ("'" ^ Token.toString c ^ "'")
+ fun char c = satisfy (curry Token.equal c) <?> ("'" ^ Token.toString c ^ "'")

    fun anyChar() = satisfy (const true)



_______________________________________________
alice-users mailing list
[email protected]
http://www.ps.uni-sb.de/mailman/listinfo/alice-users

Reply via email to