移动应用?(Mobile application ? In Asp.net /)
在Web应用程序[asp.net 2008]中,我没有获得Mobile模板选项,是否需要安装移动模板的sdk。
In web application [asp.net 2008], i am not getting Mobile template option, is there any sdk required to install mobile template.
原文:https://stackoverflow.com/questions/9124961
最满意答案
令我困惑的是:我把FlexibleContexts pragma放到头部的pragma列表中,但是ghcu仍然建议我把它包含在内。
这仅启用模块本身的扩展。 要在GHCi中编写此代码,您需要在GHCi
:set -XFlexibleContexts
启用扩展。但这只是问题的一部分。 看起来你的班级
p
应该确定n
:你只能向上和向下移动一个Point a
,对吗? 但是就目前而言,没有什么可以阻止你定义更多的Moving (Point a) SomeOtherType
实例,并且编译器不会假设你不会。 因此,推断类型中的a
和n
完全不相关,您希望它们是相同的。 这可以通过添加FunctionalDependencies
扩展并更改类声明来解决class Num n => Moving p n | p -> n where
这意味着不能有具有相同
p
和不同n
实例。我认为这足以让它发挥作用。 代码仍然是欠定的,因为它允许任何数字
a
,但默认规则将选择Integer
。And the thing that confuses me much: I put the FlexibleContexts pragma to the pragma listing in the head, but ghcu still suggest me to get it included.
This only enables the extension in the module itself. To write this code in GHCi, you need to enable the extension in GHCi:
:set -XFlexibleContexts
.But this is only part of the problem. It looks like for your class
p
should determinen
: you can only move aPoint a
up and down bya
, right? But as it stands, nothing stops you from defining moreMoving (Point a) SomeOtherType
instances, and the compiler doesn't assume you won't. Soa
andn
in the inferred type are completely unrelated, where you want them to be the same. This can be fixed by adding theFunctionalDependencies
extension and changing the class declaration to sayclass Num n => Moving p n | p -> n where
which means exactly that there can't be instances with same
p
and differentn
.I think that's enough to make it work. The code will still be underdetermined because it allows any numeric
a
, but defaulting rules will pickInteger
.
相关问答
更多-
一个选项不需要Show a超级约束。 instance Show (Expr a) where showsPrec p (Eq x y) = showParen (p>9) $ ("Eq "++) . showsPrec 10 x . (' ':) . showsPrec 10 y 当然这有点踢石头的路,因为现在你不能写 showsPrec p (Val x) = showParen (p>9) $ ("Val "++) . showsPrec 10 x 现在叶值不Show约束。 ...
-
这基本上是new()约束归结为: class Factory
where T : new() { public T Create() { return new T(); // ^^^^^^^ // this requires the new() type constraint. } } 现在,您不允许将参数传递给构造函数。 如果你想要初始化新对象,你可以通过引入更多的约束来达到这个目的: interface IL ... -
非类型变量约束(Non-type variable constraint)[2024-03-17]
以下文件是我可以构建的最小文件,它可以复制您的问题。 (将来,您应该为我们自己创建一个这样的文件。) import Text.Parsec.Prim data Token type TokenParser a = Parsec [Token] () a mytoken :: (Token -> Bool) -> TokenParser Token mytoken test = token showTok posFromTok testTok showTok = undefined posFromTo ... -
您收到错误的原因是Process没有实现Comparable
,这是您作为Heap 类型参数提供的所有类必须满足的条件,因为您放置在泛型类型上的类型约束。 The reason that you get the error is that Process does not implement Comparable , a condition that must be met by all classes that you supply as type arguments ... -
在子表达式(show Cons3) ,没有用于确定MyType1的类型参数的MyType1 。 Cons3是任何MyType1 a的构造函数,并且调用show on it将a限制为Show的实例,但除此之外,不能推断任何内容。 因此类型变量是不明确的,并且由于没有数字约束,因此不能默认(除非您启用ExtendedDefaultRules )。 如果你写的话,可以修复类型变量 show (Cons3 `asTypeOf` t) 或者 - 例如 - show (Cons3 :: MyType1 String) ...
-
tell返回类型比Writer更普遍:它使用MonadWriter类型类以作家精神抽象所有monad。 tell :: MonadWriter w m => w -> m () 因此,当您在没有类型注释的情况下编写tell ["abc"]时,类型检查器会将w与[String]统一起来,但它没有任何信息用于精炼m 。 所以你得到了 tell ["abc"] :: MonadWriter [String] m => m () Haskell 98不支持像MonadWriter这样的MonadWriter应用 ...
-
Integral不是一个类型:它是一个类型类。 它描述了对类型的约束。 那么,签名: someFunction :: (Integral a) => a -> Bool -> a 意味着“只要a是Integral一个实例,这个函数就可以在它上面工作” 。 你的第二个例子(Integral a, Bool b) => a -> b -> a没有意义,因为Bool是一个类型,而不是类型类。 成为Integral的实例意味着什么? 嗯,这意味着在某个地方,有人为某种类型编写了例如Int : instance ...
-
令我困惑的是:我把FlexibleContexts pragma放到头部的pragma列表中,但是ghcu仍然建议我把它包含在内。 这仅启用模块本身的扩展。 要在GHCi中编写此代码,您需要在GHCi :set -XFlexibleContexts启用扩展。 但这只是问题的一部分。 看起来你的班级p应该确定n :你只能向上和向下移动一个Point a ,对吗? 但是就目前而言,没有什么可以阻止你定义更多的Moving (Point a) SomeOtherType实例,并且编译器不会假设你不会。 因此,推断 ...
-
使用>> =运算符时约束中的非类型变量参数(Non type-variable argument in the constraint when using >>= operator)[2022-11-09]
这不是monad应该做的。 您可能对Data.Function定义的(&) :: a -> (a -> b) Data.Function 。 matrix ... & mapMatrix ... & mapMatrix .. & ... 请注意,绑定的签名是 (>>=) :: m a -> (a -> m b) -> m b 并且不能简单地忽略m s。 为了完整起见,请注意,实际上可以使绑定的行为几乎与您希望它使用一个特定的monad: Identity 。 但是,它需要一些包装/展开构造函数。 mod ... -
错误元组:约束中的非类型变量参数:积分(a,a)(Error tuple: Non type-variable argument in the constraint: Integral (a, a))[2022-11-17]
您不需要使用Integral (a, a)进行约束。 约束Integral a强制类型a所有值为Integral 。 尝试重写它: countRepetitions :: Integral a => [a] -> a -> (a,a) You don't need to constraint with Integral (a, a). The constraint Integral a forces all values for type a to be Integral. Try rewriting i ...