This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test :: [Int] -> [Int] | |
test xs = filter (\x -> x `mod` 2 == 0) xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test :: [Int] -> [Int] | |
test [] = [] | |
test (x:xs) | |
| x `mod` 2 == 0 = x : test xs | |
| otherwise = test xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# INLINE filter #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
even :: Int -> Bool | |
even x = x `mod` 2 == 0 | |
test :: [Int] -> [Int] | |
test xs = filter even xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test :: [Int] -> [Int] | |
test [] = [] | |
test (x:xs) | |
| even x = x : test xs | |
| otherwise = test xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MagicHash, UnboxedTuples #-} | |
module Main (main) where | |
import Data.Time.Clock | |
import GHC.Exts | |
import GHC.IO | |
import GHC.Prim | |
import GHC.ST | |
bench = stToIO $ ST $ \ s -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar cmm-mode-hook nil) | |
(add-to-list 'auto-mode-alist '("\\.cmm\\'" . cmm-mode)) | |
(defvar cmm-keywords | |
'("aborts" "align" "aligned" "also" "as" "big" "bits" "byteorder" "case" | |
"const," "continuation" "cut" "cuts" "else" "equal" "export" "foreign" | |
"goto" "if" "import" "in," "invariant" "invisible" "jump" "little" "memsize" | |
"pragma" "reads" "register," "return" "returns" "section" "semi" "span" | |
"stackdata" "switch" "target" "targets" "to," "typedef" "unicode" "unwinds" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rec { | |
$fUniformGaussianValuesDoubleDouble_ziggurat | |
:: forall g_a2D9. | |
RandomGen g_a2D9 => | |
(Vector Double, Vector Double, Vector Word) | |
-> g_a2D9 -> (Double, g_a2D9) | |
$fUniformGaussianValuesDoubleDouble_ziggurat = | |
\ (@ g_a2D9) | |
($dRandomGen_a2Da :: RandomGen g_a2D9) | |
(eta_B2 :: (Vector Double, Vector Double, Vector Word)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
module Main | |
( main | |
) where | |
import Control.Applicative | |
import Control.Monad (mzero) | |
import qualified Data.Vector as V | |
import Data.Vector (Vector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns, PatternGuards #-} | |
module Main (main) where | |
import Control.Monad (forM_, unless) | |
import Prelude hiding (id, mod) | |
import System.Environment (getArgs) | |
import System.Exit (ExitCode(ExitFailure), exitWith) | |
import Bag | |
import Digraph (flattenSCCs) |