- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试 installed application credentials 的例子
在 gogol package .
这是示例(刚刚从已安装的应用程序凭据页面复制):
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Proxy (Proxy (..))
import Data.Text as T
import Data.Text.IO as T
import System.Exit (exitFailure)
import System.Info (os)
import System.Process (rawSystem)
redirectPrompt :: AllowScopes (s :: [Symbol]) => OAuthClient -> proxy s -> IO (OAuthCode s)
redirectPrompt c p = do
let url = formURL c p
T.putStrLn $ "Opening URL " `T.append` url
_ <- case os of
"darwin" -> rawSystem "open" [unpack url]
"linux" -> rawSystem "xdg-open" [unpack url]
_ -> T.putStrLn "Unsupported OS" >> exitFailure
T.putStrLn "Please input the authorisation code: "
OAuthCode <$> T.getLine
Illegal kind signature: ‘s’
Perhaps you intended to use KindSignatures
In the type signature for ‘redirectPrompt’
Illegal kind: ‘[Symbol]’ Perhaps you intended to use DataKinds
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
• Couldn't match kind ‘[Symbol]’ with ‘*’
When matching the kind of ‘proxy’
• In the second argument of ‘formURL’, namely ‘p’
In the expression: formURL c p
In an equation for ‘url’: url = formURL c p
• Relevant bindings include
p :: proxy s (bound at app/Main.hs:36:18)
redirectPrompt :: OAuthClient -> proxy s -> IO (OAuthCode s)
(bound at app/Main.hs:36:1)
p
的类型看起来和
formURL
一样需要一个。
-- https://hackage.haskell.org/package/gogol-0.1.1/docs/Network-Google-Auth.html#v:formURL
formURL :: AllowScopes (s :: [Symbol]) => OAuthClient -> proxy s -> Text
最佳答案
与 lts-8.0
一起使用以及 .cabal
中的正确依赖项
build-depends: base
, gogol
, gogol-core
, process
, text
{-# LANGUAGE OverloadedStrings #-}
和
import GHC.TypeLits
哪里
Symbol
被定义为。
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
module Main where
import Network.Google.Auth
import GHC.TypeLits
import Data.Proxy (Proxy (..))
import Data.Text as T
import Data.Text.IO as T
import System.Exit (exitFailure)
import System.Info (os)
import System.Process (rawSystem)
redirectPrompt :: AllowScopes (s :: [Symbol]) => OAuthClient -> proxy s -> IO (OAuthCode s)
redirectPrompt c p = do
let url = formURL c p
T.putStrLn $ "Opening URL " `T.append` url
_ <- case os of
"darwin" -> rawSystem "open" [unpack url]
"linux" -> rawSystem "xdg-open" [unpack url]
_ -> T.putStrLn "Unsupported OS" >> exitFailure
T.putStrLn "Please input the authorisation code: "
OAuthCode <$> T.getLine
main = print "working"
关于haskell gogol - 已安装的应用程序凭据示例 : Couldn't match kind ‘[Symbol]’ with ‘*’ ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42189666/
我正在用KIND测试K8。。我创建了集群:。现在我想用sudo Kind删除集群来删除这个集群,但得到的是:。但是当我转到路径时,我看不到文件:。配置文件:。另外,当调用命令sudo种类删除集群--名
我在用kind测试k8。我创建了集群:。现在我想用sudo Kind删除集群来删除这个集群,但得到的是:。但当转到路径时,我没有看到文件:。配置文件:。另外,当调用命令sudo种类删除集群--名称节点
我在 Haskell 中为日期结构派生 Typeable1 实例时遇到问题。 这是我的代码: {-# LANGUAGE StandaloneDeriving #-} {-# LANGU
我最近从Kubernetes 1.2.0升级到Kubernetes 1.3.0,现在当我尝试开始工作时遇到以下错误: $ kubectl create -f pijob.yaml unable to
当我创建这样的子图时: import pandas as pd import numpy as np import matplotlib.pyplot as plt import itertools
我有一个名为 firstperiod 的 pandas 数据框和一个名为 megaball 的列。 megaball 的取值范围是 1 到 25,这行代码: print firstperiod.meg
我有一个数据库列:。如何使其仅允许Kind。未指定?。当我插入以下内容时,出现以下错误:。我见过的每个解决方案都是使用Npgsql.EnableLegacyTimestampBehavior。但是,这
我有一个数据库列:。如何使其仅允许Kind。未指定?。当我插入以下内容时,出现以下错误:。我见过的每个解决方案都是使用Npgsql.EnableLegacyTimestampBehavior。但是,这
两个reflect.Type接口(interface)和reflect.Value type 实现相同的 Kind() 方法签名,假设我们有一些值对象 v := reflect.ValueOf(x)
到目前为止,我已经尝试了以下代码: # Import to handle plotting import seaborn as sns # Import pyplot, figures inline,
我正在尝试为我的 kubernetes 集群设置一个 kind 集群。不幸的是,它在编写节点时准备好节点后失败了。我将附上输出和一些信息。提前感谢您的帮助! 干杯 错误 $ kind create c
当我尝试 Haskell 类型并尝试获得 -> 类型时,结果出现了: $ ghci ... Prelude> :k (->) (->) :: ?? -> ? -> * Prelude> 而不是预期的*
我想将reflect.Kind作为实现接口(interface)的类型的reflect.Interface,但其实现基于原始类型:type id string 对此问题的另一种答案可能是如何在调用 K
运行我的项目 ng build --prod --base-href="./" 得到下面的错误信息 ERROR in ./node_modules/ng-multiselect-dropdown/fe
我已经阅读了Wikipedia文章,并搜索了明显的地方,但是我陷入了困境。有人可以简单地告诉我什么是实物吗?它是干什么用的 ? 斯卡拉的例子最受赞赏 最佳答案 简而言之:一种类型就是类型,值就是类型。
我一直在思考我正在处理的库中的一个设计问题,我意识到使用存在类型可能允许我以一种简化库的许多部分的方式更改我的设计。但是,我似乎无法让它正常工作。 在我看来,myBuilder 符合 MultiSig
我有这些类型: SomeTypeClass 具有一个类型参数 kind * => * => * 的更高类型 trait SomeTypeClass[P[_, _]] { def test[F[
我想要获取文件的“Kind”查找器。例如,对于文件“foo.css”,我想要字符串“CSS样式表”。 到目前为止,我正在做这样的事情: NSURL *fileURL = [[NSURL alloc]
我遇到了这样一种情况,我的代码可以从使用 Functor 中受益。和 Applicative - 类似抽象,但用于类型 (* -> *) -> * .可以使用 RankNTypes 定义更高种类的仿函
我读过很多关于类型种类、更高种类的类型等等的有趣的东西。默认情况下,Haskell 支持两种类型: 简单类型:* 类型构造函数:* → * 最新 GHC 语言扩展 ConstraintKinds添加了
我是一名优秀的程序员,十分优秀!