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
e9aa71e31f48951781ef7272d1bb81ee759f8f53
xmonad.hs
xmonad.hs
import XMonad import XMonad.Config.Xfce import XMonad.Util.EZConfig import XMonad.Layout.NoBorders import qualified XMonad.StackSet as W import XMonad.Util.WindowProperties import Data.Monoid main :: IO () main = xmonad $ xfceConfig { modMask = mod4Mask , terminal = "xfce4-terminal" , manageHook = hideNoti...
import XMonad import XMonad.Config.Xfce import XMonad.Util.EZConfig import XMonad.Layout.NoBorders import qualified XMonad.StackSet as W import XMonad.Util.WindowProperties import Data.Monoid main :: IO () main = xmonad $ xfceConfig { modMask = mod4Mask , terminal = "xfce4-terminal" , manageHook = hideNoti...
Use gmrun as default runner
Use gmrun as default runner
Haskell
mit
paretje/dotfiles,paretje/dotfiles,paretje/dotfiles,paretje/dotfiles,paretje/dotfiles
c5ebe25ab2a49746c778f9f16be6664764d108a7
Development/Shake/FileTime.hs
Development/Shake/FileTime.hs
{-# LANGUAGE 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 import Control.Exception ...
{-# LANGUAGE 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 import Control.Exception ...
Improve getModTime so IO errors are not caught and rethrown, but not caught in the first place
Improve getModTime so IO errors are not caught and rethrown, but not caught in the first place
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,nh2/shake,nh2/shake,nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake
1495dc14831352afdc349b53afb21cb1d03aa323
testsuite/tests/typecheck/should_run/IPRun.hs
testsuite/tests/typecheck/should_run/IPRun.hs
{-# LANGUAGE ImplicitParams, RankNTypes #-} module Main where f0 :: (?x :: Int) => () -> Int f0 () = let ?x = 5 in ?x -- Should always return 5 f1 :: (?x :: Int) => () -> Int f1 = let ?x = 5 in \() -> ?x -- Should always return 5 f2 () = let ?x = 5 in \() -> ?x -- Inferred type: (Num a, ?x::a) => () -> () ...
{-# LANGUAGE ImplicitParams, RankNTypes #-} module Main where f0 :: (?x :: Int) => () -> Int f0 () = let ?x = 5 in ?x -- Should always return 5 f1 :: (?x :: Int) => () -> Int f1 = let ?x = 5 in \() -> ?x -- Should always return 5 f2 () = let ?x = 5 in \() -> ?x -- Inferred type: Num a => () -> () -> a -...
Correct the inferred type (in comment)
Correct the inferred type (in comment)
Haskell
bsd-3-clause
frantisekfarka/ghc-dsi,green-haskell/ghc,christiaanb/ghc,oldmanmike/ghc,mettekou/ghc,mcschroeder/ghc,urbanslug/ghc,olsner/ghc,gcampax/ghc,green-haskell/ghc,lukexi/ghc,ghc-android/ghc,holzensp/ghc,TomMD/ghc,olsner/ghc,bitemyapp/ghc,GaloisInc/halvm-ghc,mfine/ghc,mettekou/ghc,jstolarek/ghc,nathyong/microghc-ghc,sdiehl/ghc...
0c93837e8adf80ecc7d0ac8c62723f2c7ee471a4
src/Lib.hs
src/Lib.hs
module Lib ( someFunc , allPaths ) where import System.Directory someFunc :: IO () someFunc = putStrLn "someFunc" rootPath = "./data/lingspam_public/bare/" allPaths = do partFoldersNames <- listDirectory rootPath let partFolderPaths = map (\folder -> rootPath ++ folder) partFoldersNames innerFiles...
module Lib ( someFunc , allPaths , spamPaths , preprocessEmail , spamMails , allMails , rmdups ) where import System.Directory import Data.List import Data.Char someFunc :: IO () someFunc = putStrLn "someFunc" rootPath = "./data/lingspam_public/bare/" allPaths = do partFoldersNames...
Add functions for reading and preprocessing emails
Add functions for reading and preprocessing emails
Haskell
mit
apisarek/malus
ddb9e424ed512a905c8415e6587136afaf683c11
tests/NullableTests.hs
tests/NullableTests.hs
module Main ( main ) where import qualified Data.Map as M import qualified Data.Set as S import System.FilePath ( (<.>) ) import System.Environment ( getArgs, withArgs ) import Test.HUnit ( assertEqual ) import Data.LLVM import Data.LLVM.Analysis.CallGraph import Data.LLVM.Analysis.PointsTo import Data.LLVM.Analysis....
module Main ( main ) where import qualified Data.Map as M import qualified Data.Set as S import System.FilePath ( (<.>) ) import System.Environment ( getArgs, withArgs ) import Test.HUnit ( assertEqual ) import Data.LLVM import Data.LLVM.Analysis.CallGraph import Data.LLVM.Analysis.PointsTo import Data.LLVM.Analysis....
Fix a test to support the new analysis signatures
Fix a test to support the new analysis signatures
Haskell
bsd-3-clause
travitch/foreign-inference,travitch/foreign-inference
acd2b1d420e7be859b91116b58a2cdb2b91e532c
src/Main.hs
src/Main.hs
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Control.Concurrent import Control.Monad import Control.Monad.Trans (liftIO) import Data.IORef import Network.Wai.Middleware.Static import Network.Wai.Middleware.RequestLogger import Web.Scotty import Paths_mat_chalmers import Config import M import V...
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Control.Concurrent import Control.Monad import Control.Monad.Trans (liftIO) import Data.IORef import Network.Wai.Middleware.Static import Network.Wai.Middleware.RequestLogger import Web.Scotty import Paths_mat_chalmers import Config import M import V...
Revert "Temp redirect to other page"
Revert "Temp redirect to other page" This reverts commit 96099cb97eda4c7a1809a2ec2ad5e170d840f88b.
Haskell
mit
adamse/mat-chalmers
7aba471ea52a65d8367178332e3eb5f5039f3ba6
src/Main.hs
src/Main.hs
module Main where import Test.HUnit (runTestTT, Test(..), Counts(..)) import System.Exit (exitSuccess, exitFailure) import HaddockBackend.Api import Options import DocTest import qualified Interpreter main :: IO () main = do (options, files) <- getOptions let ghciArgs = ghcOptions options ++ files Interpreter...
module Main where import Test.HUnit (runTestTT, Test(..), Counts(..)) import System.Exit (exitSuccess, exitFailure) import HaddockBackend.Api import Options import DocTest import qualified Interpreter main :: IO () main = do (options, files) <- getOptions let ghciArgs = ghcOptions options ++ files Interpreter...
Use better names for bindings
Use better names for bindings
Haskell
mit
snoyberg/doctest-haskell,ekmett/doctest,sol/doctest,snoyberg/doctest-haskell,ekmett/doctest,sol/doctest
98eb6cc68a12ca59f7f02d0ea26c81468d43c069
src/Main.hs
src/Main.hs
import System.Environment import Text.Parsec import Text.Parsec.Error import NgLint.Parser import NgLint.Linter printUsage :: IO () printUsage = putStrLn "usage: nglint file.conf" main = do params <- getArgs case length params of 0 -> printUsage _ -> do let fileName = head param...
import System.Environment import System.Exit import Text.Parsec import Text.Parsec.Error import NgLint.Parser import NgLint.Linter printUsage :: IO () printUsage = putStrLn "usage: nglint file.conf" main = do params <- getArgs case length params of 0 -> printUsage _ -> do let fi...
Use proper failure codes for executable
Use proper failure codes for executable
Haskell
mit
federicobond/nglint
6a6f55bad4a1e05b35db6da6ada7d2431c4b636a
haskell/test/NiceChildProcessSpec.hs
haskell/test/NiceChildProcessSpec.hs
module NiceChildProcessSpec where import Test.Hspec import GHCJS.Types import NiceChildProcess should = it xshould _ _ = return () spec :: Spec spec = do describe "NiceChildProcess should" $ do should "read a line from a process" $ do childProcess <- spawn "echo" ["lol"] "." line <- readLine chil...
module NiceChildProcessSpec where import Test.Hspec import GHCJS.Types import NiceChildProcess should = it xshould _ _ = return () spec :: Spec spec = do describe "NiceChildProcess should" $ do should "read a line from a process" $ do childProcess <- spawn "echo" ["lol"] "." line <- readLine chil...
Test that you only get one line when reading
Test that you only get one line when reading
Haskell
mit
CRogers/stack-ide-atom,CRogers/stack-ide-atom
c771c8da0f0f6617fa64fbd132c099fece0a6ac3
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
Haskell
lgpl-2.1
gtk2hs/gtksourceview,gtk2hs/gtksourceview
fc154f91cf3410ba664077be815c2dd4bbb499ea
compiler/Build/Interface.hs
compiler/Build/Interface.hs
{-# OPTIONS_GHC -W #-} module Build.Interface (load,isValid) where import qualified Data.ByteString.Lazy as L import qualified Data.Binary as Binary import qualified Elm.Internal.Version as Version import System.Directory (doesFileExist) import System.Exit import System.IO import SourceSyntax.Module load :: Binary....
{-# OPTIONS_GHC -W #-} module Build.Interface (load,isValid) where import qualified Data.ByteString.Lazy as L import qualified Data.Binary as Binary import qualified Build.Print as Print import qualified Elm.Internal.Version as Version import System.Directory (doesFileExist) import SourceSyntax.Module load :: Binary...
Use Build.Print to show errors
Use Build.Print to show errors
Haskell
bsd-3-clause
mgold/Elm,5outh/Elm,deadfoxygrandpa/Elm,laszlopandy/elm-compiler,Axure/elm-compiler,pairyo/elm-compiler,JoeyEremondi/elm-pattern-effects
a683b88c6d3529cf472100e687233f17ded46186
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 = either (const []) id $ parse parseContent "content" (T.unpack t) parseContent :: Parser [Content] parseCont...
Use `either` instead of `case`
Use `either` instead of `case` This is nicer
Haskell
mit
gfontenot/reflow
5c59985f27b1538fc60b495d22e3473832894822
Nero.hs
Nero.hs
module Nero ( -- * Re-exports module X ) where import Control.Applicative as X ((<$>), pure) import Data.Monoid as X ((<>)) import Control.Lens as X import Nero.Application as X import Nero.Payload as X import Nero.Request as X import Nero.Response as X import Nero.Match as X import Nero.Url as X
-- | This module centralizes every module exported in the package together -- with frequently used functions when writing Nero applications such as the -- ones from 'Lens', 'Applicative' or 'Monoid'. module Nero (module X) where import Control.Applicative as X ((<$>), pure) import Data.Monoid as X ((<>)) import Co...
Add some documentation to reexport module
Add some documentation to reexport module
Haskell
bsd-3-clause
plutonbrb/nero
856095648303d4d5044991a3d5f2b7d9aef44deb
benchmarks/Benchmark.hs
benchmarks/Benchmark.hs
{-# LANGUAGE Rank2Types #-} import Control.Monad.ST import Criterion.Main import System.Random.MWC main = do gen <- create defaultMain [ bench "mwc" (uniform gen :: IO Double) ]
import Control.Monad.ST import Data.Int import Data.Word import Criterion.Main import System.Random.MWC main = do gen <- create defaultMain [ bench "mwc-Double" (uniform gen :: IO Double) , bench "mwc-Int" (uniform gen :: IO Int ) , bench "mwc-Int8" (uniform gen :: IO Int8 ) , bench "mwc...
Expand benchmark to all supported types and add normal too
Expand benchmark to all supported types and add normal too
Haskell
bsd-2-clause
bos/mwc-random,Shimuuar/mwc-random,bos/mwc-random,Shimuuar/mwc-random
db657e277500cbc47b811e070ca983db723c4a03
html5/Implementation.hs
html5/Implementation.hs
module Implementation where import Data.List --------------------------------------------------------------------- -- OUTPUT data Out = Char Char | TagOpen -- < | TagShut | AttName | AttVal | TagEnd -- > | TagEndClose -- /> | Comment -- <!-- | CommentEnd -- --...
module Implementation where import Data.List --------------------------------------------------------------------- -- OUTPUT data Out = Char Char | TagOpen -- < | TagShut | AttName | AttVal | TagEnd -- > | TagEndClose -- /> | Comment -- <!-- | CommentEnd -- --...
Remove the text node, wasn't actually needed
Remove the text node, wasn't actually needed
Haskell
bsd-3-clause
silkapp/tagsoup
f17427da3b58abf8ec3b39c4c95d3158ad2701b1
src/Data/LLVM.hs
src/Data/LLVM.hs
{-# LANGUAGE OverloadedStrings #-} -- | This is the top-level LLVM IR module. It provides functions to -- construct the IR from a bitcode file and some basic methods to -- inspect it. -- -- This module re-exports all of the types used in the IR for -- convenience. module Data.LLVM ( -- * Constructing the IR parseL...
{-# LANGUAGE OverloadedStrings #-} -- | This is the top-level LLVM IR module. It provides functions to -- construct the IR from a bitcode file and some basic methods to -- inspect it. -- -- This module re-exports all of the types used in the IR for -- convenience. module Data.LLVM ( -- * Constructing the IR parseL...
Add a function to find Functions in Modules by their name. This generalizes findMain
Add a function to find Functions in Modules by their name. This generalizes findMain
Haskell
bsd-3-clause
wangxiayang/llvm-analysis,travitch/llvm-analysis,wangxiayang/llvm-analysis,travitch/llvm-analysis
7d8d23246df589bc2414b5b355e72ac4db8a173d
parser-typechecker/unison/Version.hs
parser-typechecker/unison/Version.hs
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Version where import Language.Haskell.TH (runIO) import Language.Haskell.TH.Syntax (Exp(LitE), Lit(StringL)) import Shellmet import Data.Text gitDescribe :: String gitDescribe = $( fmap (LitE . StringL . unpack) . runIO $ do -- Outputs date...
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Version where import Language.Haskell.TH (runIO) import Language.Haskell.TH.Syntax (Exp(LitE), Lit(StringL)) import Shellmet import Data.Text -- | Uses Template Haskell to embed a git descriptor of the commit -- which was used to build the...
Reformat to <version> (built on <date>)
Reformat to <version> (built on <date>)
Haskell
mit
unisonweb/platform,unisonweb/platform,unisonweb/platform
0adc8f9bf60801529d11b61e7c3a4224fe06ed53
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 darcs-hash:20080507022516-a5988-052b2672534ec9f4af933450bc6f5d8af3260066
Haskell
bsd-3-clause
yzhou61/xmonad-contrib,yzhou61/xmonad-contrib,yzhou61/xmonad-contrib
ffcbad1dad7237f2a124729df6b2be8e07f3b1d5
haskell/robot-simulator/Robot.hs
haskell/robot-simulator/Robot.hs
module Robot ( Bearing(..) , Robot , bearing , coordinates , mkRobot , simulate , turnLeft , turnRight ) where type Point = (Int, Int) data Bearing = North | East | South | West deriving (Eq, Show) data Robot = Robot { bearing :: Bearing , coordinates :: Po...
module Robot ( Bearing(..) , Robot , bearing , coordinates , mkRobot , simulate , turnLeft , turnRight ) where type Point = (Int, Int) data Bearing = North | East | South | West deriving (Bounded, Enum, Eq, Show) data Robot = Robot { bearing :: Bearing , co...
Implement an arbitrary turn function
Implement an arbitrary turn function
Haskell
mit
tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions
1fc0064878686011ac4718299ea477606b7c9a19
src/Labyrinth/Action.hs
src/Labyrinth/Action.hs
module Labyrinth.Action where import Control.Monad.State import Labyrinth.Map import Labyrinth.Move import Peeker performMove :: Move -> State Labyrinth MoveResult performMove (Move []) = return $ MoveRes [] performMove (Move (act:acts)) = do ar <- performAction act (MoveRes ars) <- performMove $ Move acts ...
module Labyrinth.Action where import Control.Monad.State import Labyrinth.Map import Labyrinth.Move import Peeker performMove :: Move -> State Labyrinth MoveResult performMove (Move []) = return $ MoveRes [] performMove (Move (act:acts)) = do ar <- performAction act (MoveRes ars) <- performMove $ Move acts ...
Use Peeker's State functions to simplify movement processing.
Use Peeker's State functions to simplify movement processing.
Haskell
mit
koterpillar/labyrinth-server,koterpillar/labyrinth
667d6ce258d0c1f53f030ae2902b267e541048c7
src/Frenetic/Update1.hs
src/Frenetic/Update1.hs
module Frenetic.Update1 where import Frenetic.Common import Nettle.OpenFlow.Match import Frenetic.NetCore.Compiler import Frenetic.NetCore.Types import Frenetic.NetCore.Short internal_policy p ver = p <%> (DlVlan (Just ver)) edge_policy p ver = (Sequence p (Any ==> [Forward InPort (modDlVlan (Just ver))])) <%>...
module Frenetic.Update1 where import Frenetic.Common import Nettle.OpenFlow.Match import Frenetic.NetCore.Compiler import Frenetic.NetCore.Types import Frenetic.NetCore.Short infixr 5 <!> (<!>) pol acts = pol <+> (Not (poDom pol) ==> acts) internal_policy p ver = p <%> (DlVlan (Just ver)) edge_policy p ver = ...
Add forgotten fall-through case for update sequencing
Add forgotten fall-through case for update sequencing
Haskell
bsd-3-clause
frenetic-lang/netcore-1.0,frenetic-lang/netcore-1.0
2e615eabf944bf4ab314849713f2480a04e045b9
src/Main.hs
src/Main.hs
{-# LANGUAGE DeriveDataTypeable #-} module Main (main) where import qualified Bot import Control.Exception import System.Console.CmdArgs data Dikunt = Dikunt { server :: String , username :: String , password :: String , channel :: String } deriving (Data, Typeable, Show, Eq) dikunt :: Dikunt dikunt = D...
{-# LANGUAGE DeriveDataTypeable #-} module Main (main) where import qualified Bot import Control.Exception import System.Console.CmdArgs data Dikunt = Dikunt { server :: String , username :: String , password :: String , channel :: String } deriving (Data, Typeable, Show, Eq) dikunt :: Dikunt dikunt = D...
Add default values to command line arguments
Add default values to command line arguments
Haskell
bsd-3-clause
bus000/Dikunt
d4b69b05957add3e6a156448e87e7ce540baaa1d
file-service/app/Main.hs
file-service/app/Main.hs
module Main where import Control.Monad.Except (runExceptT) import Control.Monad.Logger (runStdoutLoggingT) import Database.Persist.Postgresql (createPostgresqlPool) import Network.HTTP.Client (defaultManagerSettings, newManager) import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.RequestLogger (logStdo...
module Main where import Control.Monad.Except (runExceptT) import Control.Monad.Logger (runStdoutLoggingT) import Database.Persist.Postgresql (createPostgresqlPool) import Network.HTTP.Client (defaultManagerSettings, newManager) import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.RequestLogger (logStdo...
Remove spurious undefined that was crashing file service
Remove spurious undefined that was crashing file service
Haskell
mit
houli/distributed-file-system
bd2de55f07b5d9702545f0a165c24584a26c7e66
importer/tools/inspect/Utils/GetOpt.hs
importer/tools/inspect/Utils/GetOpt.hs
module Utils.GetOpt(OptClass, commandLineArgs, compilerOpts) where import System.Console.GetOpt class OptClass a commandLineArgs :: [String] -> Maybe (String, FilePath, [String]) commandLineArgs argv = if length argv < 2 then Nothing else Just (head argv, argv !! ...
module Utils.GetOpt(OptClass, commandLineArgs, compilerOpts) where import System.Console.GetOpt class OptClass a commandLineArgs :: [String] -> Maybe (String, FilePath, [String]) commandLineArgs (db:repo:args) = Just (db, repo, args) commandLineArgs _ = Nothing ...
Use pattern matching in commandLineArgs.
Use pattern matching in commandLineArgs. I think this is clearer than using an if statement and head and drop.
Haskell
lgpl-2.1
weldr/bdcs,atodorov/bdcs
e88cdd69b22ceb72d08ae06a14b524cef0d73df6
test/Test/Hspec/OptionsSpec.hs
test/Test/Hspec/OptionsSpec.hs
module Test.Hspec.OptionsSpec (main, spec) where import Helper import Test.Hspec.Options hiding (parseOptions) import qualified Test.Hspec.Options as Options main :: IO () main = hspec spec spec :: Spec spec = do describe "parseOptions" $ do let parseOptions = Options.parseOptions default...
module Test.Hspec.OptionsSpec (main, spec) where import Helper import Test.Hspec.Options hiding (parseOptions) import qualified Test.Hspec.Options as Options main :: IO () main = hspec spec spec :: Spec spec = do describe "parseOptions" $ do let parseOptions = Options.parseOptions default...
Fix description of a spec item
Fix description of a spec item
Haskell
mit
hspec/hspec,beni55/hspec
1dc6f22a765ee246d2a74ed3799886ad79272557
src/Data/Text/Markup.hs
src/Data/Text/Markup.hs
module Data.Text.Markup ( Markup , toMarkup , fromMarkup ) where import Data.Monoid ((<>)) import qualified Data.Text as T import Data.Tree data Descriptor a = Desc { seqStart :: Int , seqLength :: Int , seqData :: a } deriving (Show) data Markup a = Markup { sourceText...
module Data.Text.Markup ( Markup , toMarkup , fromMarkup ) where import Data.Monoid ((<>)) import qualified Data.Text as T import Data.Tree data Descriptor a = Desc { seqStart :: Int , seqLength :: Int , seqData :: a } deriving (Show) data Markup a = Markup { sourceText...
Use Text.splitAt instead of take/drop
Use Text.splitAt instead of take/drop
Haskell
bsd-3-clause
jtdaugherty/text-markup
4d3626f44401facce6ad565de68fee1635351f31
src/Handler/Module.hs
src/Handler/Module.hs
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} module Handler.Module where import Data.SemVer (toText) import Database.Persist.Sql import Import.App getModules...
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} module Handler.Module where import Data.SemVer (toText) import Database.Esqueleto import Import.App getModulesR ...
Convert modules handler to Esqueleto.
Convert modules handler to Esqueleto.
Haskell
mit
rgrempel/frelm.org
2563e03d17aa7231494fcf288ad7d56b164ed322
Yhc/Core/Firstify/Mitchell/Terminate.hs
Yhc/Core/Firstify/Mitchell/Terminate.hs
module Yhc.Core.Firstify.Mitchell.Terminate where import Yhc.Core import qualified Data.Homeomorphic as H data Terminate = Terminate {specs :: H.Homeomorphic CoreExpr1 CoreExpr ,specsDone :: [(CoreExpr1,CoreExpr)] ,inlined :: Set.Set CoreFuncName } mergeTerminate :: Terminate -> Terminate -> Termin...
module Yhc.Core.Firstify.Mitchell.Terminate where import Yhc.Core import qualified Data.Homeomorphic as H import qualified Data.Set as Set data Terminate = Terminate {specs :: H.Homeomorphic CoreExpr1 CoreExpr ,specsDone :: [(H.Shell CoreExpr1,CoreExpr)] ,inlined :: Set.Set CoreFuncName } mergeTer...
Make the termination module compile
Make the termination module compile
Haskell
bsd-3-clause
ndmitchell/firstify
03ead5328dabca80148403a44edcdf3ff9e5cab3
src/Text/Karver/Types.hs
src/Text/Karver/Types.hs
module Text.Karver.Types where import Data.Text (Text) import Data.HashMap.Strict import Data.Word (Word32) import Data.Vector type Key = Text data Tokens = Literal Text | Identity Text | Object Text Key | Array Text Word32 deriving (Show, Eq) data Value = Strin...
module Text.Karver.Types where import Data.Text (Text) import Data.HashMap.Strict import Data.Vector type Key = Text data Tokens = Literal Text | Identity Text | Object Text Key | Array Text Int deriving (Show, Eq) data Value = String Text | Map (H...
Change array index to Int
Change array index to Int This is just so I don't have to convert Word32 to Int for functions like ! when accessing vector elements.
Haskell
bsd-3-clause
ibotty/stencil,sourrust/karver
0334432571f6e330bf81c6fe7781b3d27910fb7f
test/Databrary/Model/Audit/TypesTest.hs
test/Databrary/Model/Audit/TypesTest.hs
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Databrary.Model.Audit.TypesTest where import Data.Time as Time import Database.PostgreSQL.Typed.Inet (PGInet(..)) import Databrary.Model.Audit.Types import Databrary.Model.Id.Types import Databrary.Model.TypeOrphans () auditIdentity1 :: AuditIdentity aud...
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Databrary.Model.Audit.TypesTest where import Data.Time as Time import Database.PostgreSQL.Typed.Inet (PGInet(..)) import Databrary.Model.Audit.Types import Databrary.Model.Id.Types -- import Databrary.Model.TypeOrphans () auditIdentity1 :: AuditIdentity ...
Remove import not used yet
Remove import not used yet
Haskell
agpl-3.0
databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary
c0281cbce50731dbc7e3255114ba036bf292e5f8
tests/PointsTo.hs
tests/PointsTo.hs
import System.Environment ( getArgs ) import Data.LLVM.Analysis.PointsTo.Andersen import Data.LLVM main :: IO () main = do [ fname ] <- getArgs Right m <- parseLLVMBitcodeFile defaultParserOptions fname let a = runPointsToAnalysis m putStrLn $ show a
import System.Environment ( getArgs ) import Data.LLVM.Analysis.PointsTo.Andersen import Data.LLVM.ParseBitcode main :: IO () main = do [ fname ] <- getArgs mm <- parseLLVMBitcodeFile defaultParserOptions fname case mm of Left err -> putStrLn err Right m -> do let a = runPointsToAnalysis m v...
Add a test driver for the Andersen analysis
Add a test driver for the Andersen analysis
Haskell
bsd-3-clause
wangxiayang/llvm-analysis,travitch/llvm-analysis,wangxiayang/llvm-analysis,travitch/llvm-analysis
41055c207c2e387fe390c670bb4f911b39bdab12
src/App.hs
src/App.hs
{-# LANGUAGE OverloadedStrings #-} module App where import Web.Scotty import Data.Monoid ((<>)) import Views(indexV) app :: ScottyM () app = do get "/" indexH get "/:word" wordH indexH :: ActionM () indexH = indexV wordH :: ActionM () wordH = do beam <- param "word" html $ "uh...
{-# LANGUAGE OverloadedStrings #-} module App where import Web.Scotty import Data.Monoid ((<>)) import Views(indexV) app :: ScottyM () app = do get "/" indexH get "/about" aboutH get "/contact" contactH get "/login" loginH get "/register" re...
Add a bunch of routes!
Add a bunch of routes!
Haskell
mit
parsonsmatt/QuickLift
ba989f19c81bfb7ecc9bb53227720411894072c7
file-service/app/Main.hs
file-service/app/Main.hs
module Main where import Control.Monad.Except (runExceptT) import Control.Monad.Logger (runStdoutLoggingT) import Database.Persist.Postgresql (createPostgresqlPool) import Network.HTTP.Client (defaultManagerSettings, newManager) import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.RequestLogger (logStdo...
module Main where import Control.Monad.Except (runExceptT) import Control.Monad.Logger (runStdoutLoggingT) import Database.Persist.Postgresql (createPostgresqlPool) import Network.HTTP.Client (defaultManagerSettings, newManager) import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.RequestLogger (logStdo...
Fix accessing directory API in the file service
Fix accessing directory API in the file service
Haskell
mit
houli/distributed-file-system
0d555b763e02bf0df0a77c28a54b7e201778a2d5
exercises/HAD/Y2017/M01/D25/Exercise.hs
exercises/HAD/Y2017/M01/D25/Exercise.hs
module Y2017.M01.D25.Exercise where import System.Directory {-- Okay, they say 'a' is the second-most popular 'word' in Haskell. They. Pfft! Well, where will 'they' be when you're in front of your boss explaining this statement? Where's your stats? Where's the proof? Let's break down the problem and prove, or disp...
module Y2017.M01.D25.Exercise where import System.Directory {-- Okay, they say 'a' is the second-most popular 'word' in Haskell. They. Pfft! Well, where will 'they' be when you're in front of your boss explaining this statement? Where's your stats? Where's the proof? Let's break down the problem and prove, or disp...
Put the results into the IO monad
Put the results into the IO monad
Haskell
mit
geophf/1HaskellADay,geophf/1HaskellADay,geophf/1HaskellADay
c6823053175aeabc3010c4c411ed0d5773d3f576
haskell/Roman2Decimal.hs
haskell/Roman2Decimal.hs
-- roman2decimal module Roman2Decimal ( RomanAlg(..), romanAlgToDecimal, RomanNum, romanToDecimal, strToRoman, romanStrToDecimal ) where data RomanAlg = I | V | X | L | C | D | M deriving(Eq, Ord, Show, Read) type RomanNum = [RomanAlg] romanAlgToDecimal :: RomanAlg -> Int romanAlgToDecimal ...
-- roman2decimal module Roman2Decimal ( RomanAlg(..), romanAlgToDecimal, RomanNum, romanToDecimal, strToRoman, romanStrToDecimal ) where data RomanAlg = I | V | X | L | C | D | M deriving(Eq, Ord, Show, Read) type RomanNum = [RomanAlg] romanAlgToDecimal :: RomanAlg -> Int romanAlgToDecimal ...
Use `as` pattern for better efficiency in haskell.
Use `as` pattern for better efficiency in haskell.
Haskell
mit
yamadapc/general-roman2decimal,yamadapc/general-roman2decimal,yamadapc/general-roman2decimal
5650b2c38c4a1fde7b3cd0e66f7d964d1d636eb5
src/Verifier/SAW/Cryptol/Simpset.hs
src/Verifier/SAW/Cryptol/Simpset.hs
{- | Module : Verifier.SAW.Cryptol.Simpset Copyright : Galois, Inc. 2018 License : BSD3 Maintainer : huffman@galois.com Stability : experimental Portability : non-portable (language extensions) -} {-# LANGUAGE OverloadedStrings #-} module Verifier.SAW.Cryptol.Simpset ( mkCryptolSimpset ) where impo...
{- | Module : Verifier.SAW.Cryptol.Simpset Copyright : Galois, Inc. 2018 License : BSD3 Maintainer : huffman@galois.com Stability : experimental Portability : non-portable (language extensions) -} {-# LANGUAGE OverloadedStrings #-} module Verifier.SAW.Cryptol.Simpset ( mkCryptolSimpset ) where impo...
Update cryptol_ss for changed theorem names.
Update cryptol_ss for changed theorem names.
Haskell
bsd-3-clause
GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script
54de7008eb3bb6e15cd531ba99e46c921ca50b76
samples/CommitComment.hs
samples/CommitComment.hs
module CommitComment where import qualified Github.Repos.Commits as Github main = do possibleComment <- Github.commitCommentFor "thoughtbot" "paperclip" "41f685f6e01396936bb8cd98e7cca517e2c7d96b" case possibleComment of (Left error) -> putStrLn $ "Error: " ++ (show error) (Right comment) -> putStrLn $ ...
module CommitComment where import qualified Github.Repos.Commits as Github main = do possibleComment <- Github.commitCommentFor "thoughtbot" "paperclip" "669575" case possibleComment of (Left error) -> putStrLn $ "Error: " ++ (show error) (Right comment) -> putStrLn $ formatComment comment formatComme...
Fix the incorrectly-used sample app that shows a specific comment.
Fix the incorrectly-used sample app that shows a specific comment.
Haskell
bsd-3-clause
jwiegley/github,jwiegley/github
9185fb56b748fe8dcf0d4e9d1b81880d335ec704
src/HaskellWorks/Data/Vector/Storable.hs
src/HaskellWorks/Data/Vector/Storable.hs
module HaskellWorks.Data.Vector.Storable where import Data.Word import qualified Data.ByteString.Internal as BSI import qualified Data.Vector.Storable as DVS import qualified Foreign.ForeignPtr as F import qualified Foreign.Marshal.Unsafe as F import qualified Foreign.Ptr as F {-# ANN module...
module HaskellWorks.Data.Vector.Storable where import Data.Word import qualified Data.Vector.Storable as DVS {-# ANN module ("HLint: ignore Redundant do" :: String) #-} padded :: Int -> DVS.Vector Word8 -> DVS.Vector Word8 padded n v = v <> DVS.replicate ((n - DVS.length v) `max` 0) 0 {-# INLINE padded #-}
Use simpler definition and rely on vector fusion to optimise. (Fingers crossed)
Use simpler definition and rely on vector fusion to optimise. (Fingers crossed)
Haskell
bsd-3-clause
haskell-works/hw-prim
6320fab819d0dcf9a9b5989a0daac2c4bf453b7d
src/Language/K3/Codegen/CPP/Core/Type.hs
src/Language/K3/Codegen/CPP/Core/Type.hs
module Language.K3.Codegen.CPP.Core.Type where import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) import Language.K3.Core.Common import Language.K3.Codegen.CPP.Core.Stringify data Type = Named Identifier | Inferred | Parameter Identifier | Primitive PrimitiveType | Templated Type [Type] | Qua...
module Language.K3.Codegen.CPP.Core.Type where import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) import Language.K3.Core.Common import Language.K3.Codegen.CPP.Core.Stringify data Type = Named Identifier | Inferred | Parameter Identifier | Primitive PrimitiveType | Templated Type [Type] | Qua...
Add stringification routines for primitive types.
Add stringification routines for primitive types.
Haskell
apache-2.0
DaMSL/K3,yliu120/K3,DaMSL/K3
34b39905236ad4775a7a14b05fc6a241431d4413
exercises/pascals-triangle/test/Tests.hs
exercises/pascals-triangle/test/Tests.hs
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Triangle (rows) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec spec...
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Triangle (rows) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec spec...
Improve code base on HLint's suggestions.
pascals-triangle: Improve code base on HLint's suggestions.
Haskell
mit
exercism/xhaskell
a14a2397052e34cbed247d8f72d91d51c3d4b541
src/Development/Shake/Internal/Paths.hs
src/Development/Shake/Internal/Paths.hs
-- | The information from Paths_shake cleaned up module Development.Shake.Internal.Paths( shakeVersionString, initDataDirectory, hasManualData, copyManualData, readDataFileHTML ) where import Paths_shake import Control.Monad import Data.Version import System.Directory import System.FilePath import...
-- | The information from Paths_shake cleaned up module Development.Shake.Internal.Paths( shakeVersionString, initDataDirectory, hasManualData, copyManualData, readDataFileHTML ) where import Paths_shake import Control.Monad import Data.Version import System.Directory import System.FilePath import...
Add an explicit getDataDirectory, to only look up directories
Add an explicit getDataDirectory, to only look up directories
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
622f41752910b73f3ff9307ce5a8a50896df2e1c
test/Hpack/DefaultsSpec.hs
test/Hpack/DefaultsSpec.hs
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} module Hpack.DefaultsSpec (spec) where import Helper import System.Directory import Hpack.Syntax.Defaults import Hpack.Defaults spec :: Spec spec = do describe "ensure" $ do it "fails when local file does not exist" $ do ...
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} module Hpack.DefaultsSpec (spec) where import Helper import System.Directory import Hpack.Syntax.Defaults import Hpack.Defaults spec :: Spec spec = do describe "ensure" $ do it "fails when local file does not exist" $ do ...
Fix a test on Windows.
Fix a test on Windows.
Haskell
mit
haskell-tinc/hpack,sol/hpack
005fefa1fd4ef103a3900aad4777089ebc20f832
src/Block/Parse.hs
src/Block/Parse.hs
{-# LANGUAGE OverloadedStrings #-} module Block.Parse ( Block (Block) , parseBlocks ) where import Data.Attoparsec.ByteString (takeTill) import Data.Attoparsec.ByteString.Char8 hiding (takeTill, parse, eitherResult) import Data.Attoparsec.ByteString.Lazy (parse, eitherResult) import qualified Data.ByteString.L...
{-# LANGUAGE OverloadedStrings #-} module Block.Parse ( Block (Block) , parseBlocks ) where import Data.Attoparsec.ByteString (takeTill, skipWhile) import Data.Attoparsec.ByteString.Char8 hiding (takeTill, skipWhile, parse, eitherResult) import Data.Attoparsec.ByteString.Lazy (parse, eitherResult) import qua...
Fix block parse skipSpace taking up newline as well
Fix block parse skipSpace taking up newline as well
Haskell
bsd-3-clause
hectorhon/autotrace2,hectorhon/autotrace2
868f709441d1f27881f85c059ae1df83a943950a
src/Text/Karver.hs
src/Text/Karver.hs
module Text.Karver where import Text.Karver.Types import Text.Karver.Parse import Control.Applicative import Data.Attoparsec.Text import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as H import Data.Text (Text) import qualified Data.Text as T renderTemplate :: HashMap Text Value -> Text -> Text...
module Text.Karver where import Text.Karver.Types import Text.Karver.Parse import Control.Applicative import Data.Attoparsec.Text import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as H import Data.Text (Text) import qualified Data.Text as T renderTemplate :: HashMap Text Value -> Text -> Text...
Add matcher for the Object type to mergeMap
Add matcher for the Object type to mergeMap
Haskell
bsd-3-clause
ibotty/stencil,sourrust/karver
843634b0b8dc105ba4e883f02d805536271ec796
haskell/binary/Binary.hs
haskell/binary/Binary.hs
module Binary ( toDecimal ) where import Data.Map (findWithDefault, fromList) toDecimal :: String -> Int toDecimal = convert "01" convert :: String -> String -> Int convert digits string = sum parts where radix = length digits digitValues = fromList $ zip digits [0..] values = map getValue string get...
module Binary ( toDecimal ) where import Data.List (foldl') toDecimal :: String -> Int toDecimal = convert fromBinary 2 where fromBinary = fromEnum . ('1' ==) convert :: (Char -> Int) -> Int -> String -> Int convert fromBase radix string = foldl' accumulate 0 values where values = map fromBase string acc...
Change solution to use foldl'
Change solution to use foldl'
Haskell
mit
tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions
80364f5e25f94bb838fb018ae80eade52268d128
spec/System/PassengerCheck/ParseSpec.hs
spec/System/PassengerCheck/ParseSpec.hs
{-# LANGUAGE OverloadedStrings #-} module System.PassengerCheck.ParseSpec (spec) where import Test.Hspec import Text.Parsec import System.PassengerCheck.Types import System.PassengerCheck.Parse import Text.ParserCombinators.Parsec.Error(ParseError, Message, errorMessages,...
{-# LANGUAGE OverloadedStrings #-} module System.PassengerCheck.ParseSpec (spec) where import Test.Hspec import Text.Parsec import System.PassengerCheck.Types import System.PassengerCheck.Parse import Text.ParserCombinators.Parsec.Error(ParseError, Message, errorMessages,...
Use correct path to fixture
Use correct path to fixture
Haskell
mit
stackbuilders/passenger-check
5b4490a41c7a620f4e05f5306cf49b11f419ae33
src/Text/Karver/Parse.hs
src/Text/Karver/Parse.hs
{-# LANGUAGE OverloadedStrings #-} module Text.Karver.Parse ( literalParser , identityParser , objectParser , listParser ) where import Text.Karver.Types import Data.Attoparsec.Text import Data.Text (Text) literalParser :: Parser Tokens literalParser = do html <- takeWhile1 (/= '{') return $ LiteralTok html de...
{-# LANGUAGE OverloadedStrings #-} module Text.Karver.Parse ( literalParser , identityParser , objectParser , listParser ) where import Text.Karver.Types import Data.Attoparsec.Text import Data.Text (Text) literalParser :: Parser Tokens literalParser = do html <- takeWhile1 (/= '{') return $ LiteralTok html de...
Add expressionDelimiter for future logic tokens
Add expressionDelimiter for future logic tokens
Haskell
bsd-3-clause
ibotty/stencil,sourrust/karver
b436b6762f87b22fcff7a83c64f865c039c3f7af
src/Language/Haskell/Ghcid/Terminal.hs
src/Language/Haskell/Ghcid/Terminal.hs
{-# LANGUAGE CPP #-} module Language.Haskell.Ghcid.Terminal( terminalSize, terminalTopmost ) where #if !defined(mingw32_HOST_OS) import qualified System.Console.Terminal.Size as Terminal import System.IO (stdout) import Data.Tuple.Extra #endif #if defined(mingw32_HOST_OS) foreign import stdcall unsafe "window...
{-# LANGUAGE CPP #-} module Language.Haskell.Ghcid.Terminal( terminalSize, terminalTopmost ) where #if !defined(mingw32_HOST_OS) import qualified System.Console.Terminal.Size as Terminal import System.IO (stdout) import Data.Tuple.Extra #endif #if defined(mingw32_HOST_OS) import Data.Word c_SWP_NOSIZE = 1 :: ...
Refactor the set top to use windows flags, not random constants
Refactor the set top to use windows flags, not random constants
Haskell
bsd-3-clause
ndmitchell/ghcid
07d5fa38df783a1b190ace331c29f63f57d84a7f
Development/Shake/Util.hs
Development/Shake/Util.hs
module Development.Shake.Util( parseMakefile, needMakefileDependencies ) where import Development.Shake import qualified Data.ByteString.Char8 as BS import qualified Development.Shake.ByteString as BS import Control.Arrow parseMakefile :: String -> [(FilePath, [FilePath])] parseMakefile = map (BS.unpack ***...
module Development.Shake.Util( parseMakefile, needMakefileDependencies ) where import Development.Shake import Development.Shake.File import qualified Data.ByteString.Char8 as BS import qualified Development.Shake.ByteString as BS import Control.Arrow parseMakefile :: String -> [(FilePath, [FilePath])] pars...
Improve the performance of needMakefileDependencies, use needBS
Improve the performance of needMakefileDependencies, use needBS
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
a88fbcef1ff550e280800be258eb4329f7b8a812
compiler/Build/Interface.hs
compiler/Build/Interface.hs
{-# OPTIONS_GHC -W #-} module Build.Interface (load,isValid) where import qualified Data.ByteString.Lazy as L import qualified Data.Binary as Binary import qualified Build.Print as Print import qualified Elm.Internal.Version as Version import System.Directory (doesFileExist) import AST.Module load :: Binary.Binary a...
{-# OPTIONS_GHC -W #-} module Build.Interface (load,isValid) where import qualified Data.ByteString.Lazy as L import qualified Data.Binary as Binary import qualified Build.Print as Print import qualified Elm.Internal.Version as Version import System.Directory (doesFileExist) import AST.Module as Module load :: Binar...
Update for new Module AST
Update for new Module AST
Haskell
bsd-3-clause
5outh/Elm,JoeyEremondi/elm-pattern-effects,laszlopandy/elm-compiler,Axure/elm-compiler,mgold/Elm,pairyo/elm-compiler
dd07979183648a6c97f2c543b3225e612a760cef
src/Main.hs
src/Main.hs
module Main where import Test.HUnit (runTestTT, Test(..), Counts(..)) import System.Exit (exitSuccess, exitFailure) import HaddockBackend.Api import Options import DocTest import qualified Interpreter main :: IO () main = do (options, files) <- getOptions let ghciArgs = ghcOptions options ++ files Interpreter...
module Main where import Test.HUnit (runTestTT, Test(..), Counts(..)) import System.Exit (exitSuccess, exitFailure) import System.IO import HaddockBackend.Api import Options import DocTest import qualified Interpreter main :: IO () main = do (options, files) <- getOptions let ghciArgs = ghcOptions options ++ fi...
Print stats to stderr instead of stdout
Print stats to stderr instead of stdout
Haskell
mit
snoyberg/doctest-haskell,snoyberg/doctest-haskell,sol/doctest,ekmett/doctest,ekmett/doctest,sol/doctest
f116375ad219dd10d4f478a4cce6e0b436d0cdde
compiler/Elm/Internal/Paths.hs
compiler/Elm/Internal/Paths.hs
{-# OPTIONS_GHC -Wall #-} module Elm.Internal.Paths where import System.Directory (doesDirectoryExist) import System.Environment (getEnv) import System.FilePath ((</>)) import System.IO.Unsafe (unsafePerformIO) import qualified Paths_Elm as This -- |Name of directory for all of a project's dependencies. dependencyDir...
{-# OPTIONS_GHC -Wall #-} module Elm.Internal.Paths where import System.Directory (doesFileExist) import System.Environment (getEnv) import System.FilePath ((</>)) import System.IO.Unsafe (unsafePerformIO) import qualified Paths_Elm as This -- |Name of directory for all of a project's dependencies. dependencyDirector...
Fix silly error that shows up when installing through cabal
Fix silly error that shows up when installing through cabal
Haskell
bsd-3-clause
JoeyEremondi/elm-pattern-effects,pairyo/elm-compiler,deadfoxygrandpa/Elm,5outh/Elm,mgold/Elm,Axure/elm-compiler,laszlopandy/elm-compiler
08ca035de14e927c4fdaa151491ebe9050563f69
examples/IncrementalIndexedBasedDecode.hs
examples/IncrementalIndexedBasedDecode.hs
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} import Control.Monad import qualified Data.ByteString as B import Data.Csv.Incremental import System.Exit import System.IO main :: IO () main = withFile "salaries.csv" ReadMode $ \ csvFile -> do let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure ...
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} import Control.Monad import qualified Data.ByteString as B import Data.Csv.Incremental import System.Exit import System.IO main :: IO () main = withFile "salaries.csv" ReadMode $ \ csvFile -> do let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure ...
Update examples to follow changes to incremental API
Update examples to follow changes to incremental API
Haskell
bsd-3-clause
hvr/cassava,psibi/cassava,jb55/cassava,ahodgen/cassava,bgamari/cassava,richardfergie/cassava,treeowl/cassava,tibbe/cassava,bergmark/cassava
57727bff4c776839d94b65ad567ba13d0cf0c5f4
exercises/hsmoney/src/GettingStarted.hs
exercises/hsmoney/src/GettingStarted.hs
{-# LANGUAGE ScopedTypeVariables #-} -- We will explain why we need this later module GettingStarted (runTests) where import Test.QuickCheck payDutch :: Int -> Int -> [Int] payDutch amount people = take people $ repeat amount prop_dutchLength :: NonNegative Int -> NonNegative Int -> Property prop_dutchLength (NonNega...
{-# LANGUAGE ScopedTypeVariables #-} -- We will explain why we need this later module GettingStarted where runTests = do putStrLn "something along the lines of: quickCheck prop_SquareRootOfNSquaredEqualsN goes here"
Revert "Length correct, with fake division of money"
Revert "Length correct, with fake division of money" This reverts commit 01fb9f18c78419bba983240db10b3e46cd3be5c6.
Haskell
bsd-3-clause
qwaneu/property-based-tutorial,mostalive/property-based-tutorial
0b62c1f2710bd5ca2346509c95ae2d637aba22b1
stirfile.hs
stirfile.hs
-- Copyright 2012-2013 Samplecount S.L. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agr...
-- Copyright 2012-2013 Samplecount S.L. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agr...
Fix license file path in build script
Fix license file path in build script
Haskell
apache-2.0
samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla
58531165f048528d8c6dbd15ce98ec5631885ec5
haskell/src/Lexer/Tokens.hs
haskell/src/Lexer/Tokens.hs
module Lexer.Tokens ( Token(..), TokenType(..), print_tokens ) where import qualified Tools.Formatting as Formatting import qualified Lexer.SourceInfo as SourceInfo data Token = Token TokenType String SourceInfo.TokenLoc data TokenType = IntLiteral | BoolLiteral | NullLiteral | IfLiteral ...
module Lexer.Tokens ( Token(..), TokenType(..), print_tokens ) where import qualified Debug.Debug as Debug import qualified Tools.Formatting as Formatting import qualified Lexer.SourceInfo as SourceInfo data Token = Token TokenType String SourceInfo.TokenLoc data TokenType = IntLiteral | BoolLite...
Debug print tokens in print_tokens
Debug print tokens in print_tokens
Haskell
mit
quintenpalmer/fresh
ca40f1b5532271e4924509e9196dbf7ab62ca8fc
library/HTMLEntities/Parser.hs
library/HTMLEntities/Parser.hs
-- | -- Attoparsec parsers. module HTMLEntities.Parser where import HTMLEntities.Prelude import Data.Attoparsec.Text import qualified Data.Text as Text import qualified HTMLEntities.NameTable as NameTable -- | -- A parser of a single entity. -- -- Parses numeric encoding: -- -- >>> mapM_ Data.Text.IO.putStrLn $ Da...
-- | -- Attoparsec parsers. module HTMLEntities.Parser where import HTMLEntities.Prelude import Data.Attoparsec.Text import qualified Data.Text as Text import qualified HTMLEntities.NameTable as NameTable -- | -- A parser of a single entity. -- -- Parses numeric encoding: -- -- >>> mapM_ Data.Text.IO.putStrLn $ Da...
Revert "Remove liftMaybe function for GHC8 compatibility"
Revert "Remove liftMaybe function for GHC8 compatibility" This reverts commit bd15b8f1456302f919ed3d091c93f738e0509b9e.
Haskell
mit
nikita-volkov/html-entities
566ec7086b7c573ce495a0cafbb34d88274d9684
source/executable/Main.hs
source/executable/Main.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Calculator import Control.Monad (forever) import Data.Monoid ((<>)) import Data.Text (Text) import System.IO (hSetBuffering, stdout, BufferMode (NoBuffering)) import qualified Data.Text as T import qualified Data.Text.IO as T main :: IO () main = do hS...
{-# LANGUAGE OverloadedStrings #-} module Main where import Calculator import Control.Monad (forever) import Data.Monoid ((<>)) import Data.Text (Text) import System.IO (hSetBuffering, stdout, BufferMode (NoBuffering)) import qualified Data.Text as T import qualified Data.Text.IO as T main :: IO () main = do hS...
Change the place at which function "stripSpaces" is invoked.
Change the place at which function "stripSpaces" is invoked.
Haskell
bsd-3-clause
jonathanknowles/haskell-calculator
286fe463e300fa832b4a8e9f932d38fe32546e14
product-executable/CLI/Base.hs
product-executable/CLI/Base.hs
module CLI.Base ( showUsage , parseCommand , execCommand ) where import qualified CLI.DataFiles as Paths import qualified CLI.ProductForm as PF data Command = Command { command :: String , arguments :: [String] } deriving (Show) execCommand :: Comman...
module CLI.Base ( showUsage , parseCommand , execCommand ) where import qualified CLI.DataFiles as Paths import qualified CLI.ProductForm as PF data Command = Command { command :: String , arguments :: [String] } deriving (Show) execCommand :: Comman...
Use record syntax to squelch errors
Use record syntax to squelch errors
Haskell
mit
gust/feature-creature,gust/feature-creature
317e770df12460d5b07a7e9bff300c74ba244947
src/ZoomHub/Types/Internal/ContentURI.hs
src/ZoomHub/Types/Internal/ContentURI.hs
{-# LANGUAGE OverloadedStrings #-} module ZoomHub.Types.Internal.ContentURI ( ContentURI , unContentURI ) where import Data.Aeson (ToJSON, Value (String), toJSON) import qualified Data.Text as T import Network.URI (URI, parseAbsoluteURI) import Servant (FromText, fromText) ...
{-# LANGUAGE OverloadedStrings #-} module ZoomHub.Types.Internal.ContentURI ( ContentURI , unContentURI ) where import Data.Aeson (ToJSON, Value (String), toJSON) import qualified Data.Text as T import Network.URI (URI, parseAbsoluteURI, uriScheme) import Servant (FromText, ...
Whitelist `http:` and `https:` URLs
Whitelist `http:` and `https:` URLs
Haskell
mit
zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub
dc4a71d738d25d0a4652543bc91c687c2a256647
misc/HLint_NoDataFiles.hs
misc/HLint_NoDataFiles.hs
{-# LANGUAGE TemplateHaskell, ViewPatterns #-} -- This script shows how to use HLint without any data files (provided you do not use --report) -- Running this script should report two errors import Data.List import Data.List import Language.Haskell.HLint import Language.Haskell.TH.Syntax import Network.HTTP hints :...
{-# LANGUAGE TemplateHaskell, ViewPatterns #-} -- This script shows how to use HLint without any data files (provided you do not use --report) -- Running this script should report two errors import Data.List import Language.Haskell.HLint import Language.Haskell.TH.Syntax import Network.HTTP hints :: String hints = ...
Fix a few HLint warnings in nearby scripts
Fix a few HLint warnings in nearby scripts
Haskell
bsd-3-clause
ndmitchell/hlint,ndmitchell/hlint
c4dad2f299a27c576576a2936a754da9147793f7
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
d24a9436d127aee06a8942a14ad8a6299f669209
catch-mask2.hs
catch-mask2.hs
import System.IO import System.IO.Error import System.Environment import Control.Exception -- <<main main = do fs <- getArgs let loop n [] = return n loop n (f:fs) = do getMaskingState >>= print r <- Control.Exception.try (openFile f ReadMode) case r of Left e | isDoesNo...
import System.IO import System.IO.Error import System.Environment import Control.Exception -- <<main main = do fs <- getArgs let loop n [] = return n loop n (f:fs) = do getMaskingState >>= print r <- Control.Exception.try (openFile f ReadMode) case r of Left e | isDoesNo...
Remove redundant call to openFile.
Remove redundant call to openFile. Actually, why not just use readFile, both here and in catch-mask.hs?
Haskell
bsd-3-clause
seahug/parconc-examples,yantonov/parconc-examples
744248be198ac74ddd2eb2f8cef4f124ede5029f
test/Test/Pos/Types/Identity/SafeCopySpec.hs
test/Test/Pos/Types/Identity/SafeCopySpec.hs
{-# LANGUAGE TypeApplications #-} -- | This module tests SafeCopy instances. module Test.Pos.Types.Identity.SafeCopySpec ( spec ) where import Test.Hspec (Spec, describe) import Test.Hspec.QuickCheck (prop) import Universum import qualified Pos.Types ...
{-# LANGUAGE TypeApplications #-} -- | This module tests SafeCopy instances. module Test.Pos.Types.Identity.SafeCopySpec ( spec ) where import Test.Hspec (Spec, describe) import Test.Hspec.QuickCheck (prop) import Universum import qualified Pos.Types ...
Fix obsolete comment and typo
Fix obsolete comment and typo
Haskell
apache-2.0
input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,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
48e2da3e65c3b4daed598106873655b5fed08762
infra/Pos/Binary/Infra/Relay.hs
infra/Pos/Binary/Infra/Relay.hs
module Pos.Binary.Infra.Relay ( ) where import Universum import Pos.Binary.Class (Bi (..), getWord8, label, labelS, putConst, putField) import Pos.Communication.Types.Relay (InvMsg (..), MempoolMsg (..), ReqMsg (....
module Pos.Binary.Infra.Relay ( ) where import Universum import Pos.Binary.Class (Bi (..), getWord8, label, labelS, putConst, putField) import qualified Pos.Binary.Cbor as Cbor import Pos.Communicati...
Add Cbor.Bi instance for MempoolMsg
Add Cbor.Bi instance for MempoolMsg
Haskell
apache-2.0
input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype
4833af57024e9a6e07b28c0612cf8a1c02fc8098
src/Draw/TabbedWindow.hs
src/Draw/TabbedWindow.hs
module Draw.TabbedWindow ( drawTabbedWindow ) where import Prelude () import Prelude.MH import Brick import Brick.Widgets.Border import Brick.Widgets.Center import Types import Themes tabbedWindowWidth :: Int tabbedWindowWidth = 78 tabbedWin...
module Draw.TabbedWindow ( drawTabbedWindow ) where import Prelude () import Prelude.MH import Brick import Brick.Widgets.Border import Brick.Widgets.Center import Types import Themes tabbedWindowWidth :: Int tabbedWindowWidth = 78 tabbedWin...
Use emphasis attribute in tabbed window title
Use emphasis attribute in tabbed window title
Haskell
bsd-3-clause
matterhorn-chat/matterhorn
aa631646ad19b0bd2ba78dbe12abe415762bb5b9
src/Test/Forward.hs
src/Test/Forward.hs
module Test.Forward(main) where import Development.Shake import Development.Shake.Forward import Development.Shake.FilePath import Control.Monad.Extra import Test.Type main = shaken test $ \args obj -> forwardRule $ do let src = "src/Test/C" cs <- getDirectoryFiles src ["*.c"] os <- forP cs $ \c -> do ...
module Test.Forward(main) where import Development.Shake import Development.Shake.Forward import Development.Shake.FilePath import Control.Monad.Extra import Test.Type main = shaken test $ \args obj -> forwardRule $ do let src = "src/Test/C" cs <- getDirectoryFiles src ["*.c"] os <- forP cs $ \c -> do ...
Test the forward build system at -j2
Test the forward build system at -j2
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
bec54f38a42f1f48aa9577a853c0288d46eec3ff
tests/Network/BitTorrent/Core/NodeSpec.hs
tests/Network/BitTorrent/Core/NodeSpec.hs
module Network.BitTorrent.Core.NodeSpec (spec) where import Control.Applicative import Test.Hspec import Test.QuickCheck import Network.BitTorrent.Core.Node import Network.BitTorrent.Core.PeerAddrSpec () instance Arbitrary NodeId where arbitrary = undefined instance Arbitrary a => Arbitrary (NodeAddr a) where ar...
{-# OPTIONS -fno-warn-orphans #-} module Network.BitTorrent.Core.NodeSpec (spec) where import Control.Applicative import Data.Serialize as S import Data.String import Test.Hspec import Test.QuickCheck import Network.BitTorrent.Core import Network.BitTorrent.Core.PeerAddrSpec () instance Arbitrary NodeId where arbit...
Add tests for NodeInfo module
Add tests for NodeInfo module
Haskell
bsd-3-clause
DavidAlphaFox/bittorrent,pxqr/bittorrent
3f1f0fda94bb751e332dc9ad5cd9d7b74a75744a
Handler/Home.hs
Handler/Home.hs
module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do app <- getYesod let meetupApiKey = appMeetupApiKey $ appSettings app event <- liftIO $ do events <- M.fetchEvents meetupAp...
module Handler.Home where import Import import qualified Prelude import qualified Util.Formatting as F import qualified Util.Meetup as M getHomeR :: Handler Html getHomeR = do app <- getYesod let meetupApiKey = appMeetupApiKey $ appSettings app event <- liftIO $ do events <- M.fetchEvents meetupApiKey r...
Fix indentation to two spaces
Fix indentation to two spaces
Haskell
mit
rcook/seattlehaskell-org,seahug/seattlehaskell-org,seahug/seattlehaskell-org,rcook/seattlehaskell-org
9cd9e375e56fa4f896ef3ea7630914e4f6e13e69
Example.hs
Example.hs
module Example where {- main xs = map head xs -} {- main x = neq x neq = not . eq eq x = x == (0::Int) -} main x y = neq (x::Int) y neq x y = not (x == y)
module Example where {- main xs = map head xs -} {- main x = neq x neq = not . eq eq x = x == (0::Int) -} {- main x y = neq (x::Int) y neq x y = not (x == y) -} main xs = (a . b . c) xs a x = x+(1::Int) b x = x*(4::Int) c x = x-(3::Int)
Add another example, which tests the homeomorphic embedding
Add another example, which tests the homeomorphic embedding
Haskell
bsd-3-clause
ndmitchell/firstify
0a70052b2d375fc89d88caac2f6df17dabecbe07
haskell/Problem32.hs
haskell/Problem32.hs
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 32 -- Pandigital products module Problem32 where import Common (digits) import Control.Monad (guard) import Data.List (nub, sort) pandigital :: [Int] -> Bool pandigital = (== [1..9]) . sort solve :: Int solve = sum . nub $ do ...
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 32 -- Pandigital products module Problem32 where import Common (digits) import Control.Monad (guard) import Data.List (nub, sort) limit :: Int limit = 9876 solve :: Int solve = sum . nub $ do a <- [1..limit] let bLimit...
Improve soln to problem 32
Improve soln to problem 32
Haskell
mit
mk12/euler,mk12/euler
8fadad8fe5dc8bbf89aceb856301173af05dcd19
test/Main.hs
test/Main.hs
module Main where import Hasql.TH.Prelude import Hedgehog import Hedgehog.Main import qualified Main.Gen as Gen import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import qualified Hasql.TH.Syntax.Ast as Ast import qualified Hasql.TH.Syntax.Parsing as Parsing import qualified Hasql.TH.Syntax....
module Main where import Hasql.TH.Prelude import Hedgehog import Hedgehog.Main import qualified Main.Gen as Gen import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import qualified Hasql.TH.Syntax.Ast as Ast import qualified Hasql.TH.Syntax.Parsing as Parsing import qualified Hasql.TH.Syntax....
Reduce the amount of simulations
Reduce the amount of simulations
Haskell
mit
nikita-volkov/hasql-th
9ca5e71ff9d0e1aee110786916f72b8874b8e4ee
Data/Aeson.hs
Data/Aeson.hs
-- | -- Module: Data.Aeson -- Copyright: (c) 2011 MailRank, Inc. -- License: Apache -- Maintainer: Bryan O'Sullivan <bos@mailrank.com> -- Stability: experimental -- Portability: portable -- -- Types and functions for working efficiently with JSON data. -- -- (A note on naming: in Greek mythology, Aeson wa...
-- | -- Module: Data.Aeson -- Copyright: (c) 2011 MailRank, Inc. -- License: Apache -- Maintainer: Bryan O'Sullivan <bos@mailrank.com> -- Stability: experimental -- Portability: portable -- -- Types and functions for working efficiently with JSON data. -- -- (A note on naming: in Greek mythology, Aeson wa...
Add the oft-requested decode function.
Add the oft-requested decode function.
Haskell
bsd-3-clause
neobrain/aeson,SeanRBurton/aeson,lykahb/aeson,plaprade/aeson,JPMoresmau/aeson,sol/aeson,abbradar/aeson,neobrain/aeson,aelve/json-x,bwo/aeson,dmjio/aeson,sol/aeson,roelvandijk/aeson,23Skidoo/aeson,roelvandijk/aeson,sol/aeson,jkarni/aeson,nurpax/aeson,timmytofu/aeson,beni55/aeson
dde163b8d2f3a9ed2e5542a5329d350c7dbfc5a9
clk-ls.hs
clk-ls.hs
import App.Clk.Util import Data.Time.Clock import System.Directory import Text.Regex.Posix type Name = String type Tags = [String] type Message = String data Entry = Entry Name UTCTime Tags Message deriving Show instance Read Entry where readsPrec _ line = [( Entry name time tags msg, "" )] wh...
import App.Clk.Util import Data.List import Data.Time.Clock import System.Directory import Text.Regex.Posix type Name = String type Tags = [String] type Message = String data Entry = Entry Name UTCTime Tags Message instance Read Entry where readsPrec _ line = [( Entry name time tags msg, "" )] whe...
Make Entry a custom Show instance
Make Entry a custom Show instance The instance from "deriving" was there only for debugging. This implementation does the same thing as clk-in. The duplication between those two places should be factored out soon. At this point, I've made the decision that show and read deal with the filesystem representation of an...
Haskell
unlicense
mndrix/clk
8bcf846460d2a1969e2cb7a2ce20e424484bfb3d
travis.hs
travis.hs
import Neil import System.Directory main = do -- grab ninja cmd "git clone https://github.com/martine/ninja" cmd "cd ninja && ./bootstrap.py" cmd "mkdir bin" cmd "cp ninja/ninja nin" setCurrentDirectory "ninja" retry 3 $ do -- time Ninja cmd "../nin -t clean" (nin...
import Neil import System.Directory main = do -- grab ninja cmd "git clone https://github.com/martine/ninja" cmd "cd ninja && ./bootstrap.py" cmd "mkdir bin" cmd "cp ninja/ninja nin" setCurrentDirectory "ninja" let ms x = show $ ceiling $ x * 1000 (ninjaVer, _) <- duration $ cmd "../n...
Add --version timing for Ninja and Shake
Add --version timing for Ninja and Shake
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
64e73c1524f3e6cabec7063232005766180abd16
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 Types/Primitives.
Define AST fragment for Types/Primitives.
Haskell
apache-2.0
DaMSL/K3,yliu120/K3,DaMSL/K3
c3bbee5b913b490e69e4ec879173700af6778924
src/Message/Markdown.hs
src/Message/Markdown.hs
{-# LANGUAGE OverloadedStrings #-} module Message.Markdown ( quote , italic , bold , codeblock , link ) where import Data.Monoid import Data.String (IsString) -- ---------------------------------------------- -- | Text as a codeblock codeblock :: (Monoid m, IsString m) =>...
{-# LANGUAGE OverloadedStrings #-} module Message.Markdown ( quote , italic , bold , codeblock , link ) where import Data.Monoid import Data.String (IsString) -- ---------------------------------------------- -- | Text as a codeblock codeblock :: (Monoid m, IsString m) =>...
Fix function which is unused atm
Fix function which is unused atm
Haskell
mit
UlfS/ghmm
f496f8bd60114524514a5737696acd54d41ca742
libraries/integer-simple/GHC/Integer/Type.hs
libraries/integer-simple/GHC/Integer/Type.hs
{-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Integer.Type -- Copyright : (c) Ian Lynagh 2007-2008 -- License : BSD3 -- -- Maintainer : igloo@earth.li -- Stability : internal -- Portability : non-portable (GHC ...
{-# LANGUAGE NoImplicitPrelude, CPP, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Integer.Type -- Copyright : (c) Ian Lynagh 2007-2008 -- License : BSD3 -- -- Maintainer : igloo@earth.li -- Stability : internal -- Portability : no...
Add extensions to LANGUAGE pragma
Add extensions to LANGUAGE pragma
Haskell
bsd-3-clause
siddhanathan/ghc,mcschroeder/ghc,urbanslug/ghc,gridaphobe/ghc,forked-upstream-packages-for-ghcjs/ghc,mcschroeder/ghc,ml9951/ghc,mcschroeder/ghc,acowley/ghc,oldmanmike/ghc,ml9951/ghc,sgillespie/ghc,shlevy/ghc,da-x/ghc,ezyang/ghc,sdiehl/ghc,oldmanmike/ghc,fmthoma/ghc,TomMD/ghc,ghc-android/ghc,fmthoma/ghc,sgillespie/ghc,G...
ddcfd4b94892534fd734a70b4e5acbab8638b899
src/Hoogle.hs
src/Hoogle.hs
{-# LANGUAGE DisambiguateRecordFields #-} -- Draft of Hoogle API, does not yet compile! module Hoogle( Query(..), parseQuery, ItemEx(..), Item(..), showItem, withSearch ) where import qualified Query as Q import qualified Input.Type as I import qualified General.Store as S import qualified Action.Sear...
-- Draft of Hoogle API, does not yet compile! module Hoogle( Query(..), parseQuery, ItemEx(..), Item(..), showItem, withSearch ) where import qualified Query as Q import qualified Input.Type as I import qualified General.Store as S import qualified Action.Search as S newtype Database = Database Stor...
Remove a redundant language extension
Remove a redundant language extension
Haskell
bsd-3-clause
ndmitchell/hoogle,ndmitchell/hoogle,ndmitchell/hoogle
b027ffec34186a7ad68f08e74cc8a0a98863e34e
src/PrettyJson.hs
src/PrettyJson.hs
-- |Pretty-print JSON as human-readable breadcrumbs. module PrettyJson where import Data.Aeson import Data.Aeson.Types import Data.ByteString.Lazy.Builder -- Remove Lazy when using newer bytestring lib import qualified Data.HashMap.Strict as H import Data.Monoid import Data.Text (Text) import Data.Text.Encoding import...
{-# LANGUAGE OverloadedStrings #-} -- |Pretty-print JSON as human-readable breadcrumbs. module PrettyJson where import Data.Aeson import Data.Aeson.Types import Data.ByteString.Lazy.Builder -- Remove Lazy when using newer bytestring lib import qualified Data.HashMap.Strict as H import Data.Monoid import Data.Text (Tex...
Use ByteStrings in JSON builder
Use ByteStrings in JSON builder
Haskell
agpl-3.0
prasos/stratum-tool,zouppen/stratum-tool
0a38650b067e4a8ed3ef20bb5579acb1b32a805c
src/Parser.hs
src/Parser.hs
module Parser ( extractBetween , extractAllAttrValues , trim ) where import Data.Text (pack, strip, unpack) import Text.Regex (matchRegex, mkRegex, mkRegexWithOpts, splitRegex) nonNull :: [String] -> [String] nonNull = filter (/= []) trim :: String -> String trim = unpack ....
module Parser ( extractBetween , extractAllAttrValues , trim ) where import Data.Text (pack, strip, unpack) import Text.Regex (matchRegex, mkRegex, mkRegexWithOpts, splitRegex) nonNull :: [String] -> [String] nonNull = filter (/= []) trim :: String -> String trim = unpack ....
Fix regular expression for parsing XML attribute values
Fix regular expression for parsing XML attribute values
Haskell
mit
guoguo12/aether
66b9d2c3021e882d03be240cb1566f9b9ea64716
haskell/greek-grammar/src/Data/Unicode/Decompose.hs
haskell/greek-grammar/src/Data/Unicode/Decompose.hs
module Data.Unicode.Decompose where import Data.Unicode.DecomposeChar decompose :: String -> String decompose = concatMap decomposeChar
module Data.Unicode.Decompose where import Data.Unicode.DecomposeChar decompose :: Foldable t => t Char -> String decompose = concatMap decomposeChar
Allow Foldable t for decompose domain.
Allow Foldable t for decompose domain.
Haskell
mit
scott-fleischman/greek-grammar,scott-fleischman/greek-grammar
769b1a0b7691749fb82cca0f3d27b8b794dd519e
test/integration/tests/443-specify-path/Main.hs
test/integration/tests/443-specify-path/Main.hs
import StackTest import System.Directory main :: IO () main = do -- install in relative path createDirectory "bin" stack ["--local-bin-path", "./bin", "install" , "happy"] doesExist "./bin/happy" -- Default install -- This seems to fail due to direcory being cleaned up, -- a manual test of the default s...
import StackTest import System.Directory import System.FilePath main :: IO () main = do -- install in relative path createDirectory "bin" stack ["--local-bin-path", "./bin", "install" , "happy"] doesExist "./bin/happy" -- Default install -- This seems to fail due to direcory being cleaned up, -- a manua...
Fix 443-specify-path integration test on OS X
Fix 443-specify-path integration test on OS X
Haskell
bsd-3-clause
supermario/stack,bollu/stack,anton-dessiatov/stack,fizruk/stack,vigoo/stack,narrative/stack,akhileshs/stack,rrnewton/stack,rvion/stack,luigy/stack,rvion/stack,agrafix/stack,narrative/stack,wolftune/stack,wolftune/stack,MaxGabriel/stack,MaxGabriel/stack,Blaisorblade/stack,rrnewton/stack,AndrewRademacher/stack,Heather/st...
7ace4a46c10c0a76f03b631d0d20694a9d75aead
src/Language/LanguageAst.hs
src/Language/LanguageAst.hs
module Language.LanguageAst ( Block(..), Element(..), Application(..), Loop(..), Assignment(..), Expression(..), Variable(..), Value(..), Identifier )where data Block = Block [Element] deriving (Eq, Show) data Element = ElLoop Loop | ElAssign Assignment ...
module Language.LanguageAst ( Block(..), Element(..), Application(..), Loop(..), Assignment(..), Expression(..), Variable(..), Value(..), Identifier ) where newtype Block = Block [Element] deriving (Eq, Show) data Element = ElLoop Loop | ElAssign Assignment ...
Change data types to newtypes
Change data types to newtypes
Haskell
bsd-3-clause
rumblesan/improviz,rumblesan/improviz
4d5bd44f267d3e645f05471c2565048683849f25
benchmarks/PSQ.hs
benchmarks/PSQ.hs
{-# LANGUAGE BangPatterns #-} module Main where import Criterion.Main import System.Event.PSQ (PSQ) import qualified System.Event.PSQ as Q main = defaultMain [ bench "insert10k/min" $ whnf (Q.findMin . ascFrom) n , bench "delete1k/min" $ whnf (Q.findMin . deleteEveryN (n `div` 1000) n) q ] where -- ...
{-# LANGUAGE BangPatterns #-} module Main where import Criterion.Main import System.Event.PSQ (PSQ) import qualified System.Event.PSQ as Q main = defaultMain [ bench "insert10k/min" $ whnf (Q.findMin . ascFrom) n , bench "delete1k/min" $ whnf (Q.findMin . deleteEveryN (n `div` 1000) n) q ] where -- ...
Make it easier to benchmark different priority types
Make it easier to benchmark different priority types
Haskell
bsd-2-clause
tibbe/event,tibbe/event,tibbe/event
f576b403acf18edfa2b5bbba417147202bd4d301
Helper/Auth.hs
Helper/Auth.hs
module Helper.Auth ( requireAuth_ , requireAuthId_ , module Yesod.Auth ) where import Import import Yesod.Auth import Data.Maybe (fromMaybe) import Control.Monad (liftM2) -- | Like @'requireAuth'@ except that it may respond -- @'notAuthenticated'@ instead of redirecting to login. requireAuth_ :: Han...
module Helper.Auth ( requireAuth_ , requireAuthId_ , module Yesod.Auth ) where import Import import Yesod.Auth -- | Like @'requireAuth'@ except that it may respond -- @'notAuthenticated'@ instead of redirecting to login. requireAuth_ :: Handler (Entity User) requireAuth_ = fromMaybeM notAuthenticate...
Replace liftM2 with custom fromMaybeM
Replace liftM2 with custom fromMaybeM fromMaybeM is functionally equivalent to liftM2 fromMaybe, but the latter form was always evaluating the first argument regardless of the second being Just or Nothing. This had the nasty effect of constantly responding 401 NotAuthorized.
Haskell
mit
thoughtbot/carnival,peterwang/carnival,vaporware/carnival
dce8c95a787c67cf9ccd2d48de21869857064fba
2437488/A.hs
2437488/A.hs
import Control.Applicative import Control.Monad import Data.Function import Data.List import Text.Printf main = do tests <- readLn forM_ [1..tests] $ \caseNum -> do [w,_n] <- words <$> getLine let n = read _n let ans = sum . map (succ . length . remaining) . filter valid . tails $ w where ...
import Control.Applicative import Control.Monad import Data.Function import Data.List import qualified Data.Set as Set import Text.Printf main = do tests <- readLn forM_ [1..tests] $ \caseNum -> do [w,_n] <- words <$> getLine let n = read _n let ans = sum . map (succ . length . remaining) . fi...
Use set instead of list for faster lookup
Use set instead of list for faster lookup
Haskell
mit
marknsikora/codejam,marknsikora/codejam
4a7376fe142ba5de49d0423ed7996490d8ac1985
test/tests/InfixDataDecl.hs
test/tests/InfixDataDecl.hs
-- SYNTAX TEST "source.haskell" "Infix data declarations" data A a b = ( T b c ( d e ) f ) `C` '[ A b, C, D [ e, f ] g ] -- ^^^^ keyword.other.data.haskell -- ^ keyword.operator.eq.haskell -- ^ ^ punctuation.paren.haskell -- ^ constant....
-- SYNTAX TEST "source.haskell" "Infix data declarations" data A a b = ( T b c ( d e ) f ) `C` '[ A b, C, D [ e, f ] g ] -- ^^^^ keyword.other.data.haskell -- ^ keyword.operator.eq.haskell -- ^ ^ punctuation.paren.haskell -- ^ constant....
Add extra test case for infix datacon highlighting
Add extra test case for infix datacon highlighting
Haskell
bsd-3-clause
JustusAdam/language-haskell,JustusAdam/language-haskell
571e73e3d2d1d5ff8e8f9da6f61836c1c60017da
src/Test/Hspec/QuickCheck.hs
src/Test/Hspec/QuickCheck.hs
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} module Test.Hspec.QuickCheck ( -- * Params modifyMaxSuccess , modifyMaxDiscardRatio , modifyMaxSize -- * Shortcuts , prop ) where import Data.CallStack import Test.Hspec import Test.QuickCheck import Test.Hsp...
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} module Test.Hspec.QuickCheck ( -- * Params modifyMaxSuccess , modifyMaxDiscardRatio , modifyMaxSize -- * Shortcuts , prop ) where import Test.Hspec import Test.QuickCheck import Test.Hspec.Core.QuickCheck -- | -- > pro...
Fix build for HUnit < 1.4
Fix build for HUnit < 1.4
Haskell
mit
hspec/hspec
54022c697496b268d85786c91d70f83d1e556174
src/Data/Cruncher/Request.hs
src/Data/Cruncher/Request.hs
{-# LANGUAGE OverloadedStrings, Trustworthy #-} -- | -- Maintainer : Ricky Elrod <ricky@elrod.me> -- Stability : probably somewhat stable -- -- Handles incoming requests (usually from our Yesod frontend, but could be -- from anywhere). module Data.Cruncher.Request (Request (..)) where import Control.Applicative im...
{-# LANGUAGE OverloadedStrings, Trustworthy #-} -- | -- Maintainer : Ricky Elrod <ricky@elrod.me> -- Stability : probably somewhat stable -- -- Handles incoming requests (usually from our Yesod frontend, but could be -- from anywhere). module Data.Cruncher.Request (Request (..)) where import Control.Applicative im...
Mark inputFiles and stdin as optional in FromJSON
Mark inputFiles and stdin as optional in FromJSON
Haskell
bsd-3-clause
eval-so/cruncher
0e98bc0417a6f25504dad5c8d224fb758a12c791
src/Client/Configuration/Macros.hs
src/Client/Configuration/Macros.hs
{-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where ...
{-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where ...
Allow single command in macro-commands
Allow single command in macro-commands
Haskell
isc
glguy/irc-core,dolio/irc-core,glguy/irc-core,glguy/irc-core,dolio/irc-core,dolio/irc-core
bc3bff6df2e8eb52e641dbd0bdf85e24a92a1514
testsuite/tests/RunTestTH.hs
testsuite/tests/RunTestTH.hs
{-# LANGUAGE TemplateHaskell #-} module Main where import Test.HUnit import Control.Monad.Trans import Shaker.TestTH import Test.QuickCheck import Shaker.Cabal.CabalInfoTest import Shaker.Action.CompileTest import Shaker.CliTest import Shaker.ListenerTest import Shaker.ParserTest import Shaker.RegexTest import Shaker...
{-# LANGUAGE TemplateHaskell #-} module Main where import Shaker.TestTH import Shaker.Cabal.CabalInfoTest import Shaker.Action.CompileTest import Shaker.CliTest import Shaker.ListenerTest import Shaker.ParserTest import Shaker.RegexTest import Shaker.IoTest import Shaker.ReflexiviteTest import Shaker.SourceHelperTest...
Switch test execution to test-framework
Switch test execution to test-framework
Haskell
isc
bonnefoa/Shaker
def8433b667769f6487210b628c97ba6b6c6b189
src/Main.hs
src/Main.hs
module Main(main) where import Language.Haskell.HLint3 import Control.Monad import System.Environment import System.Exit main :: IO () main = do args <- getArgs errs <- hlint args unless (null errs) $ exitWith $ ExitFailure 1
module Main(main) where import Language.Haskell.HLint import Control.Monad import System.Environment import System.Exit main :: IO () main = do args <- getArgs errs <- hlint args unless (null errs) $ exitWith $ ExitFailure 1
Fix up the main module
Fix up the main module
Haskell
bsd-3-clause
ndmitchell/hlint,ndmitchell/hlint
3ad8ada0ea2982ba7974e381f07e84c35c9559af
html-test/src/AdvanceTypes.hs
html-test/src/AdvanceTypes.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} module AdvanceTypes where data Pattern :: [*] -> * where Nil :: Pattern '[] Cons :: Maybe h -> Pattern t -> Pattern (h ': t)
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} module AdvanceTypes where data RevList a = RNil | RevList a :> a data Pattern :: [*] -> * where Nil :: Pattern '[] Cons :: Maybe h -> Pattern t -> Pattern (h ': t) -- Unlike (:), (:>) does not have...
Extend advanced types test case with other examples.
Extend advanced types test case with other examples.
Haskell
bsd-2-clause
lamefun/haddock,Helkafen/haddock,idontgetoutmuch/haddock,Fuuzetsu/haddock,niteria/haddock,randen/haddock,idontgetoutmuch/haddock,idontgetoutmuch/haddock,beni55/haddock,niteria/haddock,sboosali/haddock,Helkafen/haddock,beni55/haddock,randen/haddock,haskell/haddock,randen/haddock,beni55/haddock,haskell/haddock,Helkafen/h...
222b924b230d8f1ca260c756a0708f7b63575bf8
src/InputTypes.hs
src/InputTypes.hs
{-# LANGUAGE OverloadedStrings #-} module InputTypes where import qualified Data.Aeson as A import Control.Applicative ((<$>), (<*>)) import Control.Monad (mzero, when) data Input = Input { iId :: Int , iUnits :: [Unit] , iWidth :: I...
{-# LANGUAGE OverloadedStrings #-} module InputTypes where import qualified Data.Aeson as A import Control.Applicative ((<$>), (<*>)) import Control.Monad (mzero, when) data Input = Input { iId :: Int , iUnits :: [Unit] , iWidth :: I...
Add transformation to more pleasant coordinates system
Add transformation to more pleasant coordinates system
Haskell
bsd-3-clause
mietek/icfp-contest-2015,blax/icfp-contest-2015
a5754f62e0b678ffb377f0f29e607e58f0607846
src/Events/ChannelScroll.hs
src/Events/ChannelScroll.hs
module Events.ChannelScroll where import Prelude () import Prelude.Compat import Brick import qualified Graphics.Vty as Vty import Lens.Micro.Platform import Types import State channelScrollKeybindings :: [Keybinding] channelScrollKeybindings = [ KB "Load more messages in the current channel" (Vty.EvKey (Vty....
module Events.ChannelScroll where import Prelude () import Prelude.Compat import Brick import qualified Graphics.Vty as Vty import Lens.Micro.Platform import Types import State channelScrollKeybindings :: [Keybinding] channelScrollKeybindings = [ KB "Load more messages in the current channel" (Vty.EvKey (Vty....
Add keybinding to switch to URL open mode while scrolling
Add keybinding to switch to URL open mode while scrolling
Haskell
bsd-3-clause
matterhorn-chat/matterhorn,aisamanra/matterhorn
4f2c4973cb6f5074881bb056e01e2fa8c12e937c
Handler/Feed.hs
Handler/Feed.hs
module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments com...
module Handler.Feed where import Import import Model.UserComment import Prelude (head) import Control.Monad (when) import Text.Blaze.Html (toMarkup) import Yesod.RssFeed getFeedR :: Handler RepRss getFeedR = do comments <- runDB findRecentUserComments when (null comments) notFound feedFromComments com...
Include author in RSS feed item
Include author in RSS feed item Note: will show blank values for existing comments
Haskell
mit
thoughtbot/carnival,vaporware/carnival,peterwang/carnival
9ca9712b31dc4a59799d573fdaf23a05b850d738
testsuite/tests/ghc-regress/th/TH_genExLib.hs
testsuite/tests/ghc-regress/th/TH_genExLib.hs
{-# OPTIONS -fglasgow-exts #-} module TH_genExLib where import Language.Haskell.TH genAny :: Q Info -> Q [Dec] genAny decl = do { d <- decl ; case d of ClassI (ClassD _ name _ _ decls) -> return [genAnyClass name decls] _ -> error "genAny can be applied to classes only" } genAnyClass :: Name -> [Dec...
{-# OPTIONS -fglasgow-exts #-} module TH_genExLib where import Language.Haskell.TH genAny :: Q Info -> Q [Dec] genAny decl = do { d <- decl ; case d of ClassI (ClassD _ name _ _ decls) _ -> return [genAnyClass name decls] _ -> error "genAny can be applied to classes only" } genAnyClass :: Name -> [D...
Update for TH instance reification
Update for TH instance reification
Haskell
bsd-3-clause
christiaanb/ghc,sgillespie/ghc,nkaretnikov/ghc,tjakway/ghcjvm,forked-upstream-packages-for-ghcjs/ghc,wxwxwwxxx/ghc,spacekitteh/smcghc,anton-dessiatov/ghc,mcschroeder/ghc,holzensp/ghc,ml9951/ghc,acowley/ghc,GaloisInc/halvm-ghc,olsner/ghc,mcschroeder/ghc,green-haskell/ghc,nathyong/microghc-ghc,snoyberg/ghc,forked-upstrea...
05f0bc51d7f0b47975fde9041b4f5d3a04b0f9c4
test/SpecHelper.hs
test/SpecHelper.hs
module SpecHelper ( module Test.Hspec , module Game.AIPlayer , module Game.Context , module Game.Player , module Game.Board , newSpace , newBlankBoard ) where import Test.Hspec import Game.AIPlayer import Game.Context import Game.Player import Game.Board newSpace :: (Int, Int) -> Move -> Space newSpac...
module SpecHelper ( module Test.Hspec , module Game.AIPlayer , module Game.Context , module Game.Player , module Game.Board , newSpace , newBlankBoard ) where import Test.Hspec import Game.AIPlayer import Game.Context import Game.Player import Game.Board newSpace :: Location -> Move -> Space newSpace ...
Add Location type to newSpace annotation
Add Location type to newSpace annotation
Haskell
bsd-3-clause
rewinfrey/haskell-tic-tac-toe,rewinfrey/haskell-tic-tac-toe
6fe49fbccca19f3631dada419df2e6136f17bd6b
src/git-vogue-cabal.hs
src/git-vogue-cabal.hs
-- | Description: Check with "cabal check". module Main where import Control.Applicative import Data.Monoid import Options.Applicative import System.Exit import System.Process data Command -- | Check the project for problems. = CmdCheck -- | Fix problems i...
-- | Description: Check with "cabal check". module Main where import Control.Applicative import Data.Monoid import Options.Applicative import System.Exit import System.Process data Command -- | Check the project for problems. = CmdCheck -- | Fix problems i...
Handle "cabal test" exit code correctly
Handle "cabal test" exit code correctly Rather than letting the default exception go through when the process exits with non-zero status, spawn and wait for the process then exit with the appropriate status code.
Haskell
bsd-3-clause
anchor/git-vogue,olorin/git-vogue