commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
4.24k
new_contents
stringlengths
1
5.44k
subject
stringlengths
14
778
message
stringlengths
15
9.92k
lang
stringclasses
277 values
license
stringclasses
13 values
repos
stringlengths
5
127k
bc2750943c5e7cfbc901acd5f453a28975a21d0e
env/src/ScreenLock.hs
env/src/ScreenLock.hs
{-# LANGUAGE OverloadedStrings #-} module ScreenLock where import RIO.Process import System.Exit import XMonad.Util.SessionStart import Imports import Misc withScreenInitiallyLocked :: MX () -> MX () -> MX () withScreenInitiallyLocked everyStartupAction initialStartupAction = do env <- ask isStart <- toMX isSes...
{-# LANGUAGE OverloadedStrings #-} module ScreenLock where import RIO.Process import System.Exit import XMonad.Util.SessionStart import Imports import Misc -- | On initial startup, this will use the 'slock' utility to lock the -- screen. The reason I do this, is that I think it's a cool idea to -- load applications...
Add comment explaining screen locking
Add comment explaining screen locking
Haskell
mit
mgsloan/compconfig
4c50b29622ea8d7997f2edf2d89668382f75b3d7
src/DocTest.hs
src/DocTest.hs
module DocTest ( getDocTests , DocTest(..) , Interaction(..) , toTestCase , toAssertion ) where import Test.HUnit (Test(..), assertEqual, Assertion) import qualified Interpreter import Parse toTestCase :: Interpreter.Interpreter -> DocTest -> Test toTestCase repl test = TestLabel sourceFile $ TestCase ...
module DocTest ( getDocTests , DocTest(..) , Interaction(..) , toTestCase , toAssertion ) where import Test.HUnit (Test(..), assertEqual, Assertion) import qualified Interpreter import Parse toTestCase :: Interpreter.Interpreter -> DocTest -> Test toTestCase repl test = TestLabel sourceFile $ TestCase ...
Remove duplicate handling of <BLANKLINE>
Remove duplicate handling of <BLANKLINE> This is done in the parser now.
Haskell
mit
ekmett/doctest,sol/doctest,sol/doctest,ekmett/doctest,snoyberg/doctest-haskell,snoyberg/doctest-haskell
741c4fa49d36d1ba353d093910a62853b6e56c49
app/Main.hs
app/Main.hs
module Main where -- Imports import Util.JSON import Util.Parse import Util.Prelude import Formula import FormulaSyn import System.Environment import Skolem import Unif main :: IO () main = do args <- getArgs let mode = head args formulas :: [Formula] = map parse $ tail args case mode of "pnf" ...
module Main where -- Imports import Util.JSON import Util.Parse import Util.Prelude import Formula import FormulaSyn import System.Environment import Skolem import Unif main :: IO () main = do args <- getArgs let mode = head args formulas :: [Formula] = map parse $ tail args case mode of "nnf" ...
Implement nnf and snf handlers
main: Implement nnf and snf handlers
Haskell
bsd-3-clause
etu-fkti5301-bgu/alt-exam_automated_theorem_proving
5c49b6a3dd5b336bb5823b33ee4eb38ad6617bfb
src/Site.hs
src/Site.hs
{-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------ -- | This module is where all the routes and handlers are defined for your -- site. The 'app' function is the initializer that combines everything -- together and is exported by this module. module Site ...
{-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------ -- | This module is where all the routes and handlers are defined for your -- site. The 'app' function is the initializer that combines everything -- together and is exported by this module. module Site ...
Simplify using the `page` helper
Simplify using the `page` helper
Haskell
mit
ErinCall/andrewlorente
b361cd2721fb5d20de0b5a5f3239effaf506a841
src/Gfx/GfxEngineState.hs
src/Gfx/GfxEngineState.hs
module Gfx.GfxEngineState where import Graphics.Rendering.OpenGL (Color4, GLfloat) data EngineState = EngineState { fillColours :: [ Color4 Double ] , strokeColours :: [ Color4 Double ] , backgroundColour :: Color4 GLfloat , drawTransparencies :: Bool } deriving (Show, Eq) pushFillColour :: Color4 Double -...
module Gfx.GfxEngineState where import Graphics.Rendering.OpenGL (Color4(..), GLfloat) data EngineState = EngineState { fillColours :: [ Color4 Double ] , strokeColours :: [ Color4 Double ] , backgroundColour :: Color4 GLfloat , drawTransparencies :: Bool } deriving (Show, Eq) baseState :: EngineState base...
Add baseState for gfx engine
Add baseState for gfx engine
Haskell
bsd-3-clause
rumblesan/improviz,rumblesan/improviz
29d17f5afa68dbc0e73af759793d5c246eea8dee
exercises/rna-transcription/src/DNA.hs
exercises/rna-transcription/src/DNA.hs
module DNA (toRNA) where toRNA :: String -> Maybe String toRNA = error "You need to implement this function."
module DNA (toRNA) where toRNA :: String -> Maybe String toRNA xs = error "You need to implement this function."
Add specific argument in the stub function.
rna-transcription: Add specific argument in the stub function.
Haskell
mit
exercism/xhaskell
9015b2a9d36b41cf9b7df4992aa6ecb9dabb5324
src/Test/FileLock.hs
src/Test/FileLock.hs
module Test.FileLock(main) where import Development.Shake import Control.Concurrent.Extra import Control.Exception.Extra import Control.Monad import Data.Either.Extra import System.Time.Extra import Test.Type main = shakeTest_ test $ action $ do putNormal "Starting sleep" liftIO $ sleep 5 ...
module Test.FileLock(main) where import Development.Shake import Control.Concurrent.Extra import Control.Exception.Extra import Control.Monad import Data.Either.Extra import System.Time.Extra import Test.Type main = shakeTest_ test $ action $ do putNormal "Starting sleep" liftIO $ sleep 5 ...
Use fail instead of error
Use fail instead of error
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
82cb522285b8b7dc904353444ab187007ce5de0e
src/Session.hs
src/Session.hs
module Session ( T(), new, created, token, unverifiedEmail, verifiedEmail, get, setCookie ) where import Control.Lens import Data.Aeson import Data.ByteString (ByteString) import Data.ByteString.Builder (toLazyByteString) import Data.ByteString.Lazy (fromStrict, toStrict) import Network.HTTP.Types import Network....
module Session ( T(), new, created, token, unverifiedEmail, verifiedEmail, get, setCookie ) where import Control.Lens import Data.Aeson import Data.ByteString (ByteString) import Data.ByteString.Builder (toLazyByteString) import Data.ByteString.Lazy (fromStrict, toStrict) import Network.HTTP.Types import Network....
Set cookie path to /
Set cookie path to /
Haskell
bsd-3-clause
ktvoelker/auth-proxy
53df9d54fc1196f0108437b04cc9192a6a75f256
Development/Shake/FileTime.hs
Development/Shake/FileTime.hs
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Development.Shake.FileTime( FileTime, getModTimeError, getModTimeMaybe ) where import Control.DeepSeq import Data.Binary import Data.Hashable import Data.Typeable import System.Directory import System.IO.Error im...
{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Development.Shake.FileTime( FileTime, getModTimeError, getModTimeMaybe ) where import Control.DeepSeq import Data.Binary import Data.Hashable import Data.Typeable import System.Directory import System.IO.Error im...
Switch to the old catch, for GHC 6.12.3 compat
Switch to the old catch, for GHC 6.12.3 compat
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,nh2/shake,nh2/shake,ndmitchell/shake,nh2/shake,nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
133acba0151b549288ea80911097cefb5b94a402
test/Main.hs
test/Main.hs
module Main (main) where import Network.Info main = do ifcs <- getNetworkInterfaces mapM print ifcs
module Main (main) where import Network.Info main = do ifs <- getNetworkInterfaces mapM (putStrLn . showInterface) ifs showInterface :: NetworkInterface -> String showInterface n = netName n ++ "\n" ++ "IP Address: " ++ show (netIP n) ++ "\n" ++ "IPv6 Address: " ++ ...
Test program gives a nicer output
Test program gives a nicer output
Haskell
bsd-3-clause
olorin/network-info,olorin/network-info
3eecd1d9744899c5d5d9faa5cead6ead07c8c06a
src/Rest.hs
src/Rest.hs
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-| Module : Rest Description : Simple REST server for our spam detection library. Copyright : (c) Bartosz Sumper, 2017 Rest server listens for POST requests on "/spam". POST body should be: { "content": "yourMail" }. Returns true if the given ma...
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-| Module : Rest Description : Simple REST server for our spam detection library. Copyright : (c) Bartosz Sumper, 2017 Rest server listens for POST requests on "/spam". POST body should be: { "content": "yourMail" }. Returns true if the given ma...
Add model evaluation to POST method
Add model evaluation to POST method
Haskell
mit
apisarek/malus
2145c9962dbf1e344434cf6bf06e804576d9e2e8
src/Main.hs
src/Main.hs
module Main where import Network.Curl import System.Environment (getArgs) postJson :: URLString -> String -> IO CurlResponse postJson url jsonData = do writeFile "coverage.json" jsonData h <- initialize setopt h (CurlVerbose True) setopt h (CurlURL url) -- setopt h (CurlPost True) -- setopt h ...
module Main where import Network.Curl import System.Environment (getArgs) postJson :: URLString -> String -> IO CurlResponse postJson url jsonData = do writeFile "coverage.json" jsonData h <- initialize setopt h (CurlVerbose True) setopt h (CurlURL url) -- setopt h (CurlPost True) -- setopt h ...
Include source code in coverage report
Include source code in coverage report
Haskell
bsd-3-clause
guillaume-nargeot/hpc-coveralls-experiment,guillaume-nargeot/hpc-coveralls-experiment
702468fffb1f5c8ccd684def533de1b9963692e7
test/GenerateSpec.hs
test/GenerateSpec.hs
module GenerateSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import Abyme.Universe import Abyme.Universe.Generate () import Abyme.Universe.Validate spec :: Spec spec = describe "generator" $ do prop "generates valid universes" $ \u -> validateUniverse u
module GenerateSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck import Abyme.Universe import Abyme.Universe.Generate () import Abyme.Universe.Validate spec :: Spec spec = describe "generator" $ do prop "generates valid universes" $ \u -> validateUniverse u ...
Test that shrinking keeps universes valid
Test that shrinking keeps universes valid
Haskell
bsd-3-clause
mvr/abyme
61add92c7f76ca94ce3d2c7dfc75ca4149241d7f
Crunch.hs
Crunch.hs
module Main where import Data.List import Data.Function import Data.Char import System.Environment import Control.Monad crunch :: String -> [(String, Int)] crunch s = filterCommons . filterOneOfs . frequencyMap $ map toLower s where filterOneOfs = filter ((>2) . snd) frequencyMap = map (\w -> (head w, l...
module Main where import Data.List import Data.Function import Data.Char import System.Environment crunch :: String -> [(String, Int)] crunch s = filterCommons . filterOneOfs . frequencyMap $ map toLower s where filterOneOfs = filter ((>2) . snd) frequencyMap = map (\w -> (head w, length w)) . group . s...
Remove concatMapM, and required imports
Remove concatMapM, and required imports
Haskell
mit
Inaimathi/langnostic,Inaimathi/langnostic,Inaimathi/langnostic
486cd4e8d89850cfdf79b9d07484793333720ff1
Statistics/Internal.hs
Statistics/Internal.hs
-- | -- Module : Statistics.Internal -- Copyright : (c) 2009 Bryan O'Sullivan -- License : BSD3 -- -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : portable -- -- module Statistics.Internal ( ) where
-- | -- Module : Statistics.Internal -- Copyright : (c) 2009 Bryan O'Sullivan -- License : BSD3 -- -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : portable -- -- module Statistics.Internal ( -- * Default definitions for Show defaultShow1 , defaultShow2 , defaultShow3...
Add helpers for deriving custom Show/Read instances with input validation
Add helpers for deriving custom Show/Read instances with input validation
Haskell
bsd-2-clause
Shimuuar/statistics,bos/statistics,bos/statistics,Shimuuar/statistics
c14cf1a76021531697cc63336723f16ee5b6da76
impl/zowie-hs/src/Language/ZOWIE/State.hs
impl/zowie-hs/src/Language/ZOWIE/State.hs
module Language.ZOWIE.State where import qualified Data.Map.Strict as Map type Addr = Integer type Value = Integer type Memory = Map.Map Addr Value data Reference = Immediate Value | Direct Addr | Indirect Addr deriving (Show, Ord, Eq) data Instruction = Mov Reference Reference ...
module Language.ZOWIE.State where import qualified Data.Map as Map type Addr = Integer type Value = Integer type Memory = Map.Map Addr Value data Reference = Immediate Value | Direct Addr | Indirect Addr deriving (Show, Ord, Eq) data Instruction = Mov Reference Reference deri...
Allow the Haskell implementation to run under Hugs.
Allow the Haskell implementation to run under Hugs.
Haskell
unlicense
catseye/ZOWIE,catseye/ZOWIE,catseye/ZOWIE
51c60286caa284218d6fe2dac1f2c206f9456257
haskell/Language/Hakaru/Syntax/Gensym.hs
haskell/Language/Hakaru/Syntax/Gensym.hs
{-# LANGUAGE DataKinds , PolyKinds , FlexibleInstances , FlexibleContexts , KindSignatures , OverloadedStrings , UndecidableInstances #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} module Language.Hakaru.Syntax.Gensym where import Control.Monad.S...
{-# LANGUAGE CPP , DataKinds , FlexibleInstances , FlexibleContexts , KindSignatures , OverloadedStrings , UndecidableInstances #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} module Language.Hakaru.Syntax.Gensym where #if __GLASGOW_HASKELL__ < 71...
Make gensym compatible with 7.8
Make gensym compatible with 7.8
Haskell
bsd-3-clause
zachsully/hakaru,zachsully/hakaru,zaxtax/hakaru,zaxtax/hakaru
bbcd950764261257a02b5719d243ac44bbb0e405
src/Reflex/Dom/Time.hs
src/Reflex/Dom/Time.hs
module Reflex.Dom.Time where import Reflex import Reflex.Dom.Class import Control.Concurrent import Control.Monad import Control.Monad.IO.Class import Data.Fixed import Data.Time.Clock -- | Send events over time with the given basis time and interval -- If the system starts running behind, occurrences will be drop...
module Reflex.Dom.Time where import Reflex import Reflex.Dom.Class import Control.Concurrent import Control.Monad import Control.Monad.IO.Class import Data.Fixed import Data.Time.Clock data TickInfo = TickInfo { _tickinfo_lastUTC :: UTCTime -- ^ UTC time immediately after the last tick. ,...
Expand tickLossy return data and generalize
Expand tickLossy return data and generalize
Haskell
bsd-3-clause
reflex-frp/reflex-dom,reflex-frp/reflex-dom
a8a94c211504668d1aea8c79ba9d50d9bc16e6e8
lab2/lab2.hs
lab2/lab2.hs
import System.Environment (getArgs) import System.IO import Network import Control.Concurrent main :: IO () main = do args <- getArgs sock <- listenOn $ PortNumber $ fromIntegral $ read $ head args putStrLn $ "Server listening on: " ++ (head args) handleConnections sock handleConnections :: Socket ->...
import System.Environment (getArgs) import System.IO import Network import Control.Concurrent (forkIO) main :: IO () main = do args <- getArgs sock <- listenOn $ PortNumber $ fromIntegral $ read $ head args putStrLn $ "Server listening on: " ++ (head args) handleConnections sock handleConnections :: ...
Make it clearer the concurrency we are using
Make it clearer the concurrency we are using
Haskell
mit
IanConnolly/CS4032,IanConnolly/CS4032,IanConnolly/CS4032
1b51a554e45810add193fbf65db0858b2e46f504
src/Zodiac/TSRP/HttpClient.hs
src/Zodiac/TSRP/HttpClient.hs
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( macHttpClientRequest , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI import Network.HTTP.Client (Request) import Network.HTTP.Types (Header) import P import...
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( authedHttpClientRequest' , macHttpClientRequest , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI import Network.HTTP.Client (Request(..), requestHeaders) import Networ...
Return an authenticated http-client Request
Return an authenticated http-client Request
Haskell
bsd-3-clause
ambiata/zodiac,ambiata/zodiac
3f641bd656c18595d3b1dfba3ddc85c01b5de08d
test/Spec.hs
test/Spec.hs
import Test.Hspec import Data.List import Bombastic main :: IO () main = hspec $ do describe "Map load" $ do it "valid map loads correctly" $ do opaque `shouldBe` expected where opaque = show . opaqueState <$> state state = star...
import Test.Hspec import Data.List import Bombastic main :: IO () main = hspec $ do describe "Map load" $ do it "valid map loads correctly" $ do opaque `shouldBe` expected where opaque = show . opaqueState <$> state state = star...
Use pointfree style to remove some parentheses.
Use pointfree style to remove some parentheses.
Haskell
bsd-3-clause
ahri/bombastic-hs
e5cc1baa6ecf06c315d9ed735a6c29c6dc0929ae
2016/expression-problem/haskell/functional.hs
2016/expression-problem/haskell/functional.hs
-- Sample Haskell code for a functional approach to the expression problem. -- -- Eli Bendersky [http://eli.thegreenplace.net] -- This code is in the public domain. module Expressions where data Expr = Constant Double | BinaryPlus Expr Expr toString :: Expr -> String toString (Constant c) = show c toString...
-- Sample Haskell code for a functional approach to the expression problem. -- -- Eli Bendersky [http://eli.thegreenplace.net] -- This code is in the public domain. module Expressions where data Expr = Constant Double | BinaryPlus Expr Expr stringify :: Expr -> String stringify (Constant c) = show c string...
Update haskell sample to use consistent names with C++ and Clojure
Update haskell sample to use consistent names with C++ and Clojure
Haskell
unlicense
eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog
de7c56142b0658493a09265584975cacee94c0e4
test/Spec.hs
test/Spec.hs
module Spec where import Test.Hspec (hspec) import qualified Homework.Week1Spec as Week1 import qualified Homework.Week2Spec as Week2 main :: IO () main = do hspec Week1.spec hspec Week2.spec
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
Revert "Run all specs from single file"
Revert "Run all specs from single file" This reverts commit ebe7a716d6b6096468748a4b5cf6636ed00ce129.
Haskell
mit
jxv/cis-194-winter-2016
950e1301c6809cc0547f7df0119b2c02d5e41f74
test/Spec.hs
test/Spec.hs
{-# LANGUAGE ScopedTypeVariables, PartialTypeSignatures #-} module Main where import Streaming.Prelude import Prelude hiding (filter, map, drop) import Test.HUnit import System.Exit import Data.Function ((&)) main :: IO () main = do results <- runTestTT tests if (errors results + failures results == 0) then ...
{-# LANGUAGE ScopedTypeVariables, PartialTypeSignatures #-} module Main where import Streaming.Prelude import Prelude hiding (filter, map, drop) import Test.HUnit import System.Exit import Data.Function ((&)) import Data.Functor.Identity main :: IO () main = do results <- runTestTT tests if (errors results + fail...
Change test from hacky list stuff to Identity monad
Change test from hacky list stuff to Identity monad
Haskell
bsd-3-clause
m0ar/safe-streaming,m0ar/safe-streaming
af9300d31b49b1286ba21824daf0d68c6638b358
tests/Instances/Data/Typeable.hs
tests/Instances/Data/Typeable.hs
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module: Instances.Data.Typeable Copyright: (C) 2014-2015 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Stability: Experimental Portability: GHC 'Arbitrary' instances for data types in the "Data.Typeable" module....
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module: Instances.Data.Typeable Copyright: (C) 2014-2015 Ryan Scott License: BSD-style (see the file LICENSE) Maintainer: Ryan Scott Stability: Experimental Portability: GHC 'Arbitrary' instances for data types in the "Data.Typeable" module....
Make sure <$> is in scope, pt. 2
Make sure <$> is in scope, pt. 2
Haskell
bsd-3-clause
RyanGlScott/text-show
af4b28e52b70f940f7ae5429f7ba9c06a8f1b391
Main.hs
Main.hs
module Main where import Idris.Core.TT import Idris.AbsSyntax import Idris.ElabDecls import Idris.REPL import IRTS.Compiler import IRTS.CodegenLLVM import System.Environment import System.Exit import Paths_idris data Opts = Opts { inputs :: [FilePath], output :: FilePath } showUsage = do putStr...
module Main where import Idris.Core.TT import Idris.AbsSyntax import Idris.ElabDecls import Idris.REPL import IRTS.Compiler import IRTS.CodegenLLVM import qualified IRTS.CodegenCommon as CG import LLVM.General.Target import System.Environment import System.Exit import Paths_idris data Opts = Opts { inputs :: [Fil...
Make the codegen actually work
Make the codegen actually work
Haskell
bsd-3-clause
melted/idris-llvm,melted/idris-llvm,idris-hackers/idris-llvm,idris-hackers/idris-llvm
740a0a397b8cebf85e92d3d6560784a71d332506
src/Main.hs
src/Main.hs
import System.Environment import Parser import Eval import Expr main :: IO () main = getArgs >>= handleArgs . getFirst where getFirst args = if null args then "" else head args handleArgs args = case args of "--ast" -> parseAst _ -> parseExpr -- ...
import System.Environment import Parser import Eval import Expr main :: IO () main = getArgs >>= handleArgs . getFirst where getFirst args = if null args then "" else head args handleArgs args = case args of "--ast" -> parseAst _ -> parseExpr -- ...
Remove extra `map` from `readExpr`
Remove extra `map` from `readExpr`
Haskell
mit
apollo-lang/apollo
70e7c669b0426a93ad8c68977eafd4a80da57676
Tests/TestSuite.hs
Tests/TestSuite.hs
-- module Tests.TestSuite(main) where import System.Exit (exitFailure) import qualified Tests.RoundTrip as RT import qualified Tests.Syntax as SY -- import qualified Tests.Embed as E import Test.HUnit -- master test suite allTests :: Test allTests = test [ RT.allTests, SY.allTests -- E.allTests ] ...
-- module Tests.TestSuite(main) where import System.Exit (exitFailure) import qualified Tests.RoundTrip as RT import qualified Tests.Syntax as SY import qualified Tests.Relationships as RE -- import qualified Tests.Embed as E import Test.HUnit -- master test suite allTests :: Test allTests = test [ RT.allTests...
Add new distribution relationships tests to Test Suite
Add new distribution relationships tests to Test Suite
Haskell
bsd-3-clause
zaxtax/hakaru,zaxtax/hakaru,zachsully/hakaru,suhailshergill/hakaru,zachsully/hakaru,bitemyapp/hakaru
b4950c4c66eaf11181a34cc4e2c7f1d6b22e67a6
haskell/leap/src/LeapYear.hs
haskell/leap/src/LeapYear.hs
module LeapYear (isLeapYear) where isLeapYear :: Integer -> Bool isLeapYear year = undefined
module LeapYear (isLeapYear) where isLeapYear :: Integer -> Bool isLeapYear year = integerDivision 4 && (not . integerDivision) 100 || integerDivision 400 where integerDivision = (0 ==) . (mod year)
Solve Leap Year in Haskell
Solve Leap Year in Haskell
Haskell
mit
parkertm/exercism
454d0d640fb128ea52b9d08bf6cb4fe922f63136
src/Kornel/LineHandler.hs
src/Kornel/LineHandler.hs
module Kornel.LineHandler ( HandlerRaw , HandlerPrivmsg , onlyPrivmsg , onlyPrivmsgRespondWithNotice ) where import qualified Irc.Commands as I import qualified Irc.Identifier as I import qualified Irc.Message as I import qualified Irc.RawIrcMsg as I import qualified Irc.UserInfo as I import ...
module Kornel.LineHandler ( HandlerRaw , HandlerPrivmsg , onlyPrivmsg , onlyPrivmsgRespondWithNotice ) where import qualified Data.Text as T import qualified Irc.Commands as I import qualified Irc.Identifier as I import qualified Irc.Message as I import qualified Irc.RawIrcMsg as I import qualifie...
Split HandlerPrivmsg response on '\n'
Split HandlerPrivmsg response on '\n'
Haskell
apache-2.0
michalrus/kornel
18e42c9794d5fd73136de87a531bdfcf8aaf47b2
src/Tuura/Synthesis.hs
src/Tuura/Synthesis.hs
module Tuura.Synthesis (synthesis, SynthesisType (..), unloadController) where import Tuura.Formula data SynthesisType = Controller | CPOG synthesis :: SynthesisType -> IO [Formula] synthesis Controller = generateController synthesis CPOG = generateCPOG unloadCon...
module Tuura.Synthesis (synthesis, SynthesisType (..), unloadController) where import Tuura.Formula module Tuura.Synthesis (synthesis, SynthesisType (..), unloadController) where import Tuura.Formula data SynthesisType = Controller | CPOG synthesis...
Move synthesis bits from Formula
Move synthesis bits from Formula
Haskell
bsd-3-clause
allegroCoder/scenco-1,allegroCoder/SCENCOh
6bac8424727106b2d3a5f7c0649c832ba0209aa4
app/main.hs
app/main.hs
import Application (makeApplication) import Prelude (IO) import Prelude (Bool(..)) import Settings (parseExtra) import Yesod.Default.Config (fromArgs) import Yesod.Default.Main (defaultMainLog) main :: IO () main = defaultMainLog (fromArgs parseExtra) (makeApplication False)
import Application (makeApplication) import Prelude (Bool(..), IO, elem, putStrLn) import Settings (parseExtra) import Yesod.Default.Config (fromArgs) import Yesod.Default.Main (defaultMainLog) import System.Environment (getArgs) main :: IO () main = do args <- getArgs if "--summary" `elem` args then p...
Support for --summary (pinging @DanBurton)
Support for --summary (pinging @DanBurton)
Haskell
mit
fpco/stackage-server
89d9b762a09a0a43732149a658bcc05cc6f85b74
tests/WikiTest.hs
tests/WikiTest.hs
{-# LANGUAGE OverloadedStrings #-} module WikiTest ( wikiSpecs ) where import Prelude import TestImport import Model.Language wikiSpecs :: Spec wikiSpecs = -- FIXME: This only works because it uses leftover database state from -- earlier tests. ydescribe "wiki" $ do yit "Unestablished u...
{-# LANGUAGE OverloadedStrings #-} module WikiTest ( wikiSpecs ) where import Prelude import TestImport import Model.Language wikiSpecs :: Spec wikiSpecs = -- FIXME: This only works because it uses leftover database state from -- earlier tests. ydescribe "wiki" $ do yit "Unestablished u...
Add test for SD-174 fix
Add test for SD-174 fix
Haskell
agpl-3.0
akegalj/snowdrift,snowdriftcoop/snowdrift,akegalj/snowdrift
af1efd0e8ea420875fa998586ac27911d2f3ae1b
src/Main.hs
src/Main.hs
-- Temporary main. module Main ( main ) where import qualified Data.Map as Map import Data.Map (Map) import System.Exit import System.IO import Text.Parsec import Compiler.Parser import Compiler.Pretty import Compiler.Transform import Compiler.TypeChecking.Context import Compiler.TypeChecking.Infer ...
-- Temporary main. module Main ( main ) where import qualified Data.Map as Map import Data.Map (Map) import Data.Maybe import Options.Applicative import System.Exit import System.IO import Text.Parsec import Compiler.Parser import Compiler.Pretty import Compiler.Transform import Compiler.TypeCheckin...
Use the parser in 'main'.
Use the parser in 'main'.
Haskell
bsd-3-clause
vituscze/norri
6d33d18002d6acc7ae2e38ad8bd2f4df58763335
Forms.hs
Forms.hs
-- Junk drawer for slow to compile TH stuff module Forms where import Import import Data.Time.Format (parseTimeM) import Yesod.Form.Bootstrap3 yearField :: Field Handler UTCTime yearField = Field { fieldParse = \vals _ -> case vals of [t] -> return $ case parseTimeM True defaultTimeLocale "%Y" (unpack t) of ...
-- Junk drawer for slow to compile TH stuff module Forms where import Import import Data.Time.Format (parseTimeM) import Yesod.Form.Bootstrap3 yearField :: Field Handler UTCTime yearField = Field { fieldParse = \vals _ -> case vals of [t] -> return $ case parseTimeM True defaultTimeLocale "%Y" (unpack t) of ...
Set required properly in custom fields
Set required properly in custom fields
Haskell
agpl-3.0
enolan/emp-pl-site
420744124e879dc69032daa9af895387d7a56bdb
test/Uroboro/CheckerSpec.hs
test/Uroboro/CheckerSpec.hs
module Uroboro.CheckerSpec ( spec ) where import Test.Hspec import Uroboro.Syntax import Uroboro.Checker library :: Library library = [ DataDefinition "D" [Signature "c" ["T"] "D"] , FunctionDefinition (Signature "f" ["T"] "T") [Rule (Hole [VariablePattern "x"]) (Variable "x")] ,...
module Uroboro.CheckerSpec ( spec ) where import Test.Hspec import Uroboro.Syntax import Uroboro.Checker library :: Library library = [ DataDefinition "D" [Signature "c" ["T"] "D"] , FunctionDefinition (Signature "f" ["T"] "T") [Rule (Hole [VariablePattern "x"]) (Variable "x")] ,...
Work around syntax error (probably DO nesting)
Work around syntax error (probably DO nesting)
Haskell
mit
tewe/uroboro,Toxaris/uroboro,lordxist/uroboro
d8b33c96b69f0e9cc7f315b341a29d6d2bdfa2a6
Keter/TempFolder.hs
Keter/TempFolder.hs
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Keter.TempFolder ( TempFolder , setup , getFolder ) where import Keter.Prelude import Data.Word (Word) import Keter.Postgres (Appname) import qualified Data.IORef ...
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Keter.TempFolder ( TempFolder , setup , getFolder ) where import Keter.Prelude import Data.Word (Word) import Keter.Postgres (Appname) import qualified Data.IORef ...
Remove another usage of encode
Remove another usage of encode
Haskell
mit
andrewthad/keter,ajnsit/keter,tolysz/keter,ajnsit/keter,snoyberg/keter,andrewthad/keter,creichert/keter,mwotton/keter,telser/keter,snoyberg/keter,tolysz/keter,bermanjosh/keter,mwotton/keter,creichert/keter,bermanjosh/keter,telser/keter
5f1f53da2e80f249b25c6ba8b8453ad6451e1a18
src/Test/Util.hs
src/Test/Util.hs
-- | Test utility functions module Test.Util(utilsTests) where import Test.Tasty import Test.Tasty.HUnit import Language.Haskell.Ghcid.Util import Language.Haskell.Ghcid.Escape utilsTests :: TestTree utilsTests = testGroup "Utility tests" [dropPrefixTests ,chunksOfWordTests ] dropPrefixTests :: TestTree...
-- | Test utility functions module Test.Util(utilsTests) where import Test.Tasty import Test.Tasty.HUnit import Language.Haskell.Ghcid.Util import Language.Haskell.Ghcid.Escape utilsTests :: TestTree utilsTests = testGroup "Utility tests" [dropPrefixTests ,wordWrapTests ] dropPrefixTests :: TestTree dro...
Rename the word wrap tests
Rename the word wrap tests
Haskell
bsd-3-clause
ndmitchell/ghcid
b31fe3089b4a1201ad32ebfc1316a692a4b91b30
src/Jana/Invert.hs
src/Jana/Invert.hs
module Jana.Invert where import Jana.Ast invertMain :: ProcMain -> ProcMain invertMain (ProcMain vdecls body pos) = ProcMain vdecls (invertStmts body) pos invertProc :: Proc -> Proc invertProc proc = proc { body = invertStmts $ body proc } invertStmts :: [Stmt] -> [Stmt] invertStmts = reverse . map invertStmt inv...
module Jana.Invert where import Jana.Ast invertMain :: ProcMain -> ProcMain invertMain (ProcMain vdecls body pos) = ProcMain vdecls (invertStmts body) pos invertProc :: Proc -> Proc invertProc proc = proc { body = invertStmts $ body proc } invertStmts :: [Stmt] -> [Stmt] invertStmts = reverse . map invertStmt inv...
Implement inversion of print statements
Implement inversion of print statements
Haskell
bsd-3-clause
mbudde/jana,mbudde/jana,tyoko-dev/jana,tyoko-dev/jana,mbudde/jana,tyoko-dev/jana,tyoko-dev/jana,mbudde/jana
6b85dfa6c2c564de1041d0512ca1e3ee2a0bc0cf
src/PostgRESTWS.hs
src/PostgRESTWS.hs
module PostgRESTWS ( postgrestWsApp ) where import qualified Network.Wai as Wai import qualified Network.WebSockets as WS import qualified Network.Wai.Handler.WebSockets as WS import PostgREST.App as PGR import PostgREST.Config as PGR import PostgR...
module PostgRESTWS ( postgrestWsApp ) where import qualified Network.Wai as Wai import qualified Network.WebSockets as WS import qualified Network.Wai.Handler.WebSockets as WS import PostgREST.App as PGR import PostgREST.Config as PGR import PostgR...
Put basic types in place to create a session recorder and a player
Put basic types in place to create a session recorder and a player
Haskell
mit
diogob/postgrest-ws,diogob/postgrest-ws,diogob/postgrest-ws
ebb16f6d4eec8bea8e09f3e483f0a0c463325e4b
test/Spec.hs
test/Spec.hs
module Main (main) where import Test.Tasty import Test.Tasty.Hspec import Test.Tasty.Ingredients.Basic import Test.Tasty.Runners.AntXML main :: IO () main = do theSpecs <- testSpec "Specs" specs defaultMainWithIngredients (antXMLRunner:defaultIngredients) theSpecs specs :: Spec specs = do describe "A test" $ d...
module Main (main) where import Test.Tasty import Test.Tasty.Hspec import Test.Tasty.Ingredients.Basic import Test.Tasty.Runners.AntXML main :: IO () main = do theSpecs <- testSpec "Specs" specs defaultMainWithIngredients (antXMLRunner:defaultIngredients) theSpecs specs :: Spec specs = do describe "A test" $ d...
Make it pass to try and trigger the update
Make it pass to try and trigger the update
Haskell
bsd-3-clause
cdodev/scintilla
b7637a5bcdd3af91cd45c977ccfecf36c142e9b0
site/udon.hs
site/udon.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Arrow ((>>>)) import Control.Monad (forM_) import Hakyll main :: IO () main = hakyll $ do -- Read templates compile "templates/*" templateCompiler -- Compress CSS route "css/*" idRoute compile "css/*" compressCssCompiler ...
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Arrow ((>>>)) import Control.Monad (forM_) import Hakyll main :: IO () main = hakyll $ do -- Read templates match "templates/*" $ compile templateCompiler -- Compress CSS match "css/*" $ do route idRoute compil...
Update site for new routing style in Hakyll 3.1.
Update site for new routing style in Hakyll 3.1.
Haskell
bsd-3-clause
beastaugh/udon,beastaugh/udon
85149a391499617f974a64d398e25957c8f5aa1f
app/Block/Views.hs
app/Block/Views.hs
{-# LANGUAGE OverloadedStrings #-} module Block.Views where import Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes as Ha import Database.Persist.Postgresql import Control.Monad (forM_) import Common.Views import Schema import Time uploadBlockConfigPage :: UTCTime -> Html uploadBlockConfigPage uploadDate = l...
{-# LANGUAGE OverloadedStrings #-} module Block.Views where import Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes as Ha import Database.Persist.Postgresql import Control.Monad (forM_) import Common.Views import Schema import Time uploadBlockConfigPage :: UTCTime -> Html uploadBlockConfigPage uploadDate = l...
Fix indentation in block view
Fix indentation in block view
Haskell
bsd-3-clause
hectorhon/autotrace2,hectorhon/autotrace2
ddaf4519ce27db3f9fcef2b73c63e7b0fb96cfe2
src/System/Taffybar/Widget/NetworkGraph.hs
src/System/Taffybar/Widget/NetworkGraph.hs
module System.Taffybar.Widget.NetworkGraph where import qualified GI.Gtk import System.Taffybar.Context import System.Taffybar.Hooks import System.Taffybar.Information.Network import System.Taffybar.Widget.Generic.ChannelGraph import System.Taffybar.Widget.Generic.Graph logScale :: Double -> Double -> Double -> Doubl...
module System.Taffybar.Widget.NetworkGraph where import Control.Monad import qualified GI.Gtk import GI.Gtk.Objects.Widget (widgetSetTooltipMarkup) import System.Taffybar.Context import System.Taffybar.Hooks import System.Taffybar.Information.Network import System.Taffybar.Util (postGUIASync) import System.Taffybar.Wi...
Add tooltip to network graph.
Add tooltip to network graph.
Haskell
bsd-3-clause
teleshoes/taffybar
99ee6a70a78094258edebeec79dceedc425d1d30
test/UniverseSpec.hs
test/UniverseSpec.hs
module UniverseSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import Abyme.Universe import Abyme.Universe.Generate import Abyme.Universe.Normalise import Abyme.Addressing import Abyme.Chunk spec :: Spec spec = do describe "addressing" $ do prop "square occupies its location" $ \u -> do ...
module UniverseSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck.Property import Abyme.Universe import Abyme.Universe.Generate import Abyme.Universe.Normalise import Abyme.Addressing import Abyme.Chunk spec :: Spec spec = do describe "addressing" $ do prop "square occupies...
Print counterexamples when properties fail
Print counterexamples when properties fail
Haskell
bsd-3-clause
mvr/abyme
a21a646af2231224ee6ec5a4d2363edeb776754c
src/Cryptol/Prelude.hs
src/Cryptol/Prelude.hs
-- | -- Module : $Header$ -- Copyright : (c) 2015 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable -- -- Include the prelude when building with -fself-contained {-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-} module Cryptol.Pr...
-- | -- Module : $Header$ -- Copyright : (c) 2015 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable -- -- Include the prelude when building with -fself-contained {-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE Overl...
Enable OverloadedStrings to fix a build error
Enable OverloadedStrings to fix a build error
Haskell
bsd-3-clause
GaloisInc/cryptol,GaloisInc/cryptol,GaloisInc/cryptol
a91256049fac6d6438d4979ced2eaf174390dfd7
Distribution/Server/Util/Happstack.hs
Distribution/Server/Util/Happstack.hs
{-| Functions and combinators to expose functioanlity buiding on happstack bit is not really specific to any one area of Hackage. -} module Distribution.Server.Util.Happstack ( remainingPath, remainingPathString, mime ) where import Happstack.Server import qualified Happstack.Server.SURI as SURI impo...
{-| Functions and combinators to expose functioanlity buiding on happstack bit is not really specific to any one area of Hackage. -} module Distribution.Server.Util.Happstack ( remainingPath, remainingPathString, mime ) where import Happstack.Server import qualified Happstack.Server.SURI as SURI impo...
Fix build error, probably from the Either/Error patch
Fix build error, probably from the Either/Error patch
Haskell
bsd-3-clause
grayjay/hackage-server,edsko/hackage-server,tkvogt/hackage-server,edsko/hackage-server,erantapaa/hackage-server,ocharles/hackage-server,erantapaa/hackage-server,ocharles/hackage-server,chrisdotcode/hackage-server,haskell-infra/hackage-server,dzackgarza/hackage-server,agrafix/hackage-server,dzackgarza/hackage-server,gra...
828449c4ebd93f2be926c10911e4ec5d8e5478b8
site/site.hs
site/site.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Arrow ((>>>)) import Control.Monad (forM_) import Hakyll main :: IO () main = hakyll $ do -- Compress CSS route "css/*" idRoute compile "css/*" compressCssCompiler -- Read templates compile "templates/*" templateCompiler ...
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Arrow ((>>>)) import Control.Monad (forM_) import Hakyll main :: IO () main = hakyll $ do -- Compress CSS match "css/*.css" $ do route idRoute compile compressCssCompiler -- Read templates match "templates/*" $...
Update Hakyll file for new routing style in 3.1.
Update Hakyll file for new routing style in 3.1.
Haskell
bsd-3-clause
beastaugh/firmin,beastaugh/firmin,beastaugh/firmin
57c07536dd59595ec4cbcce24f0e6352e99a82c6
tests/Network/BitTorrent/Exchange/SessionSpec.hs
tests/Network/BitTorrent/Exchange/SessionSpec.hs
{-# LANGUAGE RecordWildCards #-} module Network.BitTorrent.Exchange.SessionSpec (spec) where import Test.Hspec import Data.Torrent import Network.BitTorrent.Core import Network.BitTorrent.Exchange.Session import Config nullLogger :: LogFun nullLogger _ _ x _ = print x spec :: Spec spec = do describe "metadata ex...
{-# LANGUAGE RecordWildCards #-} module Network.BitTorrent.Exchange.SessionSpec (spec) where import Test.Hspec import Data.Torrent import Network.BitTorrent.Core import Network.BitTorrent.Exchange.Session import Config nullLogger :: LogFun nullLogger _ _ x _ = print x simpleSession :: InfoDict -> (Session -> IO ()...
Add exchange session spec stubs
Add exchange session spec stubs
Haskell
bsd-3-clause
DavidAlphaFox/bittorrent,pxqr/bittorrent
8367d7adc636e7cf2aaea5a096e1bfe7bc50110c
Algorithms/GraphTheory/Matrix/Haskell/Main.hs
Algorithms/GraphTheory/Matrix/Haskell/Main.hs
import System.Environment import Control.Applicative import Control.Monad inputFile :: IO (FilePath) inputFile = head <$> getArgs outputFile :: IO (FilePath) outputFile = flip (!!) 1 <$> getArgs main :: IO () main = let content = readFile =<< inputFile in join $ writeFile <$> outputFile <*> content
import System.Environment import Control.Applicative import Control.Monad import Data.Word -- Type definitions newtype City a = City a maxCities :: Word maxCities = 100000 minCities :: Word minCities = 2 toCity :: (Word a, Ord a) => a -> a -> City a toCity city numCities | city < minCities = error "The number of ...
Save work on bounds checking
Save work on bounds checking
Haskell
mit
josiah14/hackerrank,josiah14/hackerrank,josiah14/hackerrank,josiah14/hackerrank,josiah14/hackerrank
3e0d32e1a22865686ebb934a892000625e8e6421
Setup.hs
Setup.hs
#!/usr/bin/env runhaskell import Distribution.Simple import Distribution.Simple.Setup import Distribution.PackageDescription import System.Directory (createDirectoryIfMissing) import System.Process (readProcess) -- Adapted from -- http://www.hyperedsoftware.com/blog/entries/build-info-gen.html by -- Võ Minh Thu. mai...
#!/usr/bin/env runhaskell import Distribution.Simple import Distribution.Simple.Setup import Distribution.PackageDescription import Distribution.Simple.BuildPaths import Distribution.Simple.LocalBuildInfo import System.Directory (createDirectoryIfMissing) import System.Process (readProcess) -- Adapted from -- http://...
Fix generation of the Futhark_build module.
Fix generation of the Futhark_build module. This is now done as a post-configuration rather than as a pre-build step. The main improvement is that we can now build in a Cabal sandbox (I hope).
Haskell
isc
ihc/futhark,mrakgr/futhark,diku-dk/futhark,mrakgr/futhark,HIPERFIT/futhark,diku-dk/futhark,HIPERFIT/futhark,ihc/futhark,CulpaBS/wbBach,mrakgr/futhark,diku-dk/futhark,ihc/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark
35e3ddfaa492bfe4af8e64e079da0a8a3bb1a84a
src/hfold/Parser.hs
src/hfold/Parser.hs
module Hfold.Parser where import Data.Monoid ((<>)) import Data.Text (Text) import qualified Data.Text as T import Text.ParserCombinators.Parsec import Hfold.Types parseFile :: Text -> [Content] parseFile t = case parse parseContent "content" (T.unpack t) of Left err -> [] Right xs -> xs parseContent :: Par...
module Hfold.Parser where import Data.Monoid ((<>)) import Data.Text (Text) import qualified Data.Text as T import Text.ParserCombinators.Parsec import Hfold.Types parseFile :: Text -> [Content] parseFile t = case parse parseContent "content" (T.unpack t) of Left err -> [] Right xs -> xs parseContent :: Par...
Use applicative style for parseContent
Use applicative style for parseContent so pretty
Haskell
mit
gfontenot/reflow
a46ace61d5a6ed7b6b4ccc1c849d3082fe036003
src/Kafka/Callbacks.hs
src/Kafka/Callbacks.hs
module Kafka.Callbacks ( errorCallback , logCallback , statsCallback ) where import Kafka.Internal.RdKafka (rdKafkaConfSetErrorCb, rdKafkaConfSetLogCb, rdKafkaConfSetStatsCb) import Kafka.Internal.Setup (HasKafkaConf(..), getRdKafkaConf) import Kafka.Types (KafkaError(..)) errorCallback :: HasKafkaConf k => (KafkaErr...
module Kafka.Callbacks ( errorCallback , logCallback , statsCallback ) where import Kafka.Internal.RdKafka (rdKafkaConfSetErrorCb, rdKafkaConfSetLogCb, rdKafkaConfSetStatsCb) import Kafka.Internal.Setup (HasKafkaConf(..), getRdKafkaConf) import Kafka.Types (KafkaError(..), KafkaLogLevel(..)) -- | Add a callback for e...
Change log callback log level to KafkaLogLevel
feat(callback): Change log callback log level to KafkaLogLevel * Int becomes KafkaLogLevel (breaking changes) * Add documentation for callbacks Closes #135
Haskell
mit
haskell-works/kafka-client
cf5f43bb04ae1954bc806e3bec0c1a9ee0821d57
benchmark/Snap/Internal/Http/Parser/Benchmark.hs
benchmark/Snap/Internal/Http/Parser/Benchmark.hs
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE ScopedTypeVariables #-} module Snap.Internal.Http.Parser.Benchmark ( benchmarks ) where import Control.Monad import Criterion.Main hiding (run) import q...
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE ScopedTypeVariables #-} module Snap.Internal.Http.Parser.Benchmark ( benchmarks ) where import Control.Monad import qualified Criterion.Main as C import qualified...
Fix incorrect criterion module hiding
Fix incorrect criterion module hiding
Haskell
bsd-3-clause
23Skidoo/snap-server,snapframework/snap-server,sopvop/snap-server,snapframework/snap-server,snapframework/snap-server,23Skidoo/snap-server,sopvop/snap-server,23Skidoo/snap-server
b20fc9667f4bcba0dca8782a53bb2e4e09f8ca07
tests/tasty.hs
tests/tasty.hs
{-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Main where #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif import Data.Monoid (Sum(..)) import Test.SmallCheck.Series (Serial(series), Series) import Test.Tasty (defaultMain, testGroup) import...
{-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Main where #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif import Data.Monoid (Sum(..), Product(..)) import Test.SmallCheck.Series (Serial(series), Series) import Test.Tasty (defaultMain, testG...
Add more Monoid laws tests
Add more Monoid laws tests
Haskell
bsd-3-clause
jdnavarro/tasty-laws,jdnavarro/smallcheck-laws
5b8be193297f37f86f97adb62766e6bba80820de
graphql-wai/src/GraphQL/Wai.hs
graphql-wai/src/GraphQL/Wai.hs
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} module GraphQL.Wai ( toApplication ) where import Protolude import GraphQL (interpretAnonymousQuery) import GraphQL.Resolver (HasResolver, Handler) import Network.Wai (Application, queryString, responseLBS...
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Basic WAI handlers for graphql-api module GraphQL.Wai ( toApplication ) where import Protolude import GraphQL (interpretAnonymousQuery) import GraphQL.API (HasObjectDefinition) import GraphQL.Resolver...
Update WAI for new API
Update WAI for new API
Haskell
bsd-3-clause
jml/graphql-api
f1281ff752566fb20d1f700f875a56ce020db10f
demo/sourceview/SourceViewTest.hs
demo/sourceview/SourceViewTest.hs
-- Test file for the SourceView widget. module Main where import Graphics.UI.Gtk import Graphics.UI.Gtk.SourceView main = do initGUI win <- windowNew win `onDestroy` mainQuit -- create the appropriate language lm <- sourceLanguagesManagerNew langM <- sourceLanguagesManagerGetLanguageFromMimeType lm "text...
-- Test file for the SourceView widget. module Main where import Graphics.UI.Gtk import Graphics.UI.Gtk.SourceView main = do initGUI win <- windowNew win `onDestroy` mainQuit -- create the appropriate language lm <- sourceLanguageManagerNew langM <- sourceLanguageManagerGetLanguage lm "haskell" lang <-...
Make sourceview demo compilable again.
Make sourceview demo compilable again.
Haskell
lgpl-2.1
gtk2hs/webkit,gtk2hs/vte,gtk2hs/webkit,gtk2hs/gstreamer,gtk2hs/webkit,gtk2hs/vte
cc8d2bf75ebf27c7d8f6aada709937e255566f22
Models/Readable.hs
Models/Readable.hs
module Models.Readable where import Import hiding (on, (==.)) import Control.Lens hiding (from) import Data.Aeson import Database.Esqueleto hiding ((^.)) import qualified Database.Esqueleto as E chartData :: [Record] -> Text chartData records = decodeUtf8 $ toStrict $ encode $ map encoder records where encoder ...
module Models.Readable where import Import hiding (on, (==.)) import Control.Lens hiding (from) import Data.Aeson import Database.Esqueleto hiding ((^.)) import qualified Database.Esqueleto as E chartData :: [Record] -> Text chartData records = decodeUtf8 $ toStrict $ encode $ map encoder records where encoder ...
Fix LEFT JOINs to not filter out empty rows
Fix LEFT JOINs to not filter out empty rows
Haskell
mit
darthdeus/reedink,darthdeus/reedink
313300b8bd343ab676fa2faece9c3d697f3bce1b
System/Hardware/Haskino/SamplePrograms/BlinkE.hs
System/Hardware/Haskino/SamplePrograms/BlinkE.hs
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Haskino.SamplePrograms.Blink -- Based on System.Hardware.Arduino -- Copyright : (c) University of Kansas -- License : BSD3 -- Stability : experimental -- -- The /hello world/ ...
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Haskino.SamplePrograms.Blink -- Based on System.Hardware.Arduino -- Copyright : (c) University of Kansas -- License : BSD3 -- Stability : experimental -- -- The /hello world/ ...
Use readRemoteRef to convert Ref to Expr.
Use readRemoteRef to convert Ref to Expr.
Haskell
bsd-3-clause
ku-fpg/kansas-amber,ku-fpg/arduino-lab,ku-fpg/arduino-lab,ku-fpg/kansas-amber
5ac9833eadec18a4c881812ea08ba5e7ac83f4f4
haskell/APIServer.hs
haskell/APIServer.hs
{-# LANGUAGE OverloadedStrings #-} import Network.Wai import Network.Wai.Handler.Warp (run) import Network.HTTP.Types (status200) import qualified Data.ByteString.Lazy as LB import qualified Data.ByteString.Lazy.Char8 as LBC import Control.Monad.IO.Class (liftIO) import BT.Routing import BT.Global import BT.Types impor...
{-# LANGUAGE OverloadedStrings #-} import Network.Wai import Network.Wai.Handler.Warp (run) import Network.HTTP.Types (status200) import qualified Data.ByteString.Lazy as LB import qualified Data.ByteString.Lazy.Char8 as LBC import Control.Monad.IO.Class (liftIO) import BT.Routing import BT.Global import BT.Types impor...
Put error on both stderr and stdout
Put error on both stderr and stdout
Haskell
mit
c00w/BitToll,c00w/BitToll,c00w/BitToll,c00w/BitToll
0c12f847a30c7a34ce5e1d193ef05ce49739ec13
haskell/Util.hs
haskell/Util.hs
module Util ( is_int_literal, is_bool_literal, map_many_on_one ) where import qualified Data.Char as Char bools = ["true", "false"] is_int_literal string = if head string == '-' then are_digits $ tail string else are_digits string are_digits string = all Char.isDigit string ...
module Util ( is_int_literal, is_bool_literal, map_many_on_one ) where import qualified Data.Char as Char bools = ["true", "false"] is_int_literal ('-':string) = are_digits string is_int_literal string = are_digits string are_digits [] = False are_digits string = all Char.isDigit string is_...
Fix is_int_literal to not accept '-' or ''
Fix is_int_literal to not accept '-' or ''
Haskell
mit
quintenpalmer/fresh
6ed3feac4fa65ad23ac3a21dff8333e82f73a775
test/System/GPIOSpec.hs
test/System/GPIOSpec.hs
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module System.GPIOSpec (spec) where import Control.Monad.Except import qualified Data.Map as Map import qualified Data.Set as Set import System.GPIO.Free import System.GPIO.Mock import Test.Hspec testOpenClose :: (MonadError String m) => (GpioT St...
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module System.GPIOSpec (spec) where import Control.Monad.Except import qualified Data.Map as Map import qualified Data.Set as Set import System.GPIO.Free import System.GPIO.Mock import Test.Hspec testOpenClose :: (MonadError String m) => (GpioT St...
Add tests for Mock getDirection/setDirection.
Add tests for Mock getDirection/setDirection.
Haskell
bsd-3-clause
dhess/gpio
0c0f9e4f6e5c99dd4e8bd2d9438024bb8f2368a2
src/Main.hs
src/Main.hs
module Main where import Options.Applicative ((<$>), (<*>), (<>), Parser, ParserInfo) import qualified Options.Applicative as O data Options = Options { optInputFiles :: [FilePath], optTimeLimit :: Int, optMemoryLimit :: Int, optPowerPhrases :: [String]} deriving (Show) parseOptions :: Parser Opt...
module Main where import Options.Applicative ((<$>), (<*>), (<>), Parser, ParserInfo) import qualified Options.Applicative as O data Options = Options { optInputFiles :: [FilePath], optTimeLimit :: Int, optMemoryLimit :: Int, optCoreCount :: Int, optPowerPhrases :: [String]} deriving (Show) p...
Support specifying the number of processor cores
Support specifying the number of processor cores
Haskell
bsd-3-clause
blax/icfp-contest-2015,mietek/icfp-contest-2015
e60dbf30adfcc0ba90ed9271239c0c8a7bc14f06
testsuite/tests/typecheck/should_compile/T10348.hs
testsuite/tests/typecheck/should_compile/T10348.hs
{-# LANGUAGE AutoDeriveTypeable, GADTs, DataKinds, KindSignatures, StandaloneDeriving #-} module T10348 where import GHC.TypeLits import Data.Typeable data Foo (n :: Nat) where Hey :: KnownNat n => Foo n deriving instance Show (Foo n) data T t where T :: (Show t, Typeable t) => t -> T t deriving instance Show...
{-# LANGUAGE AutoDeriveTypeable, GADTs, DataKinds, KindSignatures, StandaloneDeriving, TypeOperators #-} module T10348 where import GHC.TypeLits import Data.Typeable import Data.Proxy data Foo (n :: Nat) where Hey :: KnownNat n => Foo n deriving instance Show (Foo n) data T t where T :: (Show t, Typeable t) =>...
Check KnownSymbol => Typeable deduction
Check KnownSymbol => Typeable deduction verifying fix for #10348
Haskell
bsd-3-clause
anton-dessiatov/ghc,nushio3/ghc,nushio3/ghc,ml9951/ghc,olsner/ghc,nkaretnikov/ghc,mfine/ghc,gridaphobe/ghc,olsner/ghc,sdiehl/ghc,olsner/ghc,mfine/ghc,ml9951/ghc,vTurbine/ghc,siddhanathan/ghc,tjakway/ghcjvm,nkaretnikov/ghc,wxwxwwxxx/ghc,sdiehl/ghc,ml9951/ghc,shlevy/ghc,siddhanathan/ghc,siddhanathan/ghc,sgillespie/ghc,ac...
61754ba8f6001025abaf81396bb640310ea9187a
parser-typechecker/src/Unison/Runtime/Debug.hs
parser-typechecker/src/Unison/Runtime/Debug.hs
module Unison.Runtime.Debug ( traceCombs , tracePretty , tracePrettyGroup ) where import Data.Word import qualified Unison.Term as Tm import Unison.Var (Var) import Unison.PrettyPrintEnv (PrettyPrintEnv) import Unison.TermPrinter (pretty) import Unison.Util.Pretty (toANSI) import Unison.Util.EnumContainers ...
module Unison.Runtime.Debug ( traceComb , traceCombs , tracePretty , tracePrettyGroup ) where import Data.Word import qualified Unison.Term as Tm import Unison.Var (Var) import Unison.PrettyPrintEnv (PrettyPrintEnv) import Unison.TermPrinter (pretty) import Unison.Util.Pretty (toANSI) import Unison.Util.En...
Add a runtime debugging function for single Combs
Add a runtime debugging function for single Combs
Haskell
mit
unisonweb/platform,unisonweb/platform,unisonweb/platform
f0bf7d6784359b1bfc93944116b8b63ad457943b
warp/test/RequestSpec.hs
warp/test/RequestSpec.hs
{-# LANGUAGE OverloadedStrings #-} module RequestSpec (main, spec) where import Data.Conduit import Data.Conduit.List import Network.Wai.Handler.Warp.Request import Network.Wai.Handler.Warp.Types import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = describe "takeHeaders" $ do it "takes until bl...
{-# LANGUAGE OverloadedStrings #-} module RequestSpec (main, spec) where import Data.Conduit import Data.Conduit.List import Network.Wai.Handler.Warp.Request import Network.Wai.Handler.Warp.Types import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = describe "takeHeaders" $ do it "takes until bl...
Add a test case for when the body starts with whitespace
Add a test case for when the body starts with whitespace
Haskell
mit
erikd/wai,dylex/wai,awpr/wai,tolysz/wai,beni55/wai,rgrinberg/wai,urbanslug/wai,erikd/wai,mfine/wai,jberryman/wai,beni55/wai,frontrowed/wai,ygale/wai,sol/wai,AndrewRademacher/wai,dylex/wai,urbanslug/wai,iquiw/wai,rgrinberg/wai,utdemir/wai,mfine/wai,yesodweb/wai,kazu-yamamoto/wai,erikd/wai,frontrowed/wai,soenkehahn/wai,i...
d2b0dd4e8af056b7a479c699be415912013334f8
src/Pos/Update/State/Global.hs
src/Pos/Update/State/Global.hs
{-# LANGUAGE TemplateHaskell #-} -- | Global state of Update System. Contains relevant summary of data -- stored in blocks. This state is stored in memory only. Another part -- is stored in GStateDB, see Pos.DB.GState. module Pos.Update.State.Global ( GlobalState (..) , HasGlobalState (globalState) ...
{-# LANGUAGE TemplateHaskell #-} -- | Global state of Update System. Contains relevant summary of data -- stored in blocks. This state is stored in memory only. Another part -- is stored in GStateDB, see Pos.DB.GState. module Pos.Update.State.Global ( GlobalState (..) , HasGlobalState (globalState) ...
Store more data in global state of US
[CSL-349] Store more data in global state of US
Haskell
apache-2.0
input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype
e4210d40b0fdd0d5e93da07bb0fc8305f16fff34
src/Plunge.hs
src/Plunge.hs
module Main where import Plunge.Parsers.PreprocessorOutput import Plunge.Types.PreprocessorOutput import Plunge.Preprocessor import Plunge.Analytics.C2CPP import Plunge.Printers.Analytics import Control.Monad import System.Environment import Text.Printf main :: IO () main = do fPath <- parseArguments cppResult ...
module Main where import Plunge.Parsers.PreprocessorOutput import Plunge.Preprocessor import Plunge.Analytics.C2CPP import Plunge.Printers.Analytics import Control.Monad import System.Environment main :: IO () main = do fPath <- parseArguments cppResult <- preprocessFile fPath [] case cppResult of Left er...
Drop the old layout mechanism.
Drop the old layout mechanism.
Haskell
bsd-3-clause
sw17ch/plunge,sw17ch/plunge
be58496c3b79a6974114c7ec88aad96fecce2d8c
travis.hs
travis.hs
import System.Time.Extra import System.Process.Extra import Control.Exception.Extra main :: IO () main = do let timed x = do putStrLn $ "\n\nSearching for " ++ x (time,_) <- duration $ system_ $ "hoogle +RTS -T -M1.8G -RTS " ++ (if x == "" then "" else show x) putStrLn $ "Search " ++ show...
import System.Time.Extra import System.Process.Extra import Control.Exception.Extra main :: IO () main = do let timed x = do putStrLn $ "\n\nSearching for " ++ x (time,_) <- duration $ system_ $ "hoogle +RTS -T -M1.8G -K2K -RTS " ++ (if x == "" then "" else show x) putStrLn $ "Search " ++...
Add -K2K to the test suite, prevent space leaks
Add -K2K to the test suite, prevent space leaks
Haskell
bsd-3-clause
ndmitchell/hoogle,ndmitchell/hoogle,ndmitchell/hoogle
83c73a2bd507915d2a655e5c6148ec92c8a9e9a5
src/Settings/Packages/GhcCabal.hs
src/Settings/Packages/GhcCabal.hs
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where import Base import Expression import GHC (ghcCabal) import Predicates (builderGhc, package, stage0) import Settings ghcCabalPackageArgs :: Args ghcCabalPackageArgs = package ghcCabal ? mconcat [ builderGhc ? mconcat [ ghcCabalBootArgs ...
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where import Base import Expression import GHC (ghcCabal) import Predicates (builderGhc, package, stage0) import Settings ghcCabalPackageArgs :: Args ghcCabalPackageArgs = package ghcCabal ? mconcat [ builderGhc ? mconcat [ ghcCabalBootArgs ...
Make ghc-cabal build parallel .
Make ghc-cabal build parallel [skip ci].
Haskell
bsd-3-clause
snowleopard/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,snowleopard/hadrian,sdiehl/ghc,izgzhen/hadrian,bgamari/shaking-up-ghc,quchen/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc
69317c735b580599688125deb29e2c2d0224d4b6
testsuite/tests/polykinds/T7488.hs
testsuite/tests/polykinds/T7488.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE GADTs #-} module T7488 where newtype A = A Int data B (x :: A)
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE GADTs #-} module T7488 where newtype A = A Bool data B (x :: A)
Adjust test; Int is not promotable
Adjust test; Int is not promotable
Haskell
bsd-3-clause
siddhanathan/ghc,AlexanderPankiv/ghc,oldmanmike/ghc,wxwxwwxxx/ghc,gridaphobe/ghc,da-x/ghc,ghc-android/ghc,olsner/ghc,da-x/ghc,wxwxwwxxx/ghc,olsner/ghc,mettekou/ghc,acowley/ghc,TomMD/ghc,fmthoma/ghc,lukexi/ghc,christiaanb/ghc,sgillespie/ghc,TomMD/ghc,acowley/ghc,ml9951/ghc,TomMD/ghc,olsner/ghc,holzensp/ghc,tjakway/ghcjv...
5fd2e2f8b25a05bc33c650acd65a26283d5acf60
Text/PrettyPrint/ANSI/Example.hs
Text/PrettyPrint/ANSI/Example.hs
module Main (main) where import Text.PrettyPrint.ANSI.Leijen import System.IO main :: IO () main = do -- Going directly to the console is portable across Unix and Windows... putDoc $ red (text "Red") <> text "," <+> white (text "white") <+> text "and" <+> blue (text "blue") <> char '!' <> linebreak putD...
module Main (main) where import Text.PrettyPrint.ANSI.Leijen import System.IO main :: IO () main = do -- Going directly to the console is portable across Unix and Windows... putDoc $ red (text "Red") <> comma <+> white (text "white") <+> text "and" <+> blue (text "blue") <> char '!' <> linebreak putDoc ...
Replace some explicit commas with a use of the combinator in the example
Replace some explicit commas with a use of the combinator in the example
Haskell
bsd-2-clause
hvr/ansi-wl-pprint,quchen/prettyprinter,quchen/prettyprinter,seereason/ansi-wl-pprint,nwf/ansi-wl-pprint,batterseapower/ansi-wl-pprint
ecd5d3232644657b21b1716610a045410c0c01ba
test-report.hs
test-report.hs
#! /bin/sh HPC_DIR=dist/hpc cabal clean cabal configure --enable-tests --enable-library-coverage cabal build cabal test open ${HPC_DIR}/html/*/hpc-index.html
#! /bin/sh HPC_DIR=dist/hpc cabal-dev clean cabal-dev configure --enable-tests --enable-library-coverage cabal-dev build cabal-dev test open ${HPC_DIR}/html/*/hpc-index.html
Use cabal-dev for hpc report generation
Use cabal-dev for hpc report generation
Haskell
bsd-3-clause
haskell-distributed/distributed-process-async,qnikst/distributed-process-async
6a1c7de6f3cd0150533faf01854caf1e1dbca824
examples/MemoryManager.hs
examples/MemoryManager.hs
module MemoryManager where import Data.IntMap import SoOSiM import MemoryManager.Types import MemoryManager.Util data MemState = MemState { localAddress :: [Int] , remoteAddress :: IntMap ComponentId } memoryManager :: MemState -> ComponentInput -> SimM MemState memoryManager s (ComponentMs...
module MemoryManager where import Data.IntMap import SoOSiM import MemoryManager.Types import MemoryManager.Util data MemState = MemState { localAddress :: [Int] , remoteAddress :: IntMap ComponentId } memoryManager :: MemState -> ComponentInput -> SimM MemState memoryManager s (ComponentMs...
Update memory manager code to use the new API
Update memory manager code to use the new API
Haskell
mit
christiaanb/SoOSiM,christiaanb/SoOSiM
9601e2a8dab21c2a2fbd42c72b92f1e9ae03350d
Language/Tidy.hs
Language/Tidy.hs
{-# LANGUAGE NoImplicitPrelude #-} module FOL.Language.Tidy where import FOL.Language.Common import FOL.Language.Expression import Data.List import Data.Generics.Uniplate.Operations import Control.Monad tidyExpr :: Expr -> Expr tidyExpr = rewrite rule where rule e = msum (map ($ e) tidyRules) tidyRules :...
{-# LANGUAGE NoImplicitPrelude #-} module FOL.Language.Tidy where import FOL.Language.Common import FOL.Language.Expression import Data.List import Data.Generics.Uniplate.Operations import Control.Monad tidyExpr :: Expr -> Expr tidyExpr = rewrite rule where rule e = msum (map ($ e) tidyRules) tidyRules :...
Make the tidier flush unused bindings in LET and LET-VALUES.
Make the tidier flush unused bindings in LET and LET-VALUES.
Haskell
agpl-3.0
axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language
4616733e9178059c390dfa40bc740564e259917f
src/Snap/Util/Readable.hs
src/Snap/Util/Readable.hs
module Snap.Util.Readable ( Readable(..) ) where ------------------------------------------------------------------------------ import Data.ByteString.Char8 (ByteString) import Data.Int import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding import ...
module Snap.Util.Readable ( Readable(..) ) where ------------------------------------------------------------------------------ import Data.ByteString.Char8 (ByteString) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding import Data.Text.Read ...
Revert last commit...that change has to happen in 0.10
Revert last commit...that change has to happen in 0.10
Haskell
bsd-3-clause
23Skidoo/snap-core,sopvop/snap-core,f-me/snap-core,snapframework/snap-core,23Skidoo/snap-core,sopvop/snap-core,f-me/snap-core,f-me/snap-core,snapframework/snap-core,sopvop/snap-core,snapframework/snap-core,23Skidoo/snap-core
548c780441de7f60fd74b648a5ec083801f1c51b
hs-to-coq/src/exe/Main.hs
hs-to-coq/src/exe/Main.hs
module Main (main) where import HsToCoq.Util.GHC import HsToCoq.CLI main :: IO () main = defaultRunGhc $ processFilesMain convertAndPrintModules
module Main (main) where import HsToCoq.Util.GHC import HsToCoq.CLI main :: IO () main = defaultRunGhc $ processFilesMainRn convertAndPrintModulesRn
Switch to use the renamer but produce single file output
Switch to use the renamer but produce single file output
Haskell
mit
antalsz/hs-to-coq,antalsz/hs-to-coq
165d5dbe2b36b23dbe162bf44340fe74b921e4a2
day10/day10.hs
day10/day10.hs
import Data.List (group) main :: IO () main = do print . length $ lookAndSay 50 "1113222113" return () lookAndSay :: Int -> String -> String lookAndSay 0 s = s lookAndSay n s = lookAndSay (n-1) $ f' s f' :: String -> String f' s = concatMap m gs where gs = group s m :: String -> String ...
import Data.List (group) main :: IO () main = do print . length $ lookAndSay 50 "1113222113" return () lookAndSay :: Int -> String -> String lookAndSay 0 s = s lookAndSay n s = lookAndSay (n-1) $ f' s f' :: String -> String f' s = concat $ map m gs where gs = group s m :: String -> Stri...
Revert "Changed concat $ map to concatMap"
Revert "Changed concat $ map to concatMap" This reverts commit 2e64b9e03236b75a36b00b5aad69fa07cfc9b99f.
Haskell
mit
Dr-Horv/Advent-of-code
c4ede26b7e28565324bd78a14dcbd7eee8851da0
src/Parallel.hs
src/Parallel.hs
module Parallel(parallel) where import System.IO.Unsafe(unsafeInterleaveIO) import GHC.Conc(numCapabilities) import Control.Concurrent import Control.Monad parallel :: [IO a] -> IO [a] parallel = if numCapabilities <= 1 then parallel1 else parallelN parallel1 :: [IO a] -> IO [a] parallel1 [] = return [] parallel1...
{- The parallel function (specialised to lists) is equivalent to: import Control.Parallel.Strategies parallel = return $ withStrategy (parList $ seqList r0) $ map unsafePerformIO However, this version performs about 10% slower with 2 processors in GHC 6.12.1 -} module Parallel(parallel) where import System.IO.Unsaf...
Add a comment about how to use parallel strategies instead (not done as it is a bit slower)
Add a comment about how to use parallel strategies instead (not done as it is a bit slower)
Haskell
bsd-3-clause
ndmitchell/hlint,eigengrau/hlint,ndmitchell/hlint,gibiansky/hlint,mpickering/hlint,bitemyapp/hlint
a82813a2b4af8a1d6cf7dc8bf60b04d37a50a948
src/Main.hs
src/Main.hs
import System.Environment import Parser import Eval import Expr main :: IO () main = getArgs >>= handleArgs . getFirst where getFirst args = if null args then "" else head args handleArgs args = case args of "--ast" -> putAst _ -> putExpr -- Pars...
import System.Environment import Parser import Eval import Expr main :: IO () main = getArgs >>= handleArgs . getFirst where getFirst args = if null args then "" else head args handleArgs args = case args of "--ast" -> putAst _ -> putExpr -- Pars...
Change printing of program result
Change printing of program result When a program is evaluated, the result is a list of values produced in order. That list is now printed with one element per line isntead of printing a literal list.
Haskell
mit
apollo-lang/apollo
a1a4e6e896a59055f6781637d203acaf921fb7a0
src/Main.hs
src/Main.hs
module Main where import qualified Data.Text.IO as T import Options.Applicative import Purescript.Ide data Options = Options { externs :: [FilePath] } options :: Parser Options options = Options <$> some (strArgument (metavar "FILE" <> help "Extern File...
module Main where import qualified Data.Text.IO as T import Options.Applicative import Purescript.Ide data Options = Options { externs :: [FilePath] } options :: Parser Options options = Options <$> some (strArgument (metavar "FILE" <> help "Extern File...
Handle ParseError and not found searches
Handle ParseError and not found searches
Haskell
mit
kRITZCREEK/psc-ide
cb4f4cd11d552cbd15e0994e0fb0f30b05a923ad
testsuite/TestLabyrinth/Generate.hs
testsuite/TestLabyrinth/Generate.hs
{-# OPTIONS_GHC -F -pgmF htfpp #-} module TestLabyrinth.Generate (htf_thisModulesTests) where import Peeker import System.Random import Labyrinth import Test.Framework generateFromSeed :: Int -> Labyrinth generateFromSeed = fst . generateLabyrinth 5 6 3 . mkStdGen isCellType :: CellTypeResult -> Cell -> Bool isC...
{-# OPTIONS_GHC -F -pgmF htfpp #-} module TestLabyrinth.Generate (htf_thisModulesTests) where import Control.Monad import Peeker import System.Random import Labyrinth import Test.Framework instance Arbitrary Labyrinth where arbitrary = liftM (fst . generateLabyrinth 5 6 3 . mkStdGen) arbitrary isCellType ::...
Use Arbitrary for generator testing.
Use Arbitrary for generator testing.
Haskell
mit
koterpillar/labyrinth,koterpillar/labyrinth-server
3add7088c353b8ab9025e2cd4d1aaa7c0790fdc2
src/Main.hs
src/Main.hs
module Main where import Control.Applicative import Control.Monad import Data.Maybe import Network.Socket import Network.Wai.Handler.Warp import System.Directory import System.Environment import Application main :: IO () main = do env <- getEnvironment sock <- fromJust $ do (do unixPath...
module Main where import Control.Applicative import Control.Exception (bracket) import Control.Monad import Data.Maybe import Network.Socket import Network.Wai.Handler.Warp import System.Directory import System.Environment import Application getSocket :: IO Socket getSocket = do env <- getEnvironment fromJust $ ...
Fix bug holding on to socket for too long
Fix bug holding on to socket for too long
Haskell
agpl-3.0
alevy/mappend,alevy/mappend
313aa3a957156452cce4f8940f327450d87c03cd
src/Main.hs
src/Main.hs
import System.Environment (getArgs) import Control.Monad (forM_) import Text.ParserCombinators.Parsec (spaces, char, chainl1, runParser) import Text.ParserCombinators.Parsec.Number (int) infixOp = do spaces char '+' spaces return (+) expr = chainl1 int infixOp runExpr = runParser expr 0 "<input>" showResult...
import System.Environment (getArgs) import Control.Monad (forM_) import Text.ParserCombinators.Parsec (spaces, char, chainl1, runParser) import Text.ParserCombinators.Parsec.Number (int) infixOp = do spaces char '+' spaces return (+) expr = chainl1 int infixOp runExpr = runParser expr 0 "<input>" showResult...
Split out the IO and non-IO bits. HT @mauke
Split out the IO and non-IO bits. HT @mauke
Haskell
isc
steshaw/huttons-razor
a68b7d50f42b9eda26a572953827bfc0e36b42fb
src/Main.hs
src/Main.hs
import System.Environment import qualified MacroExpander import qualified Parser import qualified Beautifier import qualified Generator import qualified Serializer import qualified Optimizer import qualified Text.Show.Pretty as Pr import Control.Monad.Writer pPutStrLn :: Bool -> String -> IO () pPutStrLn predicate li...
import System.Environment import qualified MacroExpander import qualified Parser import qualified Beautifier import qualified Generator import qualified Serializer import qualified Optimizer import qualified Assembler import qualified Text.Show.Pretty as Pr import Control.Monad.Writer pPutStrLn :: Bool -> String -> I...
Add --hex flag to show hex output from HDC
Add --hex flag to show hex output from HDC
Haskell
mit
aleksanb/hdc
8cd3a8a7d90da7c81d03fa061631180bc4e7ff67
src/Sihemo/Sendmail.hs
src/Sihemo/Sendmail.hs
-- | Quick, hacky sendmail wrapper module Sihemo.Sendmail ( sendmail ) where import System.Process (readProcess) sendmail :: String -- ^ Recipient -> String -- ^ Subject -> [String] -- ^ Content (lines) -> IO () -- ^ Blocks until mail is sent sendmail recipient subject bo...
-- | Quick, hacky sendmail wrapper module Sihemo.Sendmail ( sendmail ) where import System.Process (readProcess) sendmail :: String -- ^ Recipient -> String -- ^ Subject -> [String] -- ^ Content (lines) -> IO () -- ^ Blocks until mail is sent sendmail recipient subject bo...
Use -t flag for sendmail recipient
Use -t flag for sendmail recipient
Haskell
bsd-3-clause
jaspervdj/sihemo,jaspervdj/sihemo
d590b03f2c21cd05051d45035fda2cd52392b863
src/Language/PureScript/Publish/Utils.hs
src/Language/PureScript/Publish/Utils.hs
module Language.PureScript.Publish.Utils where import Data.List import Data.Maybe import System.Directory import qualified System.FilePath.Glob as Glob -- | Glob relative to the current directory, and produce relative pathnames. globRelative :: Glob.Pattern -> IO [FilePath] globRelative pat = do currentDir <- getC...
module Language.PureScript.Publish.Utils where import Data.List import Data.Either (partitionEithers) import System.Directory import System.Exit (exitFailure) import System.IO (hPutStrLn, stderr) import System.FilePath (pathSeparator) import qualified System.FilePath.Glob as Glob -- | Glob relative to the current di...
Fix psc-publish producing no modules on Windows
Fix psc-publish producing no modules on Windows Fixes #1326. Amend the globRelative function to use the OS's path separator, and also to raise an error unless it was able to strip the current directory prefix successfully
Haskell
mit
michaelficarra/purescript,michaelficarra/purescript
7a97cb4f751b82d23bd699de68709ada1fdab04f
Data/Vector/Storable/Internal.hs
Data/Vector/Storable/Internal.hs
{-# LANGUAGE MagicHash, UnboxedTuples, ScopedTypeVariables #-} -- | -- Module : Data.Vector.Storable.Internal -- Copyright : (c) Roman Leshchinskiy 2009-2010 -- License : BSD-style -- -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-portable -- -- ...
{-# LANGUAGE MagicHash, UnboxedTuples, ScopedTypeVariables #-} -- | -- Module : Data.Vector.Storable.Internal -- Copyright : (c) Roman Leshchinskiy 2009-2010 -- License : BSD-style -- -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-portable -- -- ...
Fix bad bug in ptrToOffset
Fix bad bug in ptrToOffset Ignore-this: 79f397bb354deaef91029c0c6a045d5b darcs-hash:20100821050043-b2b0a-d469baaa9757cb106624884cd21214594f12c7b2
Haskell
bsd-3-clause
rleshchinskiy/vector
3622396493714009aff0b54dcbb641c082d64255
exercises/zipper/src/Zipper.hs
exercises/zipper/src/Zipper.hs
module Zipper ( BinTree(BT) , fromTree , left , right , setLeft , setRight , setValue , toTree , up , value ) where data BinTree a = BT { btValue :: a , btLeft :: Maybe (BinTree a) , btRight :: Maybe (BinTree a) } deriving (Eq, Show) fromTree :: ...
module Zipper ( BinTree(BT) , fromTree , left , right , setLeft , setRight , setValue , toTree , up , value ) where data BinTree a = BT { btValue :: a , btLeft :: Maybe (BinTree a) , btRight :: Maybe (BinTree a) } deriving (Eq, Show) data Zipper ...
Add dummy data to stub so that it compiles
zipper: Add dummy data to stub so that it compiles As part of the work in #421.
Haskell
mit
exercism/xhaskell
be1b68e4391065701d5da6d2acce2b75817a1cfb
tests/QCSupport.hs
tests/QCSupport.hs
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module QCSupport ( P(..) ) where import Data.Int (Int8, Int16, Int32, Int64) import Data.Word (Word8, Word16, Word32, Word64) import qualified Data.ByteString.Char8 as SB import qualified Data.ByteString.Lazy.Char8 as...
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module QCSupport ( P(..) ) where import Data.Int (Int8, Int16, Int32, Int64) import Data.Word (Word8, Word16, Word32, Word64) import qualified Data.ByteString.Char8 as SB import qualified Data.ByteString.Lazy.Char8 as...
Drop duplicate Random instance for Int64
Drop duplicate Random instance for Int64
Haskell
bsd-3-clause
bos/bloomfilter,gibiansky/bloomfilter,mikeizbicki/bloomfilter
95054b80b8fbd213429f807f9ad409a4a43d2fe3
Development/Shake/Language/C/Config.hs
Development/Shake/Language/C/Config.hs
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module Development.Shake.Language.C.Config( withConfig , getList ) where import Control.Applicative import qualified Data.HashMap.Strict as Map import Development.Shake import Development.Shake.Classes import Development.Shake.Config (readConfigFil...
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module Development.Shake.Language.C.Config( withConfig , parsePaths , getPaths ) where import Control.Applicative import qualified Data.HashMap.Strict as Map import Development.Shake import Development.Shake.Classes import Development.Shake.Confi...
Rename getList to getPaths and export parsePaths
Rename getList to getPaths and export parsePaths
Haskell
apache-2.0
samplecount/shake-language-c
e8230a7db97f105e7e4b09e4985e1dcc2406a39e
Examples/Util.hs
Examples/Util.hs
module Examples.Util where import Development.Shake import Development.Shake.FilePath import Control.Concurrent(threadDelay) import Control.Monad import System.Directory import System.Environment shaken :: (([String] -> IO ()) -> (String -> String) -> IO ()) -> ((String -> String) -> Rules ()) -> IO ()...
module Examples.Util where import Development.Shake import Development.Shake.FilePath import Control.Concurrent(threadDelay) import Control.Monad import System.Directory import System.Environment shaken :: (([String] -> IO ()) -> (String -> String) -> IO ()) -> ((String -> String) -> Rules ()) -> IO ()...
Add an assert utility operator to the examples utils
Add an assert utility operator to the examples utils
Haskell
bsd-3-clause
nh2/shake,nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,nh2/shake,ndmitchell/shake
a7993f97013314ae1f2f6802252659d4960d6270
Kiwi/Config.hs
Kiwi/Config.hs
{-# LANGUAGE DeriveDataTypeable #-} module Kiwi.Config where import System.Console.CmdArgs (cmdArgs, Data, Typeable) data Args = Args { wikidir :: FilePath , port :: Int , host :: String } deriving (Show, Data, Typeable) defaultArgs :: Args defaultArgs = Args { wikidir = "./wiki" ...
{-# LANGUAGE DeriveDataTypeable #-} module Kiwi.Config where import System.Environment import System.Console.CmdArgs ((&=), cmdArgs, Data, details, help, program, summary, Typeable) data Args = Args { wikidir :: FilePath , port :: Int , host :: String } deriving (Sho...
Add more information on command line arguments
Add more information on command line arguments
Haskell
bsd-3-clause
acieroid/kiwi
664beec2bfa3f5a585f8a4a66434b8af51594694
test/Test/Control/TimeWarp/Common.hs
test/Test/Control/TimeWarp/Common.hs
-- | Common code. module Test.Control.TimeWarp.Common ( ) where import Data.Time.Units (TimeUnit, convertUnit, fromMicroseconds) import System.Random (StdGen, mkStdGen) import System.W...
-- | Common code. module Test.Control.TimeWarp.Common ( ) where import Data.Time.Units (TimeUnit, convertUnit, fromMicroseconds) import System.Random (StdGen, mkStdGen) import System.W...
Fix tests after recent refactoring
Fix tests after recent refactoring
Haskell
mit
serokell/time-warp
01f75bc4336cec925db4c9f454e844d4f8c3f1b9
examples/brochure/hakyll.hs
examples/brochure/hakyll.hs
{-# LANGUAGE OverloadedStrings #-} import Control.Arrow ((>>>)) import Control.Monad (forM_) import Hakyll main :: IO () main = hakyll $ do route "css/*" idRoute compile "css/*" defaultCompressCss compile "templates/*" defaultTemplateRead forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -...
{-# LANGUAGE OverloadedStrings #-} import Control.Arrow ((>>>)) import Control.Monad (forM_) import Hakyll main :: IO () main = hakyll $ do route "css/*" idRoute compile "css/*" compressCssCompiler compile "templates/*" templateCompiler forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> ...
Remove Hakyll.Web shit from brochure example
Remove Hakyll.Web shit from brochure example
Haskell
bsd-3-clause
freizl/freizl.github.com-old,oldmanmike/hakyll,Javran/hakyll,Minoru/hakyll,freizl/freizl.github.com-old,freizl/freizl.github.com-old,freizl/freizl.github.com-old,freizl/freizl.github.com-old,d12frosted/hakyll,freizl/freizl.github.com-old,freizl/freizl.github.com-old,beni55/hakyll
ae875a87aaae8c4d3515d2bf38f727d728dc396f
src/Beautifier.hs
src/Beautifier.hs
module Beautifier(beautify) where import Datatypes beautify :: Program -> Program beautify (Program statements) = Program (map beautifyStatement statements) beautifyStatement :: Statement -> Statement beautifyStatement (AssignmentStatement (Assignment lefthand assignmentOperator expression)) = case assignmentOp...
module Beautifier(beautify) where import Datatypes beautify :: Program -> Program beautify (Program statements) = Program (map beautifyStatement statements) beautifyStatement :: Statement -> Statement beautifyStatement (AssignmentStatement (Assignment lefthand assignmentOperator oldExpression)) = let expression...
Transform IsInLists to nested BinaryExpressions
Transform IsInLists to nested BinaryExpressions
Haskell
mit
aleksanb/hdc
3111b71dfaf514369d6f27372df7f878ec86acb4
library/Stream.hs
library/Stream.hs
module Stream where import Stream.Prelude hiding (toList, yield, fold) newtype Stream m a = Stream (m (Action m a)) data Action m a = Stop | Continue a (Stream m a) instance (Monad m) => Monoid (Action m a) where mempty = Stop mappend = \case Stop -> id Continue h (Stream mt) ...
module Stream where import Stream.Prelude hiding (toList, yield, fold) newtype Stream m a = Stream (m (Maybe (a, Stream m a))) instance Monad m => Monoid (Stream m a) where mempty = Stream $ return Nothing mappend (Stream m1) (Stream m2) = Stream $ m1 >>= \case Nothing -...
Reimplement with Maybe instead of Action
Reimplement with Maybe instead of Action
Haskell
mit
nikita-volkov/list-t
8169192798188c08e4de0cb4eb80ce19f564829a
src/Str.hs
src/Str.hs
module Str( Str, linesCR, readFileUTF8, S.null, S.isPrefixOf, S.drop, S.span, S.length, S.toList, S.all, S.uncons, S.stripPrefix, ugly, showLength ) where import qualified Foundation as S import qualified Foundation.String as S import qualified Foundation.IO as S import qualified Foundation.Co...
module Str( Str, linesCR, readFileUTF8, S.null, S.isPrefixOf, S.drop, S.span, S.length, S.toList, S.all, S.uncons, S.stripPrefix, ugly, showLength ) where import qualified Foundation as S import qualified Foundation.String as S import qualified Foundation.IO as S import Data.Tuple.Extra type...
Switch to normal foundation lines, now its faster
Switch to normal foundation lines, now its faster
Haskell
bsd-3-clause
ndmitchell/weeder
1a43f35e2dacc9837f9762fd211d63ae6cc7b4a3
haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
module Haddock.Backends.Hyperlinker.Renderer where import Haddock.Backends.Hyperlinker.Parser import Data.Monoid import Text.XHtml render :: [Token] -> Html render = body . pre . foldr (<>) noHtml . map renderToken renderToken :: Token -> Html renderToken (Token t v _) = thespan (toHtml v) ! tokenAttrs t tokenAttr...
module Haddock.Backends.Hyperlinker.Renderer where import Haddock.Backends.Hyperlinker.Parser import Data.Monoid import Text.XHtml (Html, HtmlAttr, (!)) import qualified Text.XHtml as Html render :: Maybe FilePath -> [Token] -> Html render css tokens = header css <> body tokens body :: [Token] -> Html body = Html.b...
Add support for specifying the CSS file path in HTML source renderer.
Add support for specifying the CSS file path in HTML source renderer.
Haskell
bsd-2-clause
idontgetoutmuch/haddock,randen/haddock,Acidburn0zzz/haddock,Fuuzetsu/haddock,sboosali/haddock,Acidburn0zzz/haddock,niteria/haddock,Helkafen/haddock,Fuuzetsu/haddock,idontgetoutmuch/haddock,Helkafen/haddock,Acidburn0zzz/haddock,mrhania/haddock,lamefun/haddock,Helkafen/haddock,mrhania/haddock,haskell/haddock,haskell/hadd...
9c1475655f468eefb716e80012b2f630045f2940
server/integration-tests/sqlite_test.hs
server/integration-tests/sqlite_test.hs
#!/usr/bin/env stack -- stack --stack-yaml ../../client-haskell/stack.yaml runghc --package sqlite-simple {-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} {- | Test whether SQLite was installed with JSON support enabled by calling the "json" SQL function. -} import Data.Text (Text) import Database.SQLite...
#!/usr/bin/env stack -- stack --stack-yaml ../../client-haskell/stack.yaml runghc --package sqlite-simple --package aeson {-# OPTIONS_GHC -Wall #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {- | Test whether SQLite was installed with JSON support enabled by calling the "json" SQL function. -}...
Add a JSON parsing example
Add a JSON parsing example
Haskell
bsd-3-clause
channable/icepeak,channable/icepeak,channable/icepeak