小编Son*_*rds的帖子

Scala中Int和Integer有什么区别?

我正在处理一个我声明为Integer的变量,并发现>不是Integer的成员.这是一个简单的例子:

scala> i
warning: there were deprecation warnings; re-run with -deprecation for details
res28: Integer = 3

scala> i > 3
<console>:6: error: value > is not a member of Integer
       i > 3
         ^
Run Code Online (Sandbox Code Playgroud)

将它与Int进行比较:

scala> j
res30: Int = 3

scala> j > 3
res31: Boolean = false
Run Code Online (Sandbox Code Playgroud)

Integer和Int有什么区别?我看到了弃用警告,但我不清楚为什么它被弃用,并且鉴于它已经存在,为什么它没有>方法.

int types integer scala

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

在NixOS中从Haskell运行shell命令

我是NixOS的新手,我正在尝试使用以下函数从Haskell程序调用emacs:

ediff :: String -> String -> String -> IO ()
ediff testName a b = do
  a' <- writeSystemTempFile (testName ++ ".expected") a
  b' <- writeSystemTempFile (testName ++ ".received") b
  let quote s = "\"" ++ s ++ "\""
  callCommand $ "emacs --eval \'(ediff-files " ++ quote a' ++ quote b' ++ ")\'"
Run Code Online (Sandbox Code Playgroud)

当我运行调用此命令的程序时stack test,我得到以下结果(穿插单元测试结果):

/bin/sh: emacs: command not found
Exception: callCommand: emacs --eval '(ediff-files "/run/user/1000/ast1780695788709393584.expected" "/run/user/1000/ast4917054031918502651.received")'
Run Code Online (Sandbox Code Playgroud)

当我运行无法从我的shell运行上面的命令时,它运行完美.如何从NixOS中的Haskell运行进程,就像我直接调用它们一样,以便它们可以访问与我的用户相同的命令和配置?

haskell nixos

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

标签 统计

haskell ×1

int ×1

integer ×1

nixos ×1

scala ×1

types ×1