小编tim*_*agh的帖子

为什么我(替代!!)函数有这种类型

对错误消息有点沮丧一些前奏函数(如!!)给出,我试着写一个不同的版本.

--(!!!) :: (Show a,Integral b)=> [a]->b->a
as !!! y=f as y
    where f (x:xs) b= if b==0
                      then x
                      else f xs (b-1)
          f [] _= error "!!!: list "++(show as)++" has less than "++show y++" elements"
Run Code Online (Sandbox Code Playgroud)

但是函数类型是

*Handydandy> :type (!!!)
(!!!) :: (Show a, Num a, Eq a) => [[Char]] -> a -> [Char]
Run Code Online (Sandbox Code Playgroud)

我不明白为什么第一个参数被推断为字符串列表而不仅仅是一个show实例列表.有人可以解释一下吗?

haskell

3
推荐指数
2
解决办法
117
查看次数

来自 vps 的 git clone

我在克隆我的存储库时遇到了一些问题

$git clone ssh://root@8x.12x.9x.21x:/repo repo
Cloning into 'repo'...
fatal: '/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

虽然我在克隆 vps 本身时没有遇到这样的麻烦。我也没有从另一台计算机推送到它的问题。

$ ssh root@8x.12x.9x.21x
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 2.6.32-042stab111.11 x86_64)

* Documentation:  https://help.ubuntu.com/
Last login: Tue Mar  8 12:29:47 2016 from 80.79.35.115
root@vps:~# ls
deployment_test  my-project  repo
root@vps:~# git clone repo repo2
Cloning into 'repo2'...
done.
Run Code Online (Sandbox Code Playgroud)

有谁知道可能是什么问题?

git ssh vps

1
推荐指数
1
解决办法
2294
查看次数

标签 统计

git ×1

haskell ×1

ssh ×1

vps ×1