小编Stu*_*ton的帖子

输出功能名称的功能

在Haskell中是否可以实现一个返回其自己的函数名的函数?

可能的类型可能是(a -> b) -> String.

haskell metaprogramming template-haskell

7
推荐指数
2
解决办法
2716
查看次数

带空地的单选按钮分组

我正在使用带有 gtk2hs 绑定的编辑器 Glade 在 Haskell 中编写 GUI。目前,我在对单选按钮进行分组方面惨败。它不会让我选择组名。有人可以帮忙吗?

glade gtk2hs

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

与GHCi和C文件的ByteCodeLink错误

当我使用外部导入为我所做的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 ghci cabal

5
推荐指数
0
解决办法
374
查看次数

使用Haskell处理关节按键

在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 keyboard-events

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

Haskell IO monad并做表示法

以下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)

任何想法如何使其编译.我不明白为什么它不接受()作为给出的最终值.

io monads haskell

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