I know we had this before...

Foo(F): Exports == Implementation where
  F: Type
  Exports ==> FooCat(F) with
    ...
  Implementation ==> add
    Rep ==> Record(mul: F, be: H)
    ...
    if F has with qetaGrade: % -> ZZ then        (*)
        numberOfGaps(x: %): NN ==
            t: F := multiplier x
            n: PP := qetaGrade(t)::PP
            ...

Unfurtunately, it does not compile. It complains

error in function numberOfGaps

(SEQ (|:=| (|:| |t| F) (|multiplier| |x|))
     (|:=| (|:| |n| (|PositiveInteger|))
      (|::| (|qetaGrade| | << t >> |) (|PositiveInteger|)))
     (|:=| (|:| |grades| (|List| (|PositiveInteger|)))
      (COLLECT (IN |i| (SEGMENT 1 (- |n| 1)))
               (|::| (|qetaGrade| (|first| (|basis| |x| |i|)))
                (|PositiveInteger|))))
(|exit| 1 ((|Sel| (|QEtaAuxiliaryPackage|) |numberOfGaps|) |n| |grades|)))
****** level 5  ******
$x:= t
$m:= $
$f:=
((((|n| #) (|t| # #) (|x| # #) (F # #) ...)))

   >> Apparent user error:
   Cannot coerce t
      of mode F
      to mode $

A workaround is to replace in (*) the % by an F.

ALthough working, it looks a bit odd to me. Why should the % in that position ever refer to Foo(F)? Is there a situation where it would make sense?

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/78964962-83fa-c567-37a9-bad5d93e2afd%40hemmecke.org.

Reply via email to