在Haskell中是否可以实现一个返回其自己的函数名的函数?
可能的类型可能是(a -> b) -> String.
我正在使用带有 gtk2hs 绑定的编辑器 Glade 在 Haskell 中编写 GUI。目前,我在对单选按钮进行分组方面惨败。它不会让我选择组名。有人可以帮忙吗?
当我使用外部导入为我所做的C函数运行我的文件时,我收到此错误.
ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
richards
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug …Run Code Online (Sandbox Code Playgroud) 在Haskell中编写程序,我正在努力处理ctrl-s和ctrl-l形式的按键操作
我使用以下代码:
main :: IO ()
main = do
hSetBuffering stdin NoBuffering
x <- getChar
putStrLn ("You pressed: " ++ [x])
Run Code Online (Sandbox Code Playgroud)
如何识别按下的Ctrl按钮?
以下Haskell snippit将无法编译,我无法弄清楚原因.
runCompiler :: TC -> IO ()
runCompiler tc = let cp' = cp in
do
cp'
return ()
where
cp = compileProg tc
Run Code Online (Sandbox Code Playgroud)
我从GHCi收到以下错误:
Couldn't match expected type `IO a0' with actual type `String'
In a stmt of a 'do' block: cp'
In the expression:
do { cp';
return () }
In the expression:
let cp' = cp
in
do { cp';
return () }
Run Code Online (Sandbox Code Playgroud)
任何想法如何使其编译.我不明白为什么它不接受()作为给出的最终值.