开发者

Open Browser From Haskell Interpreter

开发者 https://www.devze.com 2023-02-09 12:34 出处:网络
I\'ve been messing around a lot with oeis.org, I found a module on Hackage that provides an interface to oeis.org (Math.OEIS), but it displays its results on the command line. I was won开发者_Python百

I've been messing around a lot with oeis.org, I found a module on Hackage that provides an interface to oeis.org (Math.OEIS), but it displays its results on the command line. I was won开发者_Python百科dering if anyone knew how to go about opening a url in the default browser from ghci.

Thanks


Here's what I use:

-- | Attempt to open a web browser on the given url, all platforms.
openBrowserOn :: String -> IO ExitCode

https://hackage.haskell.org/package/hledger-1.22.2/docs/src/Hledger.Cli.Utils.html#openBrowserOn

20110630: see wai-handler-launch (blog post) for more robust code.

0

精彩评论

暂无评论...
验证码 换一张
取 消