[Ur] using mapR

Gergely Buday gbuday at gmail.com
Thu Sep 29 10:11:19 EDT 2011


> By prefacing [Monad.mapR] with [@], you have requested that type class
> arguments be passed explicitly.  Membership in the class [monad] is an
> example of such an argument, and you can see it early in the type of [mapR]
> (and it appears first in the error message).  That argument should go first,
> before [[id]].  Just put an underscore in that position and it should work.

For some reasons it doesn't:

[gergoe at flagship sandbox]$ head -3 mapr.ur
fun sourceRecord [ r ::: {Type} ] (fl : folder r) (record : $r) :
(transaction $(map source r)) =
	    @Monad.mapR [_]  [id] [source]  (fn [nm :: Name] [t :: Type]  =>
source  ) fl record

/home/gergoe/local/sandbox/sandbox/mapr.ur:2:5-2:16: Expression is not
a constructor function
Expression:  Monad.mapR[[<UNIF:R>]] [<UNIF:A::Type -> Type>]
      Type:
((Basis.monad <UNIF:A::Type -> Type>) ->
  tf :: <UNIF:R> -> Type ->
   tr :: <UNIF:R> -> Type ->
    ((nm :: Name ->
       t :: <UNIF:R> -> ((tf t) -> <UNIF:A::Type -> Type+4> (tr t)))
      ->
      r ::: {<UNIF:R>} ->
       ((Top.folder[[<UNIF:R>]] r) ->
         ($(map tf r) -> <UNIF:A::Type -> Type+3> $(map tr r)))))



More information about the Ur mailing list