<commit_before>module CanvasHs.Launch (launchBrowser) where

import System.Info
import System.Process
import System.Exit

launchBrowser :: String -> IO()
launchBrowser url = do
                status <- case os of 
                    "windows" -> launchBrowserWindows url
                    "osx"     -> launchBrowserOSX url
                    _         -> launchBrowserLinux url
                    case status of
                        ExitSuccess   -> return ()
                        ExitFailure n -> error ("Failed to open browser, exitcode " ++ show n)

launchBrowserWindows :: String -> IO(ExitCode)
launchBrowserWindows url = do
                status <- system $ "start " ++ url
                return status

launchBrowserLinux :: String -> IO(ExitCode)
launchBrowserLinux url = do
                status <- system $ "xdg-open " ++ url
                return status

launchBrowserOSX :: String -> IO(ExitCode)
launchBrowserOSX url = do
                status <- system $ "open " ++ url
                return status<commit_msg>Launch: fixed on windows/MGwin<commit_after>module CanvasHs.Launch (launchBrowser) where

import System.Info
import System.Process
import System.Exit

launchBrowser :: String -> IO()
launchBrowser url = do
                status <- case os of 
                    "windows" -> launchBrowserWindows url
                    "mingw32" -> launchBrowserWindows url
                    "osx"     -> launchBrowserOSX url
                    _         -> launchBrowserLinux url
                case status of
                    ExitSuccess   -> return ()
                    ExitFailure n -> error ("Failed to open browser, exitcode " ++ show n)

launchBrowserWindows :: String -> IO(ExitCode)
launchBrowserWindows url = do
                status <- system $ "start " ++ url
                return status

launchBrowserLinux :: String -> IO(ExitCode)
launchBrowserLinux url = do
                status <- system $ "xdg-open " ++ url
                return status

launchBrowserOSX :: String -> IO(ExitCode)
launchBrowserOSX url = do
                status <- system $ "open " ++ url
                return status
{'fraction_non_alphanumeric': 0.08104331625523988, 'fraction_numerical': 0.0009315323707498836, 'mean_word_length': 1.6917293233082706, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '953467', 'n_tokens_mistral': 552, 'n_tokens_neox': 483, 'n_words': 163}