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 |
|---|---|---|---|---|---|---|---|---|---|
297ab84478d642aedd993b6c90130ddb8ba94962 | src/Config/Read.hs | src/Config/Read.hs |
module Config.Read(readFilesConfig) where
import Config.Type
import Control.Monad
import Control.Exception.Extra
import Config.Yaml
import Data.List.Extra
import System.FilePath
readFilesConfig :: [(FilePath, Maybe String)] -> IO [Setting]
readFilesConfig files = do
let (yaml, haskell) = partition (\(x,_) -> lo... |
module Config.Read(readFilesConfig) where
import Config.Type
import Control.Monad
import Control.Exception.Extra
import Config.Yaml
import Data.List.Extra
import System.FilePath
readFilesConfig :: [(FilePath, Maybe String)] -> IO [Setting]
readFilesConfig files = do
let (yaml, haskell) = partition (\(x,_) -> lo... | Make the failure to read Haskell config message clearer | Make the failure to read Haskell config message clearer
| Haskell | bsd-3-clause | ndmitchell/hlint,ndmitchell/hlint |
9ad84db92f9fbc429d05a6d6de27dee97722f834 | main.hs | main.hs | module Main where
import Network.Google.Api
import Network.Google.OAuth2
import System.Environment.XDG.BaseDir
import System.Exit
import System.FilePath
import System.IO
import Drync
import Drync.Client
import Drync.Options
-- TODO
--
-- * support --sync-to again
-- * support --throttle again
-- * support --progress... | module Main where
import Network.Google.Api
import Network.Google.Drive.File
import Network.Google.OAuth2
import System.Environment.XDG.BaseDir
import System.Exit
import System.FilePath
import System.IO
import Drync
import Drync.Client
import Drync.Options
-- TODO
--
-- * support --sync-to again
-- * support --throt... | Make getFile available, use it correctly | Make getFile available, use it correctly
| Haskell | mit | pbrisbin/drync |
5d24dae3de4ec5c22c50aa82b98e2e9d0d244742 | mismi-s3/test/Test/Mismi/S3/Control.hs | mismi-s3/test/Test/Mismi/S3/Control.hs | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
module Test.Mismi.S3.Control where
import Control.Monad.Trans.AWS
import Mismi.S3.Aws.Control
import P
import System.IO
import ... | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
module Test.Mismi.S3.Control where
import Control.Monad.Trans.AWS
import Mismi.S3.Aws.Control
import P
import System.IO
import ... | Add missing import of Arbitrary for Region | Add missing import of Arbitrary for Region
Fixing the build | Haskell | bsd-3-clause | ambiata/mismi,ambiata/mismi |
76b0f30dd2deb8b5eba435bfddba60d9f17ad1a0 | src/Main.hs | src/Main.hs | import System.Environment
import Control.Monad (forM_)
import Text.ParserCombinators.Parsec
import qualified Text.ParserCombinators.Parsec.Number as Numbers
expr = chainl1 int infixOp
int = Numbers.int
infixOp = do
spaces
char '+'
spaces
return (+)
runExpr = runParser expr 0 "<input>"
showResult (Left a) ... | 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... | Tweak with feedback from c_wraith | Tweak with feedback from c_wraith
| Haskell | isc | steshaw/huttons-razor |
e09f3e00c30e4bb3c96b7a568065b9c46acfec59 | src/Language/K3/Codegen/CPP/Representation.hs | src/Language/K3/Codegen/CPP/Representation.hs | {-# LANGUAGE OverloadedStrings #-}
module Language.K3.Codegen.CPP.Representation where
import Data.String
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
class Stringifiable a where
stringify :: a -> Doc
data Name
= Name Identifier
| Qualified Identifier Name
| Specialized [Type] Name
deriving... | {-# LANGUAGE OverloadedStrings #-}
module Language.K3.Codegen.CPP.Representation where
import Data.String
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
class Stringifiable a where
stringify :: a -> Doc
data Name
= Name Identifier
| Qualified Identifier Name
| Specialized [Type] Name
deriving... | Define AST fragment for literal expressions. | Define AST fragment for literal expressions.
| Haskell | apache-2.0 | DaMSL/K3,yliu120/K3,DaMSL/K3 |
3b4454180545e3a45246660cb77382269c4f4638 | src/SearchFilter.hs | src/SearchFilter.hs | module SearchFilter (matchSearch) where
import Bucket.Types
matchSearch :: String -> BucketItem -> Bool
matchSearch searchString item =
-- TODO: implement smart search
True
| module SearchFilter (matchSearch) where
import Bucket.Types
import Data.Text
matchSearch :: String -> BucketItem -> Bool
matchSearch searchString item =
toLower (pack searchString) `isInfixOf` toLower (pack (itemFileName item))
| Implement simple file name search. | Implement simple file name search.
| Haskell | bsd-3-clause | rickardlindberg/orgapp |
0714442631fe28747a0a3de606cf1d290e4bc305 | spec.hs | spec.hs | -- | Unit test for PassphraseGenerator functions.
import Test.Hspec
import qualified Data.Map.Strict as Map
import PassphraseGenerator
filetext :: String
filetext = "aaa\t1900\t2\naaa\t1950\t3\nbbb\t1950\t5\nbbb_VERB\t1980\t9"
y :: Int
y = 1950
main :: IO()
main = hspec $ do
describe "countDescending" $ do
i... | -- | Unit test for PassphraseGenerator functions.
import Test.Hspec
import qualified Data.Map.Strict as Map
import PassphraseGenerator
filetext :: String
filetext = "aaa\t1900\t2\naaa\t1950\t3\nAAA\t1951\t7\nbbb\t1950\t5\nbbb_VERB\t1980\t9"
y :: Int
y = 1950
main :: IO()
main = hspec $ do
describe "countDescendi... | Test recently-added case-folding behavior of mostFrequent.hs | Test recently-added case-folding behavior of mostFrequent.hs
| Haskell | mit | JohnL4/PassphraseGenerator |
8fcd0f668bd97d75e30cf358f1706d11cc6c53c8 | travis.hs | travis.hs |
import Control.Exception.Extra
import System.Time.Extra
import System.Process.Extra
main :: IO ()
main = do
retry 3 $ system_ "cabal install QuickCheck"
-- FIXME: Temporarily disabled due to GHC 7.10 issues
system_ "hlint test +RTS -K1K" --typecheck --quickcheck
(time,_) <- duration $ system_ "hlint ... |
import Control.Exception.Extra
import System.Time.Extra
import System.Process.Extra
main :: IO ()
main = do
retry 3 $ system_ "cabal install QuickCheck"
-- FIXME: Temporarily disabled due to GHC 7.10 issues
system_ "hlint test +RTS -K1K" --typecheck --quickcheck
(time,_) <- duration $ system_ "hlint ... | Use HLint_Hints when applying hlint | Use HLint_Hints when applying hlint
| Haskell | bsd-3-clause | ndmitchell/hlint,ndmitchell/hlint |
9b040bfeafbb95021d10e2b54f9a7f6e219f1429 | easyla/spec/EasySpec.hs | easyla/spec/EasySpec.hs | module EasySpec
( main
, spec
) where
import Numeric.LinearAlgebra.Easy
import Test.Hspec
spec :: Spec
spec = do
describe "vector *" $
it "performs elementwise product" $
vector [1, 2, 3] * vector [3, 0, -2] `shouldBe` vector [3.0, 0.0, -6.0]
describe "matr... | module EasySpec
( main
, spec
) where
import Numeric.LinearAlgebra.Easy
import Test.Hspec
spec :: Spec
spec = do
describe "vector +" $
it "performs elementwise add" $
vector [1, 2, 3] + vector [3, 0, -2] `shouldBe` vector [4.0, 2.0, 1.0]
describe "vector *"... | Add tests for elementwise sum | Add tests for elementwise sum
| Haskell | mit | rcook/mlutil |
83e004ef86ba606dc9458f185125d4ff4f29896c | src/Language/K3/Core/Type.hs | src/Language/K3/Core/Type.hs | {-# LANGUAGE TypeFamilies #-}
-- | Types in K3.
module Language.K3.Core.Type (
Identifier,
Position(..),
Type(..),
Annotation(..)
) where
import Language.K3.Core.Annotation
-- | The types of K3 Identifiers.
type Identifier = String
-- | K3 source code positions
data Position = Position String Int I... | {-# LANGUAGE TypeFamilies #-}
-- | Types in K3.
module Language.K3.Core.Type (
Identifier,
Position(..),
Type(..),
Annotation(..)
) where
import Language.K3.Core.Annotation
-- | The types of K3 Identifiers.
type Identifier = String
-- | K3 source code positions
data Position = Position String Int I... | Add extra types for sources, triggers and sinks. | Add extra types for sources, triggers and sinks.
| Haskell | apache-2.0 | DaMSL/K3,DaMSL/K3,yliu120/K3 |
bdf8dfb4ed76a2d325c776dc47c9c52c61fc940f | src/Gfx/Matrices.hs | src/Gfx/Matrices.hs | {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
module Gfx.Matrices where
import Data.Vec
vec3 :: forall a a1 a2. a -> a1 -> a2 -> a :. (a1 :. (a2 :. ()))
vec3 x y z = x :. y :. z:. ()
projectionMat :: Floating f => f -> f -> f -> f -> Mat44 f
projectionMat near far fov aspect = perspective near far fo... | {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
module Gfx.Matrices where
import Data.Vec
vec3 :: forall a a1 a2. a -> a1 -> a2 -> a :. (a1 :. (a2 :. ()))
vec3 x y z = x :. y :. z:. ()
projectionMat :: Floating f => f -> f -> f -> f -> Mat44 f
projectionMat near far fov aspect = perspective near far fo... | Add translate and scalte matrix functions | Add translate and scalte matrix functions
| Haskell | bsd-3-clause | rumblesan/improviz,rumblesan/improviz |
90f080a0f8f5b9cc7f3df68298acd6eab4caeea8 | src/Cauterize/GHC7/Options.hs | src/Cauterize/GHC7/Options.hs | module Cauterize.GHC7.Options
( CautGHC7Opts(..)
, modulePathAsList
, options
) where
import Options.Applicative
data CautGHC7Opts = CautGHC7Opts
{ specFile :: FilePath
, outputDirectory :: FilePath
, modulePath :: Maybe String
} deriving (Show)
modulePathAsList :: CautGHC7Opts -> Maybe [String]
modu... | module Cauterize.GHC7.Options
( CautGHC7Opts(..)
, modulePathAsList
, options
) where
import Options.Applicative
data CautGHC7Opts = CautGHC7Opts
{ specFile :: FilePath
, outputDirectory :: FilePath
, modulePath :: Maybe String
} deriving (Show)
modulePathAsList :: CautGHC7Opts -> Maybe [String]
modu... | Use mappend instead of <> | Use mappend instead of <>
| Haskell | bsd-3-clause | cauterize-tools/caut-ghc7-ref |
9140334dd270f4c0776f040e5d47e7776a7cd5d2 | src/CLaSH/Core/FreeVars.hs | src/CLaSH/Core/FreeVars.hs | module CLaSH.Core.FreeVars where
import Unbound.LocallyNameless (Collection, fv)
import CLaSH.Core.Term (Term, TmName)
import CLaSH.Core.Type (TyName, Type)
-- | Gives the free type-variables in a Type
typeFreeVars :: Collection c
=> Type
-> c TyName
typeFreeVars = fv
-- | ... | module CLaSH.Core.FreeVars where
import Unbound.LocallyNameless (Collection, fv)
import CLaSH.Core.Term (Term, TmName)
import CLaSH.Core.Type (TyName, Type)
-- | Gives the free type-variables in a Type
typeFreeVars :: Collection c
=> Type
-> c TyName
typeFreeVars = fv
-- | ... | Fix circular reasoning in free variable calculation | Fix circular reasoning in free variable calculation
| Haskell | bsd-2-clause | christiaanb/clash-compiler,ggreif/clash-compiler,ggreif/clash-compiler,christiaanb/clash-compiler |
d0665aad70d47f05c9642de2b33de55c1a39f078 | src/Language/Dash/Types.hs | src/Language/Dash/Types.hs | module Language.Dash.Types where
data Term
= Var String
| Abs String Term
| App Term Term
deriving Eq
instance Show Term where
show (Var s) = s
show (Abs s t) = "/" ++ s ++ ". " ++ show t
show (App t1 t2) = "(" ++ show t1 ++ ") " ++ show t2
data Nameless
= NVar Int
| NAbs String Nameless
| NApp N... | module Language.Dash.Types where
data Term
= Var String
| Abs String Term
| App Term Term
deriving Eq
instance Show Term where
show (Var s) = s
show (Abs s t) = "/" ++ s ++ ". " ++ show t
show (App t1 t2) = "(" ++ show t1 ++ ") " ++ show t2
data Nameless
= NVar Int
| NAbs String Nameless
| NApp N... | Make `Eq` mean "is alpha-equivalent to" (i.e. same de Bruijn representation) | Make `Eq` mean "is alpha-equivalent to" (i.e. same de Bruijn representation)
Signed-off-by: Ricky Elrod <3de8762d49a778edd8b1aa9f381ea5a9ccb62944@elrod.me>
| Haskell | bsd-3-clause | relrod/- |
17b3cb685c9381a1f51b599a466b2d3f218e6ed3 | Betty/Pid.hs | Betty/Pid.hs | module Betty.Pid ( writePidFile ) where
------------------------------------------------------------------------
import ClassyPrelude.Yesod
import System.Directory (createDirectoryIfMissing,
getAppUserDataDirectory)
import System.IO (IOMode (WriteMode), hPrint, withFile)
i... | module Betty.Pid ( writePidFile ) where
------------------------------------------------------------------------
import ClassyPrelude.Yesod
import System.Directory (createDirectoryIfMissing)
import System.IO (IOMode (WriteMode), hPrint, withFile)
import System.Posix.Process (getProcessID)
-----------... | Write pid file to /opt/keter/var | Write pid file to /opt/keter/var
| Haskell | agpl-3.0 | sajith/betty-web |
0ed1c35f89c9e2ac7a4c7efe40f67bf68799c5b0 | 32016/A.hs | 32016/A.hs | import Control.Applicative
import Control.Monad
import Data.List
import Text.Printf
main = do
tests <- readLn
forM_ [1..tests] $ \caseNum -> do
_ <- getLine
x <- map read . words <$> getLine
y <- map read . words <$> getLine
let ans = sum $ zipWith (*) (reverse . sort $ x) (sort y)
prin... | import Control.Applicative
import Control.Monad
import Data.List
import Text.Printf
import GHC.Exts
main = do
tests <- readLn
forM_ [1..tests] $ \caseNum -> do
_ <- getLine
x <- map read . words <$> getLine
y <- map read . words <$> getLine
let ans = sum $ zipWith (*) (sortWith Down x) (sor... | Sort list in reverse order instead of sorting then reversing | Sort list in reverse order instead of sorting then reversing
| Haskell | mit | marknsikora/codejam,marknsikora/codejam |
5664899cf15d692239766f37e8c07611b2e66056 | demo/soe/BouncingBall.hs | demo/soe/BouncingBall.hs | {- Written by Antti-Juhani Kaijanaho.
You may treat this file as if it were in the public domain.
-}
module Main where
import Graphics.SOE.Gtk
main = runGraphics $
do w <- openWindowEx "Bouncing Ball" Nothing (Just (300, 300)) drawBufferedGraphic (Just 30)
let loop x y xd yd
= do... | {- Written by Antti-Juhani Kaijanaho.
You may treat this file as if it were in the public domain.
-}
module Main where
import Graphics.SOE.Gtk
main = runGraphics $
do w <- openWindowEx "Bouncing Ball" Nothing (Just (300, 300)) drawBufferedGraphic
let loop x y xd yd
= do setGraphi... | Fix ball soe demo to work with newer soe api | Fix ball soe demo to work with newer soe api
darcs-hash:20071107171349-adfee-a69132de4cffa94335b777e828d01629190129e9.gz
| Haskell | lgpl-2.1 | thiagoarrais/gtk2hs,thiagoarrais/gtk2hs,thiagoarrais/gtk2hs |
4bb79bc13c344e8b5e7877c2bf8e1626a7a59dd2 | Criterion/Monad.hs | Criterion/Monad.hs | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- |
-- Module : Criterion.Monad
-- Copyright : (c) 2009 Neil Brown
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- The environment in which most criterion code executes.
module Criterion.Monad
... | {-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
-- |
-- Module : Criterion.Monad
-- Copyright : (c) 2009 Neil Brown
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- The environment in which most criterion code executes.
... | Prepare to add a GenIO to Criterion monad | Prepare to add a GenIO to Criterion monad
| Haskell | bsd-2-clause | bos/criterion,bgamari/criterion,rrnewton/criterion,iu-parfunc/criterion,rrnewton/criterion,rrnewton/criterion,bgamari/criterion,bos/criterion,bos/criterion,paulolieuthier/criterion,paulolieuthier/criterion,bgamari/criterion,iu-parfunc/criterion,iu-parfunc/criterion,osa1/criterion,osa1/criterion,paulolieuthier/criterion |
4418076d53f7d3d1ffe308523c0b2c094e760d4f | src/Foreign/Inference/Analysis/Return.hs | src/Foreign/Inference/Analysis/Return.hs | module Foreign.Inference.Analysis.Return (
ReturnSummary,
identifyReturns
) where
import Data.Monoid
import Data.Set ( Set )
import qualified Data.Set as S
import Data.LLVM
import Data.LLVM.Analysis.CallGraph
import Data.LLVM.Analysis.NoReturn
import Foreign.Inference.Diagnostics
import Foreign.Inference.Inter... | module Foreign.Inference.Analysis.Return (
ReturnSummary,
identifyReturns
) where
import Control.Monad.Identity
import Data.Monoid
import Data.Set ( Set )
import qualified Data.Set as S
import Data.LLVM
import Data.LLVM.Analysis.CallGraph
import Data.LLVM.Analysis.NoReturn
import Foreign.Inference.Diagnostics
... | Update the return analysis to use the newly-monadic low-level return analysis | Update the return analysis to use the newly-monadic low-level return analysis
| Haskell | bsd-3-clause | travitch/foreign-inference,travitch/foreign-inference |
fa0ea8cd129f3d047c85a048de9d33abdfe8b0ce | example/push/Main.hs | example/push/Main.hs | module Main where
import Control.Exception (displayException)
import Data.Aeson ((.=))
import Data.Monoid ((<>))
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy as BS
import qualified Data.HashMap.Strict as H
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Da... | module Main where
import Control.Exception (displayException)
import Data.Monoid ((<>))
import qualified Data.Aeson as A
import qualified Data.HashMap.Strict as H
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Yaml as Y
import qualified Network.Pusher as P
main :: IO ()
main... | Remove redundant imports from push example | Remove redundant imports from push example
| Haskell | mit | pusher-community/pusher-http-haskell |
09e9bfa9d86e6d44c791ac527ce716589bc2ccea | tests/BucketLoaderTests.hs | tests/BucketLoaderTests.hs | module BucketLoaderTests
( bucketLoadingTests
) where
import Test.HUnit
import BucketLoader (loadBucketFrom)
import Utils (withTemporaryDirectory)
import BucketLoader (createBucket)
import System.Directory
givenABucketAt = createBucket
givenFilesInBucketAt path = do
createDirectory $ path ++ "/oneFile"
... | module BucketLoaderTests
( bucketLoadingTests
) where
import Test.HUnit
import BucketLoader (loadBucketFrom)
import Utils (withTemporaryDirectory)
import BucketLoader (createBucket)
import System.Directory
import qualified Data.Set as Set
givenABucketAt = createBucket
givenFilesInBucketAt path = do
create... | Make file list comparison with sets so that order doesn't matter. | Make file list comparison with sets so that order doesn't matter.
| Haskell | bsd-3-clause | rickardlindberg/orgapp |
1f21dee25021131a916e10cb386214544742a09f | grin/test/PipelineSpec.hs | grin/test/PipelineSpec.hs | module PipelineSpec where
import Data.Functor.Infix ((<$$>))
import Data.List ((\\))
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Monadic
import Pipeline
import Test
import Eval
import Pretty
runTests :: IO ()
runTests = hspec spec
spec :: Spec
spec = do
it "Exploratory testing on random progra... | module PipelineSpec where
import Data.Functor.Infix ((<$$>))
import Data.List ((\\), nub)
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Monadic
import Pipeline
import Test
import Eval
import Pretty
runTests :: IO ()
runTests = hspec spec
spec :: Spec
spec = do
it "Exploratory testing on random p... | Print generated grin, simplyfy pipeline, do not shrink. | Print generated grin, simplyfy pipeline, do not shrink.
| Haskell | bsd-3-clause | andorp/grin,andorp/grin |
f11eceb65308d3ff74b6a8b3608b679cb60a8ac3 | src/Pos/Wallet/Update.hs | src/Pos/Wallet/Update.hs | -- | Functions for operating with transactions
module Pos.Wallet.Update
( submitVote
, submitUpdateProposal
) where
import Mockable (forConcurrently)
import Node (SendActions)
import Pos.Util.TimeWarp (NetworkAddress)
imp... | -- | Functions for operating with transactions
module Pos.Wallet.Update
( submitVote
, submitUpdateProposal
) where
import Mockable (forConcurrently)
import Node (SendActions)
import Pos.Util.TimeWarp (NetworkAddress)
imp... | Use calculated UpId in propose-update | [CSL-513] Use calculated UpId in propose-update
| Haskell | apache-2.0 | input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/pos-haskell-prototype |
309ed6136f3c6f81fb532104d46e5ea08e21e08c | test/Spec.hs | test/Spec.hs | module Main (main) where
import Test.Tasty
import Test.Tasty.Hspec
import Test.Tasty.Runners.AntXML
main :: IO ()
main = do
theSpecs <- testSpec "Specs" specs
defaultMainWithIngredients [antXMLRunner] theSpecs
specs :: Spec
specs = do
describe "A test" $ do
it "passes" $ (1::Int) `shouldBe` 1
| 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... | Add the console runner back in | Add the console runner back in
| Haskell | bsd-3-clause | cdodev/scintilla |
525abf145b942946ec53f06b321b6f9cfc6a562d | xmonad/xmonad.hs | xmonad/xmonad.hs | import XMonad
-- For key bindings
import qualified Data.Map as M
main = xmonad defaults
defaults = defaultConfig
-- Use super instead of alt as the modkey
{ modMask = mod4Mask
, borderWidth = 2
, normalBorderColor = "#4488FF"
, focusedBorderColor = "#FF4455"
, workspaces = myWorkSpaces
, keys = \c -> m... | import XMonad
-- For key bindings
import qualified Data.Map as M
main = xmonad defaults
defaults = defaultConfig
-- Use super instead of alt as the modkey
{ modMask = mod4Mask
, borderWidth = 2
, normalBorderColor = "#000"
, focusedBorderColor = "#4488FF"
, workspaces = myWorkSpaces
, keys = \c -> myKe... | Change workspaces and border color; add Amarok shortcut | Change workspaces and border color; add Amarok shortcut
| Haskell | mit | j-a-m-l/.dot,noijd/.dot,j-a-m-l/.dot,noijd/.dot,j-a-m-l/.dot,noijd/.dot,j-a-m-l/.dot,noijd/.dot |
0a4d909594da051936744352c064eabd27605f6a | src/Verifier/SAW/Prelude.hs | src/Verifier/SAW/Prelude.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Module : Verifier.SAW.Prelude
Copyright : Galois, Inc. 2012-2014
License : BSD3
Maintainer : jhendrix@galois.com
Stability : experimental
Portability : non-portable (language extensions)
-}
module Verifier.SAW.Prelude
( Module
, module Verif... | {-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Module : Verifier.SAW.Prelude
Copyright : Galois, Inc. 2012-2014
License : BSD3
Maintainer : jhendrix@galois.com
Stability : experimental
Portability : non-portable (language extensions)
-}
module Verifier.SAW.Prelude
( Module
, module Verif... | Move 'scEq' from SAWScript to SAWCore. | Move 'scEq' from SAWScript to SAWCore.
| Haskell | bsd-3-clause | GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script |
9800b5392a4925bfba20c8c63be5076bd198475f | src/Draw/Widths.hs | src/Draw/Widths.hs | module Draw.Widths where
gridres :: Int
gridres = 40
gridresd :: Double
gridresd = fromIntegral gridres
onepix :: Double
onepix = 1 / fromIntegral gridres
twopix, fourpix :: Double
twopix = 2 * onepix
fourpix = 4 * onepix
gridwidth :: Double
gridwidth = onepix
framewidthfactor :: Double
framewidthfactor = 4
edge... | module Draw.Widths where
gridres :: Int
gridres = 40
gridresd :: Double
gridresd = fromIntegral gridres
onepix :: Double
onepix = 1 / fromIntegral gridres
twopix, fourpix :: Double
twopix = 2 * onepix
fourpix = 4 * onepix
gridwidth :: Double
gridwidth = onepix
framewidthfactor :: Double
framewidthfactor = 4
edge... | Revert "fix borderwidth for extrudeEnvelope bugfix" | Revert "fix borderwidth for extrudeEnvelope bugfix"
This reverts commit 42ddea993bb43d48e4f443d664cc79acd84458a9.
Wrong branch
| Haskell | mit | robx/puzzle-draw,robx/puzzle-draw |
fa042dd15739866063c242376442d95bbac1fb6b | src/Main.hs | src/Main.hs | -- | The docvim executable.
module Main (main) where
import Options.Applicative
import Data.Version (showVersion)
import qualified Paths_docvim (version)
data Options = Options
{ debug :: Bool
, directory :: String }
version = infoOption (showVersion Paths_docvim.version)
( long "version"
<> help "Print ver... | -- | The docvim executable.
module Main (main) where
import Options.Applicative
import Data.Version (showVersion)
import qualified Paths_docvim (version)
data Options = Options
{ debug :: Bool
, directory :: String }
version = infoOption (showVersion Paths_docvim.version)
( long "version"
<> help "Print ver... | Correct typo in help output | Correct typo in help output
| Haskell | mit | wincent/docvim |
dddc993acaddc4b8e3ecc1087ec95846f4d4bc5a | src/Type.hs | src/Type.hs |
module Type(
Item(..), Items(..),
isIPackage, isIModule,
URL, Documentation,
Id(..),
Query(..), QTag(..)
) where
import Numeric
import Control.Monad
import Data.Monoid
import Language.Haskell.Exts.Annotated
---------------------------------------------------------------------
-- DATABASE
typ... |
module Type(
Database(..),
Item(..), Items(..),
isIPackage, isIModule,
URL, Documentation,
Id(..),
Query(..), QTag(..)
) where
import Numeric
import Control.Monad
import Data.Monoid
import Language.Haskell.Exts.Annotated
newtype Database = Database FilePath
------------------------------... | Add an alias for the Database root | Add an alias for the Database root
| Haskell | bsd-3-clause | wolftune/hoogle,wolftune/hoogle,BartAdv/hoogle,ndmitchell/hogle-dead,BartAdv/hoogle,ndmitchell/hoogle,wolftune/hoogle,ndmitchell/hoogle,BartAdv/hoogle,ndmitchell/hoogle,wolftune/hoogle,ndmitchell/hogle-dead,BartAdv/hoogle |
a401d42b43a763e7caf08c7dc824387c30568d45 | 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 |
8cf2e200337a6d4db45d54de9c57dfc3301bc356 | src/Main.hs | src/Main.hs |
module Main(main) where
import Control.Monad
import Data.Maybe
import System.Console.CmdArgs
import System.IO
import Arguments
import Cabal
import Darcs
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
args <- cmdArgsRun arguments
fromMaybe (error $ "Don't know how to deal with argument: " ++ s... |
module Main(main) where
import Control.Monad
import Data.Maybe
import System.Console.CmdArgs
import System.Environment
import System.IO
import Arguments
import Cabal
import Darcs
import qualified Paper.Main as Paper
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
a <- getArgs
case a of
... | Integrate back in the Paper commands as a custom command | Integrate back in the Paper commands as a custom command
| Haskell | bsd-3-clause | Daniel-Diaz/neil,saep/neil |
5ede5b5d76f658644834931c268ea1b2208be508 | src/Test/Benchmark.hs | src/Test/Benchmark.hs |
module Test.Benchmark(main) where
import General.GetOpt
import Text.Read
import Development.Shake
import Test.Type
import Development.Shake.FilePath
data Opts = Depth Int | Breadth Int
opts = [Option "" ["depth" ] (ReqArg (fmap Depth . readEither) "INT") ""
,Option "" ["breadth"] (ReqArg (fmap Breadth . r... |
module Test.Benchmark(main) where
import General.GetOpt
import Development.Shake
import Test.Type
import Development.Shake.FilePath
data Opts = Depth Int | Breadth Int
opts = [Option "" ["depth" ] (ReqArg (fmap Depth . readEither) "INT") ""
,Option "" ["breadth"] (ReqArg (fmap Breadth . readEither) "INT")... | Make Shake compatible with older GHC | Make Shake compatible with older GHC
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
26b712729dd8f158249398a9afcb9a91fc51c0c8 | GameDefinition/Main.hs | GameDefinition/Main.hs | -- | The main source code file of LambdaHack the game.
-- Module "TieKnot" is separated to make it usable in tests.
module Main
( main
) where
import Prelude ()
import Game.LambdaHack.Common.Prelude
import System.Environment (getArgs)
import TieKnot
-- | Tie the LambdaHack engine client, server and frontend co... | -- | The main source code file of LambdaHack the game.
-- Module "TieKnot" is separated to make it usable in tests.
module Main
( main
) where
import Prelude ()
import Game.LambdaHack.Common.Prelude
import Control.Concurrent.Async
import System.Environment (getArgs)
import TieKnot
-- | Tie the LambdaHack engin... | Move server to a non-bound thread gaining almost double speedup in --frontendNull | Move server to a non-bound thread gaining almost double speedup in --frontendNull
| Haskell | bsd-3-clause | LambdaHack/LambdaHack |
a739bf3865ab1cc59051223bed2198ea4705f6dd | data/HLint_Hints.hs | data/HLint_Hints.hs |
import HLint.HLint
-- Hints that apply only to the HLint source code
error = QVarOp a (UnQual b x) ==> toNamed x
error = QConOp a (UnQual b x) ==> toNamed x
error = UnQual a (Symbol b x) ==> toNamed x
error = UnQual a (Ident b x) ==> toNamed x
-- deliberately creates an Ident with "...", which should be a symbol
i... |
import HLint.HLint
-- Hints that apply only to the HLint source code
error = QVarOp a (UnQual b x) ==> toNamed x
error = QConOp a (UnQual b x) ==> toNamed x
error = UnQual a (Symbol b x) ==> toNamed x
error = UnQual a (Ident b x) ==> toNamed x
error = idea Error ==> err
error = idea Warning ==> warn
-- deliberatel... | Add some more hints to the HLint hint set | Add some more hints to the HLint hint set | Haskell | bsd-3-clause | mpickering/hlint,gibiansky/hlint,ndmitchell/hlint,ndmitchell/hlint,eigengrau/hlint,bitemyapp/hlint |
aa6f731ba1cb1b172c2700f99220ca3584ec460d | haskell/hw5.hs | haskell/hw5.hs | -- See https://github.com/Jakehp/PLC/blob/master/pdfs/hwk5.pdf
is_member :: [Int] -> Int -> Bool
is_member l x = foldl (\hasBeenFound e -> if not hasBeenFound then x == e else hasBeenFound) False l
| -- See https://github.com/Jakehp/PLC/blob/master/pdfs/hwk5.pdf
is_member :: (Eq a) => [a] -> a -> Bool
is_member l x = foldl (\hasBeenFound e -> if not hasBeenFound then x == e else hasBeenFound) False l
| Change function type declaration to use equals typeclass. | Change function type declaration to use equals typeclass.
| Haskell | mit | Jakehp/PLC |
f0f08264cf3389984d651bf2ad3216103e860ad7 | src/Main.hs | src/Main.hs | module Main ( main ) where
import qualified Game.LambdaHack.Display as Display
import qualified Game.LambdaHack.Kind as Kind
import qualified Content.ActorKind
import qualified Content.CaveKind
import qualified Content.ItemKind
import qualified Content.RoomKind
import qualified Content.RuleKind
import qualified Conten... | module Main ( main ) where
import qualified Game.LambdaHack.Display as Display
import qualified Game.LambdaHack.Kind as Kind
import qualified Content.ActorKind
import qualified Content.CaveKind
import qualified Content.ItemKind
import qualified Content.RoomKind
import qualified Content.RuleKind
import qualified Conten... | Update wrt command overriding in engine | Update wrt command overriding in engine
| Haskell | agpl-3.0 | AllureOfTheStars/Allure |
64805e853024e50601620519604ebb94acd505f7 | XMonad/Config/Desktop.hs | XMonad/Config/Desktop.hs | {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Config.Desktop
-- Copyright : (c) Spencer Janssen <sjanssen@cse.unl.edu>
-- License : BSD
--
-- Maintainer : Spencer Janssen <sjanssen@cse.unl.edu>
--
-... | {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Config.Desktop
-- Copyright : (c) Spencer Janssen <sjanssen@cse.unl.edu>
-- License : BSD
--
-- Maintainer : Spencer Janssen <sjanssen@cse.unl.edu>
--
-... | Add ToggleStruts to the desktop config | Add ToggleStruts to the desktop config | Haskell | bsd-3-clause | MasseR/xmonadcontrib,MasseR/xmonadcontrib |
7a9577df1b6dac7c52bf2cd517d6bb3b71ac846e | Test/SmallCheck/Traversal.hs | Test/SmallCheck/Traversal.hs | {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Test.SmallCheck.Traversal where
import Control.Lens
import Data.Functor.Compose (Compose(..), getCompose)
import Test.SmallCheck (Property)
import qualified Test.SmallCheck as SC (over)
import Test.SmallCheck.Seri... | {-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Test.SmallCheck.Traversal where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative (Applicative, pure)
#endif
import Control.Lens
import Data.Functor.Compose (Compose(..), getCompose)
imp... | Fix compability based < 4.8 | Fix compability based < 4.8
| Haskell | bsd-3-clause | jdnavarro/smallcheck-lens,jdnavarro/tasty-lens |
d18e8c73848acb354152fbafbbc80122725168dd | src/Ecumenical.hs | src/Ecumenical.hs | {-# LANGUAGE OverloadedStrings #-}
module Ecumenical
( retrieve
, put
) where
import Prelude hiding (readFile, writeFile)
import Data.ByteString.Char8
import Control.Exception
import Control.Monad.Reader
-- Get a value from the store by key, if it exists.
retrieve :: ByteString -> IO (Maybe ByteString)
re... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Ecumenical
( retrieve
, put
) where
import Prelude hiding (readFile, writeFile)
import Data.ByteString.Char8
import Control.Exception
import Control.Monad.Reader
import Control.Monad.Trans
newtype MockDB m a = MockDB
... | Add some mock types with monad transformer and reader for testing | Add some mock types with monad transformer and reader for testing
| Haskell | bsd-3-clause | tripped/hlog |
34fde85966852897e16f61ed42ce2fc5ebdcf4af | test/Yesod/Test/Extension.hs | test/Yesod/Test/Extension.hs | {-# LANGUAGE OverloadedStrings #-}
module Yesod.Test.Extension
( getWithParams
, postForm
, valueEquals
, module Yesod.Test
) where
import Yesod.Test
import Test.Hspec.Expectations.Lifted
import Yesod (Yesod, RedirectUrl)
import Data.Aeson (Value, eitherDecode)
import Data.Text (Text)
import Data.B... | {-# LANGUAGE OverloadedStrings #-}
module Yesod.Test.Extension
( getWithParams
, postForm
, valueEquals
, module Yesod.Test
) where
import Yesod.Test
import Test.Hspec.Expectations.Lifted
import Yesod (Yesod, RedirectUrl)
import Data.Aeson (Value, eitherDecode)
import Data.Text (Text)
import Networ... | Address -Wall warning in test module | Address -Wall warning in test module
| Haskell | mit | peterwang/carnival,vaporware/carnival,thoughtbot/carnival |
0a4a3eb1df53bf4df3beef07cdfcd1cf8bada921 | Command/LsDupes.hs | Command/LsDupes.hs | module Command.LsDupes (
Options
, parserInfo
, run
) where
import Data.List as List
import Options.Applicative
import System.FilePath ( (</>) )
import Dupes
import qualified Settings
import Store.LevelDB as LevelDB
data Options = Options
{ optDupeOnly :: Bool }
parserInfo :: ParserInfo Options
parserInfo = ... | module Command.LsDupes (
Options
, parserInfo
, run
) where
import Data.List as List
import Options.Applicative
import System.FilePath ( (</>) )
import Dupes
import qualified Settings
import Store.LevelDB as LevelDB
data Options = Options
{ optDupeOnly :: Bool }
parserInfo :: ParserInfo Options
parserInfo = ... | Change ls-dupes output to be a single line per bucket, separated by commas. | Change ls-dupes output to be a single line per bucket, separated by commas.
| Haskell | mit | danstiner/clod |
1dd9bdeaa2c89ba75427e9cc1d6fb675cb0ae8f3 | tdiagrams/test/EndToEnd.hs | tdiagrams/test/EndToEnd.hs | import Programs
import CCO.Component (Component, component, ioRun, printer)
import CCO.Diag (parser)
import CCO.Tree (ATerm, Tree (fromTree, toTree))
import CCO.TypeCheck (typeCheckATerm)
import CCO.Diag2Picture (diag2pictureATerm)
import CCO.Picture (Picture)
import Control.Arrow (Arrow (arr), (>>>))
import System.I... | import Programs
import CCO.Component (Component, component, ioRun, printer)
import CCO.Diag (parser)
import CCO.Tree (ATerm, Tree (fromTree, toTree))
import CCO.TypeCheck (typeCheckATerm)
import CCO.Diag2Picture (diag2pictureATerm)
import CCO.Picture (Picture)
import Control.Arrow (Arrow (arr), (>>>))
import System.I... | Fix end to end tests | Fix end to end tests
| Haskell | apache-2.0 | aochagavia/CompilerConstruction |
6b1e932f2d7315d70ccd7df6417009a86b998c0d | Language/Common.hs | Language/Common.hs | {-# LANGUAGE NoImplicitPrelude, DeriveDataTypeable #-}
module FOL.Language.Common
( Real
, Name (..)
, primitives
, compose
, module Prelude
)
where
import Data.Data
import Prelude hiding (Real)
type Real = Double
data Name = Name String deriving (Eq, Ord, Show, Typeable, Data)
primitiv... | {-# LANGUAGE NoImplicitPrelude, DeriveDataTypeable, TypeOperators, MultiParamTypeClasses #-}
module FOL.Language.Common
( Real
, Name (..)
, primitives
, compose
, (:<:) (..)
, module Prelude
)
where
import Data.Data
import Prelude hiding (Real)
type Real = Double
data Name = Name St... | Introduce a type class to capture subtype relation. | Introduce a type class to capture subtype relation.
| Haskell | agpl-3.0 | axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language |
2612f177b8c91c4c53086e3aac29502fe13b3016 | test.hs | test.hs |
module Main where
import System.Console.Readline
import Control.Monad.IO.Class (liftIO)
import Control.Monad.State
import Data.Text
import MOO.Parser
import MOO.Compiler
import MOO.Execution
import MOO.Types
main :: IO ()
main = repLoop initStack
repLoop stack = do
maybeLine <- readline ">> "
case maybeLine of... |
module Main where
import System.Console.Readline
import Control.Monad.IO.Class (liftIO)
import Control.Monad.State
import Data.Text
import MOO.Parser
import MOO.Compiler
import MOO.Execution
import MOO.Types
import MOO.Builtins
main :: IO ()
main = do
case verifyBuiltins of
Left err -> putStrLn $ "Built-in f... | Verify built-in functions on REPL launch | Verify built-in functions on REPL launch
| Haskell | bsd-3-clause | verement/etamoo |
e7e58aaff96f2f74097ea8f605b216b8fdd15443 | src/Settings/Builders/Make.hs | src/Settings/Builders/Make.hs | module Settings.Builders.Make (makeBuilderArgs) where
import Base
import Predicate
import Settings
makeBuilderArgs :: Args
makeBuilderArgs = do
threads <- shakeThreads <$> lift getShakeOptions
let j = "-j" ++ show threads
mconcat
[ builder (Make gmpBuildPath ) ? append ["MAKEFLAGS=" ++ j]
... | module Settings.Builders.Make (makeBuilderArgs) where
import Base
import Predicate
import Settings
makeBuilderArgs :: Args
makeBuilderArgs = do
threads <- shakeThreads <$> lift getShakeOptions
let j = "-j" ++ show threads
mconcat
[ builder (Make gmpBuildPath ) ? append ["MAKEFLAGS=" ++ j]
... | Set `THREADS` when running validate | Set `THREADS` when running validate
GHC testsuite uses the `THREADS` env variable (and not the make's `-j`
setting) to control the parallelism. This commit sets THREADS to the
value of `shakeThreads`.
| Haskell | bsd-3-clause | sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,bgamari/shaking-up-ghc,snowleopard/shaking-up-ghc,izgzhen/hadrian,sdiehl/ghc,sdiehl/ghc,snowleopard/hadrian,sdiehl/ghc |
c9efe9d7b010adbd11b5cd59fff24cc05c38564b | lib/Text/Docvim/Optimize.hs | lib/Text/Docvim/Optimize.hs | module Text.Docvim.Optimize (optimize) where
import Control.Lens hiding (Empty)
import Text.Docvim.AST
-- | "Optimize" a Project's AST by eliminating empty paths.
optimize :: Node -> Node
optimize = transform prune
-- | Marks a node for pruning by returning Empty if it has no non-Empty
-- children.
prune :: Node -> ... | module Text.Docvim.Optimize (optimize) where
import Control.Lens (children, transform)
import Text.Docvim.AST
-- | "Optimize" a Project's AST by eliminating empty paths.
optimize :: Node -> Node
optimize = transform prune
-- | Marks a node for pruning by returning Empty if it has no non-Empty
-- children.
prune :: N... | Tweak Control.Lens import for better compatibility | Tweak Control.Lens import for better compatibility
One of the CI runs blowing up:
/home/travis/build/wincent/docvim/lib/Text/Docvim/Optimize.hs:3:1: Warning:
Module ‘Control.Lens’ does not export ‘Empty’
<no location info>:
Failing due to -Werror.
Source: https://travis-ci.org/wincent/docvim/jobs... | Haskell | mit | wincent/docvim |
ca12d573a590684e1f9b76b38c95dafbcc0fcb44 | subs/curator/src/Curator/Constants.hs | subs/curator/src/Curator/Constants.hs | module Curator.Constants
( snapshotFilename
, constraintsFilename
, snapshotsRepo
, constraintsRepo
) where
snapshotFilename :: FilePath
snapshotFilename = "snapshot.yaml"
constraintsFilename :: FilePath
constraintsFilename = "constraints.yaml"
snapshotsRepo :: String
snapshotsRepo = "commercial... | module Curator.Constants
( snapshotFilename
, constraintsFilename
, snapshotsRepo
, constraintsRepo
) where
snapshotFilename :: FilePath
snapshotFilename = "snapshot.yaml"
constraintsFilename :: FilePath
constraintsFilename = "constraints.yaml"
snapshotsRepo :: String
snapshotsRepo = "commercial... | Switch to the real repos | Switch to the real repos
| Haskell | bsd-3-clause | juhp/stack,juhp/stack |
17b7cf489741b6d74fb3dfa5bc7e88a65aa27fab | Test/QuickCheck/Exception.hs | Test/QuickCheck/Exception.hs | module Test.QuickCheck.Exception where
import Control.Exception
( evaluate
, try
, Exception
)
--------------------------------------------------------------------------
-- try evaluate
--type Exception = SomeException
tryEvaluate :: a -> IO (Either Exception a)
tryEvaluate x = tryEvaluateIO (return x)
try... | {-# LANGUAGE CPP #-}
module Test.QuickCheck.Exception where
#if !defined(__GLASGOW_HASKELL__) || (__GLASGOW_HASKELL__ >= 609)
#define EXCEPTION SomeException
#else
#define EXCEPTION Exception
#endif
import Control.Exception
( evaluate
, try
, EXCEPTION
)
------------------------------------------------------... | Use extensible exceptions on GHC 6.10. | Use extensible exceptions on GHC 6.10.
| Haskell | bsd-3-clause | Warbo/quickcheck,beni55/quickcheck,srhb/quickcheck,nh2/quickcheck,soenkehahn/quickcheck |
c9cc1e281bfb7007b6603326e70a975340dd7eb2 | dotfiles/x/.xmonad/xmonad.hs | dotfiles/x/.xmonad/xmonad.hs | import XMonad
main =
xmonad def {
modMask = mod4Mask -- Rebind Mod to the 'Windows' key
}
| import XMonad
import XMonad.Hooks.ManageDocks
main = xmonad def
{ manageHook = manageDocks <+> manageHook def
, layoutHook = avoidStruts $ layoutHook def
, modMask = mod4Mask -- Rebind Mod to the 'Windows' key
}
| Add space for panel dock and tray | Add space for panel dock and tray
| Haskell | mit | GuiltyDolphin/config,GuiltyDolphin/config |
ed523f4e698f1f85c77c4fe992c7e63bc611531c | GitHub.hs | GitHub.hs | {-# LANGUAGE OverloadedStrings #-}
module GitHub ( Client
, newClient
, fetchPath
) where
import Data.Maybe (fromJust)
import Import
data Client = Client { getToken :: Text
, getManager :: Manager
}
-- Creates a GitHub client with t... | {-# LANGUAGE OverloadedStrings #-}
module GitHub ( Client
, newClient
, fetchPath
) where
import Data.Maybe (fromJust)
import Import
data Client = Client { getToken :: Text
, getManager :: Manager
}
-- Creates a GitHub client with t... | Fix query string syntax :disappointed: | Fix query string syntax :disappointed:
| Haskell | mit | jspahrsummers/ScrumBut |
848ed5d5e5ec5b2d53ebcfc8e17b99d7e6fa16e6 | src/Cabal2Nix/Flags.hs | src/Cabal2Nix/Flags.hs | module Cabal2Nix.Flags ( configureCabalFlags ) where
import Distribution.Package
import Distribution.PackageDescription
configureCabalFlags :: PackageIdentifier -> FlagAssignment
configureCabalFlags (PackageIdentifier (PackageName name) _)
| name == "accelerate-examples"= [disable "opencl"]
| name == "haskeline" ... | module Cabal2Nix.Flags ( configureCabalFlags ) where
import Distribution.Package
import Distribution.PackageDescription
configureCabalFlags :: PackageIdentifier -> FlagAssignment
configureCabalFlags (PackageIdentifier (PackageName name) _)
| name == "accelerate-examples"= [disable "opencl"]
| name == "pandoc" ... | Enable blaze_html_0_5 flag in pandoc. | Enable blaze_html_0_5 flag in pandoc.
| Haskell | bsd-3-clause | jb55/cabal2nix,Fuuzetsu/cabal2nix,bennofs/cabal2nix,spencerjanssen/cabal2nix,gridaphobe/cabal2nix,psibi/cabal2nix,dmalikov/cabal2nix |
6569a7ba1bc48fdc7613c3d86864262f1ed8ce1c | clk-ls.hs | clk-ls.hs | import App.Clk.Entry
import App.Clk.Util
import Data.List
import Data.Time.Clock
import Data.Time.LocalTime
main = do
tz <- getCurrentTimeZone
entries <- mostRecentMonthEntries
putStrLn $ intercalate "\n" $ map (showUser tz) $ entries
showUser :: TimeZone -> Entry -> String
showUser tz (Entry name tim... | import App.Clk.Entry
import App.Clk.Util
import Data.List
import Data.Time.Clock
import Data.Time.LocalTime
main = do
tz <- getCurrentTimeZone
entries <- mostRecentMonthEntries
putStrLn $ intercalate "\n" $ map (showUser tz) $ entries
showUser :: TimeZone -> Entry -> String
showUser tz (Entry name tim... | Use 'otherwise' in a guard statement | Use 'otherwise' in a guard statement
I suppose this is the proper way to implement this bit of code. Using
'otherwise' seems cleaner since it doesn't require duplicating a
variable name and it clearly shows the fall through, default state.
| Haskell | unlicense | mndrix/clk |
e401e84189c5db4bfea8bba76e7de226733a3ab4 | src/Pos/Update/Worker.hs | src/Pos/Update/Worker.hs | -- | Update System related workers.
module Pos.Update.Worker
( usWorkers
) where
import Node (SendActions)
import Universum
import Pos.Communication.BiP (BiP)
import Pos.Slotting (onNewSlot)
import Pos.Types (SlotId... | -- | Update System related workers.
module Pos.Update.Worker
( usWorkers
) where
import Node (SendActions)
import Universum
import Pos.Communication.BiP (BiP)
import Pos.Slotting (onNewSlot)
import Pos.Types (Sl... | Use processNewSlot in US worker | [CSL-516] Use processNewSlot in US worker
| Haskell | apache-2.0 | input-output-hk/pos-haskell-prototype,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/cardano-sl,input-output-hk/cardano-sl |
72ad6017ff4946c226ebc05a1b1e53fab3f1f265 | tests/timing/TimeFFTW.hs | tests/timing/TimeFFTW.hs | module Main where
import Data.Vector.Storable as V
import Data.Vector.Storable.Mutable as M
import Math.FFT.Vector.Unnormalized as U
import Math.FFT.Vector.Plan
import Data.Numskell.Vector as N
import Criterion.Main
import Data.Complex
import System.Environment
main = do
[n] <- fmap (fmap Prelude.read) getArgs
... | {-# LANGUAGE BangPatterns #-}
module Main where
import Data.Vector.Storable as V
import Data.Vector.Storable.Mutable as M
import Numeric.FFT.Vector.Unnormalized as U
import Numeric.FFT.Vector.Plan
import Data.Numskell.Vector as N
import Criterion.Main
import Data.Complex
import System.Environment
main = do
[n] <... | Update timing test to use latest module names. | Update timing test to use latest module names.
| Haskell | bsd-3-clause | judah/vector-fftw |
21186e31f7b3e8c053f2a2fa828b98f1da7eed6c | src/Hangman.hs | src/Hangman.hs | module Hangman
where
import Control.Monad (when, unless)
-- import Control.Monad.Trans.State.Strict (StateT, put, get, modify)
-- type State = StateT (Input, Guess) IO
type Input =
String
type Guess =
String
hangman :: IO ()
hangman =
do
putStr "Enter a word: "
word <- getLine
play word ""
h... | module Hangman (hangman)
where
import Control.Monad (when)
hangman :: IO ()
hangman =
do
word <- getWord
win <- play word "" 0
when win hangman
where
getWord :: IO String
getWord =
do putStr "Enter a word: "
getLine
play :: String -> String -> Int -> IO Bool
play wor... | Add hangman ASCII figure + refactorings | Add hangman ASCII figure + refactorings
| Haskell | mit | futtetennista/IntroductionToFunctionalProgramming |
df8d6fe778149024210532af074e0ebddc4ca81b | src/Test/Live.hs | src/Test/Live.hs |
module Test.Live(main) where
import Development.Shake
import Test.Type
main = shakeTest_ test $ do
let obj = id
obj "foo" %> \ out -> do
need [obj "bar"]
writeFile' out ""
obj "bar" %> \out -> writeFile' out ""
obj "baz" %> \out -> writeFile' out ""
test build = do
let obj = ... |
module Test.Live(main) where
import Development.Shake
import Test.Type
main = shakeTest_ test $ do
"foo" %> \ out -> do
need ["bar"]
writeFile' out ""
"bar" %> \out -> writeFile' out ""
"baz" %> \out -> writeFile' out ""
test build = do
build ["clean"]
build ["foo","baz","--li... | Delete obj = id from live | Delete obj = id from live
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
28f60fd181d3c32f1e690257fbe4c620938d513f | generate/src/Data/List/Extra2.hs | generate/src/Data/List/Extra2.hs | module Data.List.Extra2
( iterateSuffixes
, iterateSuffixesM
, module Data.List.Extra
) where
import Data.Bifunctor
import Data.Foldable
import Data.List.Extra
iterateSuffixes
:: forall a b
. ([a] -> (b, [a]))
-- ^ A function which takes a list transforming it and returnin... | {-# LANGUAGE ScopedTypeVariables #-}
module Data.List.Extra2
( iterateSuffixes
, iterateSuffixesM
, module Data.List.Extra
) where
import Data.Bifunctor
import Data.Foldable
import Data.List.Extra
iterateSuffixes
:: forall a b
. ([a] -> (b, [a]))
-- ^ A function which tak... | Add missing language extension in generate | Add missing language extension in generate
| Haskell | bsd-3-clause | expipiplus1/vulkan,expipiplus1/vulkan,expipiplus1/vulkan |
e7cae3f7734ff98f6259e7b865f9082abe59c371 | src/Test/Smoke/Errors.hs | src/Test/Smoke/Errors.hs | module Test.Smoke.Errors where
import Control.Exception (Exception, throwIO)
import Control.Monad ((<=<))
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE)
runExceptTIO :: (Exception e, MonadIO m) => ExceptT e m a -> m a
runExceptTIO = either (liftIO . thr... | module Test.Smoke.Errors where
import Control.Exception (Exception, throwIO)
import Control.Monad ((<=<))
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE)
runExceptTIO :: (Exception e, MonadIO m) => ExceptT e m a -> m a
runExceptTIO = either (liftIO . thr... | Remove duplication between `onNothingThrow` and `onNothingThrow_`. | Remove duplication between `onNothingThrow` and `onNothingThrow_`.
| Haskell | mit | SamirTalwar/Smoke |
966804b7b2fb69fda578a680fb857510fb3c4d16 | test/integration/tests/4220-freeze-command/Main.hs | test/integration/tests/4220-freeze-command/Main.hs | import Control.Monad (unless)
import StackTest
main :: IO ()
main = do
stackCheckStdout ["freeze"] $ \stdOut -> do
let expected = unlines
[ "packages:"
, "- ."
, "extra-deps:"
, "- hackage: a50-0.5@sha256:b8dfcc13dcbb12e444128bb0e17527a2a7a9bd74ca9450d6f6862c4b394ac054,149... | import Control.Monad (unless)
import StackTest
main :: IO ()
main = do
stackCheckStdout ["freeze"] $ \stdOut -> do
let expected = unlines
[ "resolver:"
, " size: 527165"
, " url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/19.yaml"
... | Fix test suite broken by changes in freeze output | Fix test suite broken by changes in freeze output
| Haskell | bsd-3-clause | juhp/stack,juhp/stack |
2bf387e39e3ed10ee82b33a1ac2c03336e46af5f | src/ZoomHub/API/Errors.hs | src/ZoomHub/API/Errors.hs | {-# LANGUAGE OverloadedStrings #-}
module ZoomHub.API.Errors
( error400
, error404
)
where
import Data.Aeson (encode, object, (.=))
import qualified Data.Text as T
import Servant (ServantErr, err400, err404, errBody, errHeaders)
error400 :: String -> ServantErr
error400 = mkError err4... | {-# LANGUAGE OverloadedStrings #-}
module ZoomHub.API.Errors
( error400
, error404
)
where
import qualified Data.ByteString.Lazy.Char8 as BLC
import Servant (ServantErr, err400, err404,
errBody, errHeaders)
error400 :: String -> Servan... | Revert errors from JSON to plain text | Revert errors from JSON to plain text
| Haskell | mit | zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub |
17574b22fe25c34d32baacf475b7b59a9cc4a307 | 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 Prelude hiding (catch)
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 B... | Hide catch for older ghc versions | Hide catch for older ghc versions
| Haskell | mit | c00w/BitToll,c00w/BitToll,c00w/BitToll,c00w/BitToll |
245ef55ac75f78921a5a180acd6b59cd336ac2eb | Source/Calculator.hs | Source/Calculator.hs | module Calculator where
import Data.List.Split
import Data.List
calculate :: String -> Double
calculate exp
| isInfixOf "+" exp = (read $ head (splitOn "+" exp)) + (read $ last (splitOn "+" exp))
| otherwise = read exp
| module Calculator where
import Data.List.Split
import Data.List
calculate :: String -> Double
calculate exp
| "+" `isInfixOf` exp = read (head (splitOn "+" exp)) + read (last (splitOn "+" exp))
| otherwise = read exp
| Refactor accordingly to compiler hints | Refactor accordingly to compiler hints
| Haskell | mit | ksysu/Calculator |
c738fd63f38405b6417e66393648ed85fb39fac2 | Command.hs | Command.hs |
module Command where
import Utils
import Control.Concurrent
import Control.Exception
import System.Exit
import System.IO
import System.Process
data Line = Stdout String
| Stderr String
deriving (Show, Read)
run :: FilePath -> [String] -> FilePath -> IO ExitCode
run prog args outputFile
= do (hIn, hO... |
module Command where
import Utils
import Control.Concurrent
import Control.Exception
import System.Exit
import System.IO
import System.Process
data Line = Stdout String
| Stderr String
deriving (Show, Read)
run :: FilePath -> [String] -> FilePath -> IO ExitCode
run prog args outputFile
= do (hIn, hO... | Stop the client dieing if a program it tries to run doesn't exist | Stop the client dieing if a program it tries to run doesn't exist | Haskell | bsd-3-clause | bgamari/ghc-builder,haskell/ghc-builder |
3c34eb92850c52eb14493545bb6b2e3a046e9375 | exams/02/variant-b/task-3.hs | exams/02/variant-b/task-3.hs | import Data.List (maximumBy, subsequences, permutations, nub)
import Data.Function (on)
type TVShow = (String, (Int, Int), Int)
type TVProgram = [TVShow]
isSorted :: Ord a => [a] -> Bool
isSorted [] = True
isSorted [x] = True
isSorted (x : y : rest) = x <= y && isSorted (y : rest)
isProgram :: TVProgram -> Bool
isPr... | import Data.List (maximumBy, subsequences, permutations, nub)
import Data.Function (on)
type TVShow = (String, (Int, Int), Int)
type TVProgram = [TVShow]
isSorted :: Ord a => [a] -> Bool
isSorted [] = True
isSorted [_] = True
isSorted (x : y : rest) = x <= y && isSorted (y : rest)
isProgram :: TVProgram -> Bool
isPr... | Replace unused parameter with _ | Replace unused parameter with _
| Haskell | mit | fmi-lab/fp-elective-2017 |
17a0dcc432e15094365957ea397d72d05cbf5c94 | test/Github/Event/JsonSpec.hs | test/Github/Event/JsonSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module Github.Event.JsonSpec
( main
, spec
) where
import Test.Hspec
import Test.QuickCheck.Instances ()
import Data.Aeson
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BL
import ... | {-# LANGUAGE OverloadedStrings #-}
module Github.Event.JsonSpec
( main
, spec
) where
import Test.Hspec
import Test.QuickCheck.Instances ()
import Data.Aeson
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BL
import ... | Split test check into two checks | Split test check into two checks
| Haskell | mit | UlfS/ghmm |
78a4a8e593417d9f5ed60d4db7c1c4bc9ef992c0 | src/MainLoop.hs | src/MainLoop.hs | module MainLoop (mainLoop) where
import Control.Concurrent.STM.TVar (TVar, newTVarIO)
import Control.Concurrent.STM.TBQueue (TBQueue, newTBQueueIO)
import Data.Aeson (Value (..))
import Data.Void (Void)
import Data.Text (Text)
-- Put is a command to put a value at a given path.
data Put = Put [Text] Value
data State... | module MainLoop (mainLoop) where
import Control.Concurrent.STM.TVar (TVar, newTVarIO)
import Control.Concurrent.STM.TBQueue (TBQueue, newTBQueueIO)
import Data.Aeson (Value (..))
import Data.Void (Void)
import Data.Text (Text)
import Data.Maybe (fromMaybe)
import qualified Data.HashMap.Strict as HashMap
-- Put is a ... | Add handlePut function to update the current state | Add handlePut function to update the current state
| Haskell | bsd-3-clause | channable/icepeak,channable/icepeak,channable/icepeak |
96ea1b752918191c4d69d46237cb17063a6aa877 | tests/Parser.hs | tests/Parser.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- | Testing the automata-based Earley-style TAG parser.
module Parser where
import Control.Applicative ((<$>))
import Control.Monad (forM_)
import Test.Tasty (TestTree)
import qualified Data.Set as S
import qualifi... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- | Testing the automata-based Earley-style TAG parser.
module Parser where
import Control.Applicative ((<$>))
import Control.Monad (forM_)
import Test.Tasty (TestTree)
import qualified Data.Set as S
import qualifi... | Update path to the parser module in tests | Update path to the parser module in tests
| Haskell | bsd-2-clause | kawu/partage |
0f9658b646010001dce0d428692be1aabe4c9730 | NationStates/RateLimit.hs | NationStates/RateLimit.hs | -- | Simple rate limiting combinator.
module NationStates.RateLimit (
RateLimit(),
newRateLimit,
rateLimit,
) where
import Control.Concurrent
import System.Clock
data RateLimit = RateLimit {
rateLock :: !(MVar TimeSpec),
rateDelay :: !TimeSpec
}
-- | Create a new rate limiter with the... | -- | Simple rate limiting combinator.
module NationStates.RateLimit (
RateLimit(),
newRateLimit,
rateLimit,
) where
import Control.Concurrent
import Control.Exception
import System.Clock
data RateLimit = RateLimit {
rateLock :: !(MVar TimeSpec),
rateDelay :: !TimeSpec
}
-- | Create a ... | Make rate limiter exception safe | Make rate limiter exception safe
Before this patch, if a request failed then the rate limiter would
behave as if it never happened.
| Haskell | apache-2.0 | lfairy/nationstates |
7796e0bc59a6198a41be2efbb043f8963af15122 | E05/A1.hs | E05/A1.hs | module E05.A1 where
class Zippable t where
genericZipWith :: (a -> b -> c) -> t a -> t b -> t c
genericZip :: t a -> t b -> t (a,b)
genericZip = genericZipWith (\ x y -> (x, y))
listZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
listZipWith f (xa : xas) (xb : xbs) = (f xa xb) : listZipWith f xas xbs
listZ... | module E05.A1 where
class Zippable t where
genericZipWith :: (a -> b -> c) -> t a -> t b -> t c
genericZip :: t a -> t b -> t (a,b)
genericZip = genericZipWith (,)
listZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
listZipWith f (xa : xas) (xb : xbs) = (f xa xb) : listZipWith f xas xbs
listZipWith _ _ ... | Use comma operator for genericZip | E05: Use comma operator for genericZip
| Haskell | mit | sebschrader/programmierung-ss2015 |
cc7b19fb6d546a83af9c8cf58ec0ab0ec6684478 | Language/Hakaru/RoundTrip.hs | Language/Hakaru/RoundTrip.hs | -- This internal module is used by Language.Hakaru.Simplify to parse strings
-- as Hakaru code. It exports just the names that those strings may use.
module Language.Hakaru.RoundTrip
( ()(..), (,)(..), Either(..), Bool(..), Num(..)
, Fractional(..), Floating(..), ($), Any(Any), (^^)
, module Language.Hakaru.Sy... | -- This internal module is used by Language.Hakaru.Simplify to parse strings
-- as Hakaru code. It exports just the names that those strings may use.
module Language.Hakaru.RoundTrip
( ()(..), (,)(..), Either(..), Bool(..), Int(..), Num(..)
, Fractional(..), Floating(..), ($), Any(Any), (^^)
, module Language.... | Allow the word "Int" during roundtripping | Allow the word "Int" during roundtripping
| Haskell | bsd-3-clause | bitemyapp/hakaru,zachsully/hakaru,suhailshergill/hakaru,zaxtax/hakaru,zachsully/hakaru,zaxtax/hakaru |
3001ede0f48dfdc0cd375862d010f8b97800da75 | src/Job.hs | src/Job.hs | module Job where
import Control.Concurrent
import Data.IORef
import System.Process
data Status = Idle | Working
data Job = Job
{ name :: String
, args :: [String]
, status :: Status
, thread :: Maybe ThreadId
, threadMvar :: MVar Status
}
createJobs :: IO [Job]
createJobs = do
m1 <- newE... | module Job where
import Control.Concurrent
import Data.IORef
import System.Process
data Status = Idle | Working
data Job = Job
{ name :: String
, args :: [String]
, status :: Status
, thread :: Maybe ThreadId
, threadMvar :: MVar Status
}
createJobs :: IO [Job]
createJobs = do
m1 <- newE... | Kill ongoing thread if restarting. | Kill ongoing thread if restarting.
| Haskell | bsd-3-clause | rickardlindberg/codemonitor,rickardlindberg/codemonitor |
76f70266b0314eb13747788a53463a23375dc5bf | src/BookCalendar.hs | src/BookCalendar.hs | module BookCalendar where
import Data.Time
currentWordCount :: Integer
currentWordCount = 9048
wordsPerDay :: Integer
wordsPerDay = 333
isWeekend :: FormatTime t => t -> Bool
isWeekend d =
let da = formatTime defaultTimeLocale "%a" d
in da == "Sat" || da == "Sun"
addToDay :: UTCTime -> Integer -> Day
addToDay ... | module BookCalendar where
import Data.Time
import Data.Time.Calendar.WeekDate
currentWordCount :: Integer
currentWordCount = 11326
wordsPerDay :: Integer
wordsPerDay = 333
isWeekend :: Day -> Bool
isWeekend d =
let (_,_,dow) = toWeekDate d
in dow > 5
addToDay :: UTCTime -> Integer -> Day
addToDay today days = ... | Clean the calendar up for the book | Clean the calendar up for the book
| Haskell | bsd-3-clause | steveshogren/haskell-katas,steveshogren/haskell-katas |
15e9f3327e2445657f40e0a3bd7325bfdcb955b4 | tests/Udp/Packet.hs | tests/Udp/Packet.hs | module Udp.Packet where
import Hans.Message.Udp
(UdpHeader(..),UdpPort(..),parseUdpHeader,renderUdpHeader)
import Control.Applicative ((<$>),(<*>))
import Data.Serialize (runGet,runPut)
import System.Random (Random)
import Test.Framework (Test,testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
... | module Udp.Packet where
import Hans.Message.Udp
(UdpHeader(..),UdpPort(..),parseUdpHeader,renderUdpHeader)
import Control.Applicative ((<$>),(<*>))
import Data.Serialize (runGet,runPut)
import System.Random (Random)
import Test.Framework (Test,testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
... | Fix the udp payload size generator | Fix the udp payload size generator
| Haskell | bsd-3-clause | GaloisInc/HaNS,cartazio/HaNS,cartazio/HaNS,GaloisInc/HaNS |
7f6f2d3b64b88cda5f14c5099477bc195d34f3cf | tests/DocTests.hs | tests/DocTests.hs | module Main where
import Control.Monad
import System.Directory
import Data.List
import System.FilePath
import Control.Applicative
import Build_doctest (deps)
import Test.DocTest
main :: IO ()
main = do
srcs <- getSources
doctest $ [ "-i."
, "-idist/build/autogen"
, "-optP-include"
... | -- I don't know who originally wrote this, but I picked it up from
-- Edward Kmett's folds package, and subsequently modified it.
module Main where
import Build_doctest (deps)
import Control.Applicative ((<$>), (<*>))
import Control.Monad (filterM)
import Data.List (isPrefixOf, isSuffixOf)
import System.Directory
imp... | Add maybe-working cabal sandbox detection to doctest | Add maybe-working cabal sandbox detection to doctest
| Haskell | bsd-3-clause | k-bx/wreq,Feeniks/wreq,bos/wreq,bitemyapp/wreq |
084444a09d44ee49e7b0341c6ced3401a458d056 | examples/basic/Main.hs | examples/basic/Main.hs | {-# Language OverloadedStrings #-}
module Main(main) where
import System.Environment (getArgs)
import Jupyter.Install (installKernel, simpleKernelspec, InstallUser(..), InstallResult(..))
import Jupyter.Kernel (readProfile, simpleKernelInfo, serve, defaultCommHandler,
... | {-# Language OverloadedStrings #-}
module Main(main) where
import System.Environment (getArgs)
import Jupyter.Install (installKernel, simpleKernelspec, InstallUser(..), InstallResult(..))
import Jupyter.Kernel (readProfile, simpleKernelInfo, serve, defaultCommHandler,
... | Remove a debugging print statement | Remove a debugging print statement
| Haskell | mit | gibiansky/jupyter-haskell |
9d146bbad95e16e36b6b6317f57fa3661916a0f4 | src/Main.hs | src/Main.hs | module Main where
import Idris.Core.TT
import Idris.AbsSyntax
import Idris.ElabDecls
import Idris.REPL
import IRTS.Compiler
import IRTS.CodegenPHP
import System.Environment
import System.Exit
import Paths_idris_php
data Opts = Opts { inputs :: [FilePath],
output :: FilePath }
showUsage = do put... | module Main where
import Idris.Core.TT
import Idris.AbsSyntax
import Idris.ElabDecls
import Idris.REPL
import IRTS.Compiler
import IRTS.CodegenPHP
import System.Environment
import System.Exit
import Paths_idris_php
data Opts = Opts { inputs :: [FilePath],
output :: FilePath }
showUsage = do put... | Update for new Codegen API | Update for new Codegen API
Needs a Maybe Term for main, not a Term
| Haskell | bsd-3-clause | ziman/idris-py,nickgeoca/idris-py |
11886e55241d6a4df57f73c748fc10f5e55307af | hackerrank/DiagonalDifference.hs | hackerrank/DiagonalDifference.hs | -- https://www.hackerrank.com/challenges/diagonal-difference/problem
import Control.Monad(replicateM)
import Data.List.Split(splitOn)
nestedMap :: (a -> b) -> [[a]] -> [[b]]
nestedMap = map . map
getIntSquareMatrix :: Int -> IO([[Int]])
getIntSquareMatrix rows = do
matrix <- replicateM (rows) getLine
let intMatri... | -- https://www.hackerrank.com/challenges/diagonal-difference/problem
import Control.Monad(replicateM)
import Data.List.Split(splitOn)
nestedMap :: (a -> b) -> [[a]] -> [[b]]
nestedMap = map . map
getIntSquareMatrix :: Int -> IO([[Int]])
getIntSquareMatrix rows = do
matrix <- replicateM (rows) getLine
let intMatri... | Use readLn instead of getLine and then read. | Use readLn instead of getLine and then read.
| Haskell | mit | julianespinel/trainning,julianespinel/training,julianespinel/training,julianespinel/trainning,julianespinel/training,julianespinel/training |
463f5161589c34db440e6dfba21463a98229a5e5 | Bucketeer/Testing/Main.hs | Bucketeer/Testing/Main.hs | module Main (main) where
import Bucketeer.Manager (startBucketManager)
import Bucketeer.Types
import Bucketeer.WebServer (BucketeerWeb(..))
import Bucketeer.Util
import qualified Bucketeer.Testing.Persistence as P (specs)
import qualified Bucketeer.Testing.Util as U (specs)
import qualified Bucketeer.Test... | module Main (main) where
import Bucketeer.Manager (startBucketManager)
import Bucketeer.Types
import Bucketeer.WebServer (BucketeerWeb(..))
import Bucketeer.Util
import qualified Bucketeer.Testing.Persistence as P (specs)
import qualified Bucketeer.Testing.Util as U (specs)
import qualified Bucketeer.Test... | Exit with appropriate status code | Exit with appropriate status code
| Haskell | bsd-2-clause | MichaelXavier/Bucketeer |
8a6edd8e129efe29fe63ba0ce0d888355e1bc8c5 | src/HaskellWorks/Data/TreeCursor.hs | src/HaskellWorks/Data/TreeCursor.hs | -- |
-- Copyright: 2016 John Ky
-- License: MIT
--
-- Tree Cursor
module HaskellWorks.Data.TreeCursor
( TreeCursor(..)
) where
import HaskellWorks.Data.Positioning
class TreeCursor k where
firstChild :: k -> k
nextSibling :: k -> k
parent :: k -> k
depth :: k -> Count
subtreeSize :: k -> C... | -- |
-- Copyright: 2016 John Ky
-- License: MIT
--
-- Tree Cursor
module HaskellWorks.Data.TreeCursor
( TreeCursor(..)
) where
import HaskellWorks.Data.Positioning
class TreeCursor k where
firstChild :: k -> Maybe k
nextSibling :: k -> Maybe k
parent :: k -> Maybe k
depth :: k -> Count
sub... | Change return type of firstChild, nestSibling, and parent functions to be Maybe k | Change return type of firstChild, nestSibling, and parent functions to be Maybe k
| Haskell | bsd-3-clause | haskell-works/hw-prim |
5648424f2492cd6d7413dca16041780b0ab85c13 | test/Databrary/JSONTest.hs | test/Databrary/JSONTest.hs | module Databrary.JSONTest where
import Test.Tasty.HUnit
import Databrary.JSON
unit_kvObjectOrEmpty :: Assertion
unit_kvObjectOrEmpty = do
-- example
"k1" `kvObjectOrEmpty` (Nothing :: Maybe Int) @?= ([] :: [Pair])
"k1" `kvObjectOrEmpty` (Just 3 :: Maybe Int) @?= ([("k1", Number 3)] :: [Pair])
| module Databrary.JSONTest where
-- import Data.Text
import Data.Aeson.Types
import qualified Data.Either as E
import Data.Monoid ((<>))
import qualified Data.HashMap.Strict as HM
import qualified Data.Vector as V
import Test.Tasty.HUnit
import Databrary.JSON
unit_JSON_examples :: Assertion
unit_JSON_examples = do
... | Add example usage for various json utility functions | Add example usage for various json utility functions
| Haskell | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
8f29ca859b4a2ab3e9382e097e5301f3192de8f8 | test/Uroboro/ParserSpec.hs | test/Uroboro/ParserSpec.hs | module Uroboro.ParserSpec
(
spec
) where
import Data.Either (isRight)
import Text.Parsec (parse)
import Test.Hspec
import Uroboro.Parser
import Uroboro.Tree
import Paths_uroboro
import Utils()
spec :: Spec
spec = do
describe "parser" $ do
let int = Type "Int"
it "recognizes the pr... | {-# OPTIONS_GHC -fno-warn-orphans #-}
module Uroboro.ParserSpec
(
spec
) where
import Data.Either (isRight)
import Text.Parsec (parse, ParseError)
import Test.Hspec
import Uroboro.Parser
import Uroboro.Tree
import Paths_uroboro
instance Eq ParseError where
_ == _ = False
spec :: Spec
spec = do
... | Define instance where it's used | Define instance where it's used | Haskell | mit | Toxaris/uroboro,lordxist/uroboro,tewe/uroboro |
a6e619102f39d48a3407d5e75903b7198a0b70ac | src/Main.hs | src/Main.hs | module Main where
import Control.Exception
import Data.List
import System.IO
import System.Console.GetOpt
import System.Environment
import SAWScript.Options
import SAWScript.ProcessFile (processFile)
import qualified SAWScript.REPL as REPL
main :: IO ()
main = do
argv <- getArgs
case getOpt Permute options argv... | module Main where
import Control.Exception
import Data.List
import System.Exit
import System.IO
import System.Console.GetOpt
import System.Environment
import SAWScript.Options
import SAWScript.ProcessFile (processFile)
import qualified SAWScript.REPL as REPL
main :: IO ()
main = do
argv <- getArgs
case getOpt P... | Fix exit code on errors in SAWScript. | Fix exit code on errors in SAWScript.
A previous change resulted in "success" exit codes even when errors had occurred. | Haskell | bsd-3-clause | GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script |
9761e8497a1f23b679b510cd7343d2358e5866c0 | tests/packages/Test.hs | tests/packages/Test.hs | #!/usr/bin/env stack
{- stack
--resolver lts-6.6
--install-ghc
runghc
--package turtle
-}
{-#LANGUAGE OverloadedStrings#-}
module Test where
import GHC.IO.Exception (ExitCode(..))
import System.Exit (die)
import Data.Monoid ((<>))
import Data.Text (pack)
import Turtle.Prelude (shell)
-- TODO: Au... | #!/usr/bin/env stack
{- stack
--resolver lts-6.6
--install-ghc
runghc
--package turtle
-}
{-#LANGUAGE OverloadedStrings#-}
module Test where
import GHC.IO.Exception (ExitCode(..))
import System.Exit (die)
import Data.Monoid ((<>))
import Data.Text (pack)
import Turtle.Prelude (shell)
-- TODO: Au... | Reorder to fix broken test | Reorder to fix broken test
| Haskell | bsd-3-clause | pparkkin/eta,alexander-at-github/eta,AlexeyRaga/eta,AlexeyRaga/eta,rahulmutt/ghcvm,rahulmutt/ghcvm,alexander-at-github/eta,AlexeyRaga/eta,rahulmutt/ghcvm,pparkkin/eta,pparkkin/eta,rahulmutt/ghcvm,AlexeyRaga/eta,AlexeyRaga/eta,alexander-at-github/eta,alexander-at-github/eta,rahulmutt/ghcvm,pparkkin/eta,alexander-at-gith... |
56c731532a03a159f4cea39bd965b4605e001cf1 | src/Feed.hs | src/Feed.hs | {-# LANGUAGE QuasiQuotes, FlexibleContexts #-}
module Feed
( Feed(..)
, create
, createFromString
, getMatches
) where
import Data.Maybe (maybe)
import Text.Printf (printf)
import Text.Regex.PCRE.Heavy
data Feed = Feed
{ name :: String
, listeners :: Int
, info :: Maybe Stri... | {-# LANGUAGE QuasiQuotes, FlexibleContexts #-}
module Feed
( Feed(..)
, create
, createFromString
, getMatches
) where
import Data.Maybe (maybe, mapMaybe)
import Text.Printf (printf)
import Text.Regex.PCRE.Heavy
data Feed = Feed
{ name :: String
, listeners :: Int
, info :: ... | Improve stability by wrapping create in Maybe | Improve stability by wrapping create in Maybe
| Haskell | agpl-3.0 | Acizza/bcnotif |
cfc058a10ee574b4d6048797e4243fdf13feab07 | src/Main.hs | src/Main.hs | module Main where
import Control.Applicative (pure)
import qualified Data.ByteString.Lazy.Char8 as L
import Iptf.Options
import Iptf.Ip
import Network.HTTP.Conduit (simpleHttp)
import System.IO
ipFromFile :: FilePath -> IO (Maybe IP)
ipFromFile f = handle (const $ re... | module Main where
import Control.Applicative (pure)
import qualified Data.ByteString.Lazy.Char8 as L
import Iptf.Hosts
import Iptf.Ip
import Iptf.Options
import Network.HTTP.Conduit (simpleHttp)
import System.IO
import qualified Data.Text as T
ipFromFile ::... | Update to use Hostname in Options | Update to use Hostname in Options
| Haskell | mit | werbitt/ip-to-file |
010dd78b1e574c648f9a93d2a636ff9ae05422ff | src/Rules/Dependencies.hs | src/Rules/Dependencies.hs | module Rules.Dependencies (buildPackageDependencies) where
import Development.Shake.Util
import Base
import Context
import Expression
import Oracles.ModuleFiles
import Settings.Path
import Target
import Util
buildPackageDependencies :: [(Resource, Int)] -> Context -> Rules ()
buildPackageDependencies rs context@Cont... | module Rules.Dependencies (buildPackageDependencies) where
import Development.Shake.Util
import Base
import Context
import Expression
import Oracles.ModuleFiles
import Rules.Generate
import Settings.Path
import Target
import Util
buildPackageDependencies :: [(Resource, Int)] -> Context -> Rules ()
buildPackageDepend... | Add missing dependencies on generated files | Add missing dependencies on generated files
See #285.
| Haskell | bsd-3-clause | bgamari/shaking-up-ghc,snowleopard/hadrian,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,izgzhen/hadrian,snowleopard/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc |
48a0376ca48220617c32ee6e20468a702d9af155 | haskell/kindergarten-garden/Garden.hs | haskell/kindergarten-garden/Garden.hs | module Garden
( Plant(..)
, defaultGarden
, garden
, lookupPlants
) where
import Data.List (sort, transpose)
import Data.List.Split (chunksOf)
import Data.Map (Map, findWithDefault, fromList)
data Plant = Clover
| Grass
| Radishes
| Violets
deriving (Eq, Show)
type Garden ... | module Garden
( Plant(..)
, defaultGarden
, garden
, lookupPlants
) where
import Data.List (sort, transpose)
import Data.List.Split (chunksOf)
import Data.Map (Map, findWithDefault, fromList)
data Plant = Clover
| Grass
| Radishes
| Violets
deriving (Eq, Show)
type Garden ... | Use a case statement instead of guards | Use a case statement instead of guards
| Haskell | mit | tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions |
149ba22bd2b80f2d0241e44e057d17a2532b0f37 | 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 | Haskell | bsd-3-clause | seckcoder/vector,hvr/vector,phadej/vector,thomie/vector,phaazon/vector,dolio/vector |
f86514fcc2324fae72da913baaf0f8d87250e88e | 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... |
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... | Fix up a use of mapM, which should have been mapM_ | Fix up a use of mapM, which should have been mapM_ | Haskell | bsd-3-clause | mpickering/hlint,ndmitchell/hlint,ndmitchell/hlint,eigengrau/hlint,bitemyapp/hlint,gibiansky/hlint |
1393b450b401cab4d0c36290b2db7b58f9a8d924 | src/Database/Schema/Migrations/Dependencies.hs | src/Database/Schema/Migrations/Dependencies.hs | module Database.Schema.Migrations.Dependencies
( Dependable(..)
)
where
class Eq a => Dependable a where
depsOf :: a -> [a]
-- |Given a list of a in the environment, does that list satisfy
-- the dependency requirements of an a? returns whether or not it
-- does.
satisfies :: [a] -> a -> ... | module Database.Schema.Migrations.Dependencies
( Dependable(..)
)
where
class Eq a => Dependable a where
-- |The objects on which a depends.
depsOf :: a -> [a]
-- |Return the complete dependency list for the specified object,
-- including its children and their dependencies recursively, and
... | Update the Dependable instance for Migration | Update the Dependable instance for Migration
Ignore-this: 22d51ec73975926c7623477a80e75cf1
darcs-hash:20090416045602-e018d-1a882873a552132a3154008a18a8158ad9f9170b.gz
| Haskell | bsd-3-clause | nick0x01/dbmigrations,nathankot/dbmigrations,anton-dessiatov/dbmigrations,creswick/dbmigrations,jakubfijalkowski/dbmigrations |
1c26a64e611f1ccf41e162226a034599d8f84ad5 | lib/Data/Capnp.hs | lib/Data/Capnp.hs | module Data.Capnp where
-- | A 'Get' is a wrapper around a @get_*@ function for a field. This is
-- intended to be used with the OverloadedLabels extension, like
-- @'get' #myField struct@. The newtype wrapper and 'get' function allow
-- us to disambiguate between different uses of @#myField@.
newtype Get m parent chi... | module Data.Capnp where
-- | A 'Get' is a wrapper around a @get_*@ function for a field. This is
-- intended to be used with the OverloadedLabels extension, like
-- @'get' #myField struct@. The newtype wrapper and 'get' function allow
-- us to disambiguate between different uses of @#myField@.
newtype Get m parent chi... | Add an extra 'info' type parameter to New. | Add an extra 'info' type parameter to New.
At least new_ for list types will need this, to specify the length.
We'll set it to '()' for types that don't need it.
| Haskell | mit | zenhack/haskell-capnp |
84436b5b597080f924951012885992a460e66551 | graphql-wai/tests/Tests.hs | graphql-wai/tests/Tests.hs | {-# LANGUAGE DataKinds #-}
module Main where
import Protolude
import Network.Wai.Test
import GraphQL.API
import GraphQL.Wai
import GraphQL.Resolver
type Cat = Object "Cat" '[] '[Field "name" Text]
catHandler :: Handler IO Cat
catHandler = pure (pure "Felix")
test1 :: Session ()
test1 = do
r <- request $ setPath ... | {-# LANGUAGE DataKinds #-}
module Main where
import Protolude
import Network.Wai.Test
import GraphQL.API
import GraphQL.Wai
import GraphQL.Resolver
type Cat = Object "Cat" '[] '[Field "name" Text]
catHandler :: Handler IO Cat
catHandler = pure (returns "Felix")
test1 :: Session ()
test1 = do
r <- request $ setPa... | Update graphql-wai for new HandlerResult. | Update graphql-wai for new HandlerResult.
| Haskell | bsd-3-clause | jml/graphql-api |
33ba566fabe3ef4caa901f4ebbf6b9f514c07386 | Tests/Relationships.hs | Tests/Relationships.hs | {-# LANGUAGE TypeFamilies, Rank2Types, FlexibleContexts #-}
module Tests.Relationships (allTests) where
import Prelude hiding (Real)
import Language.Hakaru.Syntax
import Test.HUnit
import Tests.TestTools
testRelationships :: Test
testRelationships = test [
"t1" ~: testSS [t1] (lam (\mu -> (lam (\sigma -> norm... | {-# LANGUAGE TypeFamilies, Rank2Types, FlexibleContexts #-}
module Tests.Relationships (allTests) where
import Prelude hiding (Real)
import Language.Hakaru.Syntax
import Test.HUnit
import Tests.TestTools
testRelationships :: Test
testRelationships = test [
"t1" ~: testSS [t1] (lam (\mu -> (lam (\sigma -> norm... | Test distribution relationship transformations from Gamma to Chi-Squared | Test distribution relationship transformations from Gamma to Chi-Squared
| Haskell | bsd-3-clause | zaxtax/hakaru,suhailshergill/hakaru,zaxtax/hakaru,zachsully/hakaru,bitemyapp/hakaru,zachsully/hakaru |
c40e09b4644fcac3badfe0bb05fa931908ab0d6d | Development/NSIS/Plugins/Taskbar.hs | Development/NSIS/Plugins/Taskbar.hs |
-- | Windows 7 Taskbar Progress plugin: <http://nsis.sourceforge.net/TaskbarProgress_plug-in>
module Development.NSIS.Plugins.Taskbar(taskbar) where
import Development.NSIS
-- | Enable Windows 7 taskbar plugin, called anywhere.
taskbar :: Action ()
taskbar = event "ShowInstFiles" $ plugin "w7tbp" "Start" []
|
-- | Windows 7 Taskbar Progress plugin: <http://nsis.sourceforge.net/TaskbarProgress_plug-in>
module Development.NSIS.Plugins.Taskbar(taskbar) where
import Development.NSIS
-- | Enable Windows 7 taskbar plugin, called anywhere.
taskbar :: Action ()
taskbar = onPageShow InstFiles $ plugin "w7tbp" "Start" []
| Use the safer onPageShow event in the taskbar plugin | Use the safer onPageShow event in the taskbar plugin
| Haskell | apache-2.0 | idleberg/NSIS,idleberg/NSIS,idleberg/NSIS |
5fb7e9e98e48b58224cc711b18c626329eca0af7 | testsuite/tests/ghc-regress/indexed-types/should_compile/T3590.hs | testsuite/tests/ghc-regress/indexed-types/should_compile/T3590.hs | {-# LANGUAGE TypeFamilies, FlexibleContexts #-}
-- Trac #3590: a bug in typechecking of sections
module T3590 where
import Control.Monad.Reader ()
import Control.Monad.Reader.Class (MonadReader(..))
newtype ListT m a =
ListT { runListT :: m (Maybe (a, ListT m a)) }
class Monad (ItemM l) => List l where
type It... | {-# LANGUAGE TypeFamilies, FlexibleContexts #-}
-- Trac #3590: a bug in typechecking of sections
module T3590 where
newtype ListT m a =
ListT { runListT :: m (Maybe (a, ListT m a)) }
class Monad (ItemM l) => List l where
type ItemM l :: * -> *
joinL :: [ItemM l (l a) -> l a]
instance Monad m => List (ListT m... | Update test so it does not use Control.Monad.Reader | Update test so it does not use Control.Monad.Reader | Haskell | bsd-3-clause | ml9951/ghc,wxwxwwxxx/ghc,lukexi/ghc,anton-dessiatov/ghc,snoyberg/ghc,frantisekfarka/ghc-dsi,wxwxwwxxx/ghc,ezyang/ghc,ghc-android/ghc,fmthoma/ghc,forked-upstream-packages-for-ghcjs/ghc,mcschroeder/ghc,ghc-android/ghc,elieux/ghc,anton-dessiatov/ghc,wxwxwwxxx/ghc,nkaretnikov/ghc,siddhanathan/ghc,christiaanb/ghc,da-x/ghc,r... |
77193177a3239185f0cfca4d2844a8d5bc7d0d37 | testsuite/tests/th/T5358.hs | testsuite/tests/th/T5358.hs | {-# LANGUAGE TemplateHaskell #-}
module T5358 where
import Language.Haskell.TH
t1, t2 :: Int
t1 x = x
t2 x = x
prop_x1 x = t1 x == t2 x
runTests = $( do VarI _ t _ _ <- reify (mkName "prop_x1")
error $ pprint t
)
| {-# LANGUAGE TemplateHaskell #-}
module T5358 where
import Language.Haskell.TH
t1, t2 :: Int
t1 x = x
t2 x = x
prop_x1 x = t1 x == t2 x
runTests = $( do VarI _ t _ _ <- reify (mkName "prop_x1")
error $ ("runTest called error: " ++ pprint t)
)
| Make the test output a bit more self-explanatory | Make the test output a bit more self-explanatory
| Haskell | bsd-3-clause | olsner/ghc,anton-dessiatov/ghc,forked-upstream-packages-for-ghcjs/ghc,da-x/ghc,holzensp/ghc,ezyang/ghc,acowley/ghc,mfine/ghc,gridaphobe/ghc,hferreiro/replay,mfine/ghc,fmthoma/ghc,mettekou/ghc,frantisekfarka/ghc-dsi,jstolarek/ghc,gcampax/ghc,holzensp/ghc,sdiehl/ghc,wxwxwwxxx/ghc,nathyong/microghc-ghc,sdiehl/ghc,oldmanmi... |
5ff227bb22abe811f87055515047c3bbb6136d60 | src/Main.hs | src/Main.hs | import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Network.Wai.Handler.Warp
import Network.Socket.Internal
import Servant
import Chat
type API = ChatAPI
:<|> Raw
server :: Server API
server = chatServer
:<|> serveDirectory "www"
main :: IO ()
main = runServer
where set... | import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Network.Wai.Handler.Warp
import Network.Socket.Internal
import Servant
import Chat
type API = ChatAPI
:<|> Raw
server :: Server API
server = chatServer
:<|> serveDirectory "www"
port :: Int
port = 8081
main :: IO ()
main ... | Change port to 8081 (8080 doesn't work on OS X, hm). | Change port to 8081 (8080 doesn't work on OS X, hm).
| Haskell | mit | thchittenden/GeoChat,thchittenden/GeoChat |
44b5f62c5fb0697c1af83923d0e6a303d24feeb6 | src/Main.hs | src/Main.hs | module Main where
import Network.Curl
import System.Environment (getArgs)
postJson :: String -> String -> IO CurlResponse
postJson url jsonData = do
curl <- initialize
setopt curl (CurlURL url)
setopt curl (CurlPost True)
setopt curl (CurlPostFields [jsonData])
setopt curl (CurlHttpHeaders ["Conte... | 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 ... | Use the correct mode to upload files | Use the correct mode to upload files
| Haskell | bsd-3-clause | guillaume-nargeot/hpc-coveralls-experiment,guillaume-nargeot/hpc-coveralls-experiment |
0e5ca1e85915389a8dce3aaccf6175ca9cb1191a | testsuite/tests/Shaker/Properties.hs | testsuite/tests/Shaker/Properties.hs | module Shaker.Properties
where
import Control.Monad
import Test.QuickCheck
import Shaker.Type
import System.Time
import Shaker.Reflexivite
instance Arbitrary TimeDiff where
arbitrary = TimeDiff `liftM` elements tab
`ap` elements tab
`ap` elements tab
`ap` elements tab
`ap` elements tab
`ap`... | module Shaker.Properties
where
import Control.Monad
import Test.QuickCheck
import Shaker.Type
import System.Time
import Shaker.Reflexivite
instance Arbitrary TimeDiff where
arbitrary = TimeDiff `liftM` elements tab
`ap` elements tab
`ap` elements tab
`ap` elements tab
`ap` elements tab
`ap`... | Modify arbitrary to generate smaller list for moduleMapping | Modify arbitrary to generate smaller list for moduleMapping
| Haskell | isc | bonnefoa/Shaker |
14724e7492e8d7f5a2a20051b2f21ffce401008d | Game/LambdaHack/LevelState.hs | Game/LambdaHack/LevelState.hs | module Game.LambdaHack.LevelState where
import Game.LambdaHack.Level
import Game.LambdaHack.State
import Game.LambdaHack.Grammar
import Game.LambdaHack.Loc
import qualified Game.LambdaHack.Kind as Kind
-- | Produces a textual description of the terrain and items at an already
-- explored location. Mute for unknown lo... | module Game.LambdaHack.LevelState where
import Game.LambdaHack.Level
import Game.LambdaHack.State
import Game.LambdaHack.Grammar
import Game.LambdaHack.Loc
import qualified Game.LambdaHack.Kind as Kind
-- | Produces a textual description of the terrain and items at an already
-- explored location. Mute for unknown lo... | Fix display of location description | Fix display of location description
| Haskell | bsd-3-clause | LambdaHack/LambdaHack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.