Name | 1 | 10 | 100 | 1000 | 10000 | 100000 | 1000000 |
---|---|---|---|---|---|---|---|
Int | 6.712 ns | 11.81 ns | 0.066 μs | 0.606 μs | 11.19 μs | 0.112 ms | 1.118 ms |
Double | 13.95 ns | 29.11 ns | 0.247 μs | 2.272 μs | 22.35 μs | 0.224 ms | 2.233 ms |
Integer | 46.33 ns | 251.5 ns | 1.296 μs | 12.71 μs | 126.4 μs | 1.309 ms | 19.36 ms |
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
#!/usr/bin/env stack | |
{- stack | |
--resolver lts-12.2 script | |
--package filepath | |
--package rio | |
--package bytestring | |
--package time | |
--package random | |
--package process | |
--package unix |
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
name <- atomically $ do | |
readTVar (currentUpdate ctxt) >>= \case | |
name:names <- readTVar (queuedUpdates ctxt) | |
writeTVar (queuedUpdates ctxt) names | |
return name | |
name <- atomically $ do | |
readTVar (currentUpdate ctxt) >>= \case | |
Just _ -> retry | |
Nothing -> readTVar (queuedUpdates ctxt) >>= \case |
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 AllowAmbiguousTypes #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} |
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 DataKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE NumericUnderscores #-} | |
{-# OPTIONS_GHC -fno-warn-orphans #-} | |
module Lib where | |
import Control.Monad.State.Strict | |
import Control.Exception |
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 CPP #-} | |
#if __GLASGOW_HASKELL__ < 802 | |
main :: IO () | |
main = do | |
let (ghcMaj, ghcMin) = divMod (__GLASGOW_HASKELL__ :: Int) 100 | |
ghcVer = show ghcMaj ++ "." ++ show ghcMin | |
putStrLn $ "GHC version: " ++ ghcVer ++ " is not supported by git-modtime script." | |
#else | |
import Data.Time.Format (parseTimeM, iso8601DateFormat, defaultTimeLocale) | |
import System.Directory (setModificationTime) |
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
#!/bin/sh -e | |
# | |
# Stack installation script. | |
# | |
# This script is meant for quick & easy install via: | |
# 'curl -sSL https://get.haskellstack.org/ | sh' | |
# or: | |
# 'wget -qO- https://get.haskellstack.org/ | sh' | |
# | |
# By default, this installs 'stack' to '/usr/local/bin'. |
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 GHCForeignImportPrim #-} | |
{-# LANGUAGE MagicHash #-} | |
{-# LANGUAGE UnboxedTuples #-} | |
{-# LANGUAGE UnliftedFFITypes #-} | |
module MutInt | |
( MutInt, | |
newMutInt, | |
getMutInt, | |
putMutInt, |
OlderNewer