对错误消息有点沮丧一些前奏函数(如!!)给出,我试着写一个不同的版本.
--(!!!) :: (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实例列表.有人可以解释一下吗?
我在克隆我的存储库时遇到了一些问题
$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)
有谁知道可能是什么问题?