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
435f43ae71d546fad6f3bb22c8bd027ac1abc15a
Crawl/BananaUtils.hs
Crawl/BananaUtils.hs
module Crawl.BananaUtils ( filterBy, randomize ) where import System.Random (mkStdGen, Random, randomR) import qualified Reactive.Banana as R filterBy :: (a -> Maybe b) -> R.Event t a -> R.Event t b filterBy f = R.filterJust . fmap f randomize :: (Random a) => (a, a) -> R.Event t b -> R.Event t a randomize ra...
module Crawl.BananaUtils ( filterBy, randomize ) where import System.Random (mkStdGen, Random, randomR) import qualified Reactive.Banana as R filterBy :: (a -> Maybe b) -> R.Event t a -> R.Event t b filterBy f = R.filterJust . fmap f randomize :: (Random a) => (a, a) -> R.Event t b -> R.Event t a randomize ra...
Fix a small leak in randomize
Fix a small leak in randomize
Haskell
bsd-3-clause
rwbarton/rw
2eb2b6edb2f01530b66d8b82ccbe9a98b4ed6850
src/Formura/CommandLineOption.hs
src/Formura/CommandLineOption.hs
{-# LANGUAGE ConstraintKinds, ImplicitParams, TemplateHaskell #-} module Formura.CommandLineOption where import Control.Lens hiding (argument) import Options.Applicative type WithCommandLineOption = ?commandLineOption :: CommandLineOption data CommandLineOption = CommandLineOption { _inputFilenames :: [FilePa...
{-# LANGUAGE ConstraintKinds, ImplicitParams, TemplateHaskell #-} module Formura.CommandLineOption where import Control.Lens hiding (argument) import Options.Applicative type WithCommandLineOption = ?commandLineOption :: CommandLineOption data CommandLineOption = CommandLineOption { _inputFilenames :: [FilePa...
Add makefile generation as an option
Add makefile generation as an option
Haskell
mit
nushio3/formura,nushio3/formura,nushio3/formura,nushio3/formura,nushio3/formura,nushio3/formura
d06a2b502e7909dff517a7c825e772b493bade24
haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
{-# LANGUAGE RankNTypes #-} module Haddock.Backends.Hyperlinker.Ast where import qualified GHC import Data.Data import Control.Applicative import Haddock.Backends.Hyperlinker.Parser data RichToken = RichToken { rtkToken :: Token , rtkName :: Maybe GHC.Name } enrich :: GHC.RenamedSource -> [Token] -> [R...
{-# LANGUAGE RankNTypes #-} module Haddock.Backends.Hyperlinker.Ast where import Haddock.Backends.Hyperlinker.Parser import qualified GHC import Control.Applicative import Data.Data import Data.Maybe data RichToken = RichToken { rtkToken :: Token , rtkName :: Maybe GHC.Name } enrich :: GHC.RenamedSour...
Create simple mechanism for associating tokens with AST names.
Create simple mechanism for associating tokens with AST names.
Haskell
bsd-2-clause
lamefun/haddock,sboosali/haddock,idontgetoutmuch/haddock,randen/haddock,randen/haddock,Fuuzetsu/haddock,Helkafen/haddock,lamefun/haddock,Fuuzetsu/haddock,Helkafen/haddock,idontgetoutmuch/haddock,mrhania/haddock,niteria/haddock,beni55/haddock,beni55/haddock,Acidburn0zzz/haddock,mrhania/haddock,haskell/haddock,randen/had...
7621cdb380bb616308847e5bccea7d9e7e7ee2e8
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 == "arithmoi" = [disable "llvm"] | name == "accelerate-exam...
module Cabal2Nix.Flags ( configureCabalFlags ) where import Distribution.Package import Distribution.PackageDescription configureCabalFlags :: PackageIdentifier -> FlagAssignment configureCabalFlags (PackageIdentifier (PackageName name) _) | name == "arithmoi" = [disable "llvm"] | name == "accelerate-exam...
Enable https and man pages flags for Pandoc.
Enable https and man pages flags for Pandoc.
Haskell
bsd-3-clause
Fuuzetsu/cabal2nix,gridaphobe/cabal2nix,dmalikov/cabal2nix,psibi/cabal2nix,spencerjanssen/cabal2nix,jb55/cabal2nix,bennofs/cabal2nix
1cb38848862445ce11c0f33de2a03a13ba5263a3
haskell/raindrops/Raindrops.hs
haskell/raindrops/Raindrops.hs
module Raindrops ( convert ) where convert :: Int -> String convert n = if null drops then show n else drops where divisibleBy d = n `rem` d == 0 drops = concat [ if divisibleBy 3 then "Pling" else "" , if divisibleBy 5 then "Plang" else "" , if divisibleBy 7 then "Plong" else "" ...
module Raindrops ( convert ) where convert :: Int -> String convert n | null drops = show n | otherwise = drops where divisibleBy d = n `rem` d == 0 drops = concat [ if divisibleBy 3 then "Pling" else "" , if divisibleBy 5 then "Plang" else "" , if divisi...
Use guards instead of conditional
Use guards instead of conditional
Haskell
mit
tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions
f8475c04be6d547e975cc05b6c8517a71606df8b
fol.hs
fol.hs
module Main where import FOL.Optimize.Optimize main :: IO () main = interact optimize
module Main where import FOL.Optimize.Optimize main :: IO () main = interact optimize >> putChar '\n'
Print newline at the end of the output.
Print newline at the end of the output.
Haskell
agpl-3.0
axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language
92b310cf014630c7a07cee5705bb6004317b3412
tests/PutSpec.hs
tests/PutSpec.hs
{-# LANGUAGE OverloadedStrings #-} module PutSpec (spec) where import Data.Aeson (Value (..)) import Test.Hspec (Spec, describe, it, shouldBe) import qualified Data.HashMap.Strict as HashMap import MainLoop (Put (..), handlePut) spec :: Spec spec = do describe "MainLoop.handlePut" $ do it "creates an object...
{-# LANGUAGE OverloadedStrings #-} module PutSpec (spec) where import Data.Aeson (Value (..)) import Test.Hspec (Spec, describe, it, shouldBe) import qualified Data.HashMap.Strict as HashMap import MainLoop (Put (..), handlePut) spec :: Spec spec = do describe "MainLoop.handlePut" $ do it "creates an object...
Add more tests for handlePut
Add more tests for handlePut
Haskell
bsd-3-clause
channable/icepeak,channable/icepeak,channable/icepeak
3e637a764c81b6f8dd8af988bb6b1b06b016d22a
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 = "#000" , focusedBorderColor = "#4488FF" , workspaces = myWorkSpaces , keys = \c -> myKe...
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...
Fix k and l shortcuts
Fix k and l shortcuts
Haskell
mit
j-a-m-l/.dot,j-a-m-l/.dot,noijd/.dot,noijd/.dot,noijd/.dot,j-a-m-l/.dot,j-a-m-l/.dot,noijd/.dot
46f3719f6be6acdc8ce5c57c305bea562d806cfc
project_template/hint/src/Main.hs
project_template/hint/src/Main.hs
{-# LANGUAGE CPP, TemplateHaskell #-} module Main where import Data.Monoid (mappend, mconcat) import Config (getConfig, cleanupConfig) import Site (site) import Snap.Http.Server import Snap.Http.Server.Config #ifdef PRODUCTION import Snap.Loader.Static (loadSnapTH) #else import Snap.Loader.Hint (loadSnapTH) #endif ...
{-# LANGUAGE CPP, TemplateHaskell #-} module Main where import Data.Monoid (mappend, mempty) import Config (getConfig, cleanupConfig) import Site (site) import Snap.Http.Server import Snap.Http.Server.Config #ifdef PRODUCTION import Snap.Loader.Static (loadSnapTH) #else import Snap.Loader.Hint (loadSnapTH) #endif ...
Update to work with new version of Snap.Http.Server.Config
Update to work with new version of Snap.Http.Server.Config
Haskell
bsd-3-clause
sopvop/snap,bitemyapp/snap,snapframework/snap,23Skidoo/snap
a7b0c98702e5f1b8c19b9b17698822ebb08a1178
src/GHCJS/Three/Scene.hs
src/GHCJS/Three/Scene.hs
{-# LANGUAGE JavaScriptFFI, GeneralizedNewtypeDeriving #-} module GHCJS.Three.Scene ( Scene(..), mkScene ) where import GHCJS.Types import GHCJS.Three.Monad import GHCJS.Three.Object3D -- | scene definition newtype Scene = Scene { sceneObject3D :: Object3D } deriving (ThreeJSRef, IsObject3D) foreign import j...
{-# LANGUAGE JavaScriptFFI, GeneralizedNewtypeDeriving #-} module GHCJS.Three.Scene ( Scene(..), mkScene ) where import GHCJS.Types import GHCJS.Three.Monad import GHCJS.Three.Object3D -- | scene definition newtype Scene = Scene { sceneObject3D :: Object3D } deriving (ThreeJSRef, IsObject3D) foreign import j...
Fix a typo bug in the js code
Fix a typo bug in the js code
Haskell
bsd-3-clause
manyoo/ghcjs-three
38f7320cb1dda2952002bc09a81f00ca372eeab4
veilig-core/app/Interpreter.hs
veilig-core/app/Interpreter.hs
{-# LANGUAGE OverloadedStrings #-} module Interpreter ( notebookInterpreter ) where import Types import Control.Monad.Trans import Language.Haskell.Interpreter import Control.Monad import Data.Text (Text) import qualified Data.Text as T import Data.String.Conversions isModule (' ' : xs) = isModule xs isModule ('m...
{-# LANGUAGE OverloadedStrings #-} module Interpreter ( notebookInterpreter ) where import Types import Control.Monad.Trans import Language.Haskell.Interpreter import Control.Monad import Data.Text (Text) import qualified Data.Text as T import Data.String.Conversions isModule (' ' : xs) = isModule xs isModule ('m...
Make all code blocks have an implicit do
Make all code blocks have an implicit do
Haskell
apache-2.0
theam/haskell-do,J2RGEZ/haskell-do,theam/haskell-do
b80271622b081ee0bbe074859908861cf9d83adf
Setup.hs
Setup.hs
import Distribution.Simple import System.Process main = do hooks <- buildJS simpleUserHooks defaultMainWithHooks hooks buildJS hooks = do let originalpreBuild = preBuild hooks return $ hooks { preBuild = \args flags -> do let npmbuild = proc "sh" ["./scripts/buildjs.sh"] (_, _, _, buildHandl...
import Distribution.Simple import System.Process main = do hooks <- buildJS simpleUserHooks defaultMainWithHooks hooks buildJS hooks = do let originalPostBuild = postBuild hooks return $ hooks { postBuild = \args flags pkgDesc localBuildInfo -> do let npmbuild = proc "sh" ["./scripts/buildjs.sh"] ...
Switch to post build for JS build (speeds up build cycle)
Switch to post build for JS build (speeds up build cycle)
Haskell
bsd-3-clause
aelve/guide,aelve/guide,aelve/guide,aelve/guide,aelve/hslibs
95455f06fc6434b1f322dc642b9cbc4ee55821fb
2016/Haskell/AdventOfCode/src/Day07.hs
2016/Haskell/AdventOfCode/src/Day07.hs
module Day07 where import Data.List.Split (splitOneOf) import Text.Regex.PCRE transformInput :: String -> [[(Integer, String)]] transformInput = map (zip [(1 :: Integer)..] . splitOneOf "[]") . lines outers :: [(Integer, String)] -> [String] outers = map snd . filter (odd . fst) inners :: [(Inte...
module Day07 where import Data.List.Split (splitOneOf) import Text.Regex.PCRE transformInput :: String -> [[(Integer, String)]] transformInput = map (zip [(1 :: Integer)..] . splitOneOf "[]") . lines outers :: [(Integer, String)] -> [String] outers = map snd . filter (odd . fst) inners :: [(Inte...
Correct terminology used in day07 solution
Correct terminology used in day07 solution
Haskell
mit
justanotherdot/advent-linguist,justanotherdot/advent-linguist,justanotherdot/advent-linguist
9a8af91465b85acca601573ddf2552b118cdc6b1
Nero/Param.hs
Nero/Param.hs
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} module Nero.Param ( MultiMap , Param(..) , encodeMultiMap ) where import Data.Monoid ((<>), Monoid, mappend, mempty) import Data.ByteString.Lazy (ByteString) import Data.Text.Lazy (Text, intercalate) import Data.Map (M...
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} module Nero.Param ( MultiMap , Param(..) , encodeMultiMap ) where import Data.Monoid (Monoid, mappend, mempty) import Data.ByteString.Lazy (ByteString) import Data.Text.Lazy (Text, intercalate) import Data.Map (Map) im...
Fix `Monoid` instance for `MultiMap`
Fix `Monoid` instance for `MultiMap`
Haskell
bsd-3-clause
plutonbrb/nero
32a3d6acc2317613e6cee110408992ea7c819827
src/Technique.hs
src/Technique.hs
-- -- Procedures -- -- Copyright © 2012-2013 Operational Dynamics Consulting, Pty Ltd -- -- The code in this file, and the program it is a part of, is made available -- to you by its authors as open source software: you can redistribute it -- and/or modify it under the terms of the GNU General Public License version --...
-- -- Procedures -- -- Copyright © 2012-2013 Operational Dynamics Consulting, Pty Ltd -- -- The code in this file, and the program it is a part of, is made available -- to you by its authors as open source software: you can redistribute it -- and/or modify it under the terms of the GNU General Public License version --...
Add configuration parameters to web server
Add configuration parameters to web server
Haskell
mit
oprdyn/technique,oprdyn/technique
f586337c9ce18f68f58a0f46a06a66703f5202b0
src/Ecumenical.hs
src/Ecumenical.hs
{-# 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 ...
{-# 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 ...
Make mock instance of MonadDB actually query the reader
Make mock instance of MonadDB actually query the reader
Haskell
bsd-3-clause
tripped/hlog
1b0fbfe078e1c014b5a4de2bf1ed30c3fb509c77
examples/Tiny.hs
examples/Tiny.hs
{-# LANGUAGE ScopedTypeVariables #-} import Criterion.Main import Control.Parallel import qualified Data.IntMap as I import Data.List (foldl') import Criterion.Config import qualified Criterion.MultiMap as M myConfig = defaultConfig { -- Always display an 800x600 window. cfgPlot = M.singleto...
{-# LANGUAGE ScopedTypeVariables #-} import Criterion.Main import Control.Parallel import qualified Data.IntMap as I import Data.List (foldl') import Criterion.Config import qualified Criterion.MultiMap as M myConfig = defaultConfig { -- Always display an 800x600 window. cfgPlot = M.singleto...
Add a very fast test case.
Add a very fast test case. --HG-- extra : convert_revision : ce97a4373b5e150eee4617b6934363a338adea82
Haskell
bsd-2-clause
bgamari/criterion,osa1/criterion,iu-parfunc/criterion,bos/criterion,bos/criterion,rrnewton/criterion,paulolieuthier/criterion,iu-parfunc/criterion,iu-parfunc/criterion,bgamari/criterion,bos/criterion,paulolieuthier/criterion,rrnewton/criterion,paulolieuthier/criterion,rrnewton/criterion,osa1/criterion,bgamari/criterion
a534208b7f6f6679bd0e3e1f71beca44ce017f56
src/PostgRESTWS/Database.hs
src/PostgRESTWS/Database.hs
module PostgRESTWS.Database ( notify , onNotification ) where import Protolude import Hasql.Pool (Pool, UsageError, use) import Hasql.Session (sql) import qualified Database.PostgreSQL.LibPQ as PQ import Data.Either.Combinators import PostgRESTWS.Types notify :: Pool -> ByteString -> ByteString -> IO (Eit...
module PostgRESTWS.Database ( notify , onNotification ) where import Protolude import Hasql.Pool (Pool, UsageError, use) import Hasql.Session (sql) import qualified Database.PostgreSQL.LibPQ as PQ import Data.Either.Combinators import PostgRESTWS.Types notify :: Pool -> ByteString -> ByteString -> IO (Eit...
Split function that open listening chanel from function that waits and acts on notification
Split function that open listening chanel from function that waits and acts on notification
Haskell
mit
diogob/postgrest-ws,diogob/postgrest-ws,diogob/postgrest-ws
bba89541729c4da920320f93dbcb1038a8bbfe9a
src/System/Taffybar/Widget/Decorators.hs
src/System/Taffybar/Widget/Decorators.hs
{-# LANGUAGE OverloadedStrings #-} module System.Taffybar.Widget.Decorators where import Control.Monad.IO.Class import qualified GI.Gtk as Gtk import System.Taffybar.Widget.Util -- | Wrap a widget with two container boxes. The inner box will have the class -- "InnerPad", and the outer box will hav...
{-# LANGUAGE OverloadedStrings #-} module System.Taffybar.Widget.Decorators where import Control.Monad.IO.Class import qualified GI.Gtk as Gtk import System.Taffybar.Widget.Util -- | Wrap a widget with two container boxes. The inner box will have the class -- "inner-pad", and the outer box will ha...
Fix class names in documentation of buildPadBox
Fix class names in documentation of buildPadBox
Haskell
bsd-3-clause
teleshoes/taffybar
4ca7ec13775c7da1bcf0e0ad0d79dd9e0c53736e
src/NGramCrackers/ParagraphParsers.hs
src/NGramCrackers/ParagraphParsers.hs
module NGramCrackers.ParagraphParsers ( parseParagraph , parseMultiPara , flattenEither ) where import Text.ParserCombinators.Parsec import Data.Either.Unwrap (mapRight) import Data.List (concat, unwords) {- Elementary parser combinataors. -} document = sepBy paragraph eop paragraph = sepBy sentence eos sentence...
module NGramCrackers.ParagraphParsers ( parseParagraph , parseMultiPara , flattenEither ) where import Text.ParserCombinators.Parsec import Data.Either.Unwrap (mapRight) import Data.List (concat, unwords) {- Elementary parser combinataors. -} document = sepBy paragraph eop paragraph = sepBy sentence eos sentence...
Remove old, extraneous development code
Remove old, extraneous development code
Haskell
agpl-3.0
R-Morgan/NGramCrackers
6b0f7da5226797da6f9a958b0aab288e3cacc214
tests/SubscriptionTreeSpec.hs
tests/SubscriptionTreeSpec.hs
{-# LANGUAGE OverloadedStrings #-} module SubscriptionTreeSpec (spec) where import Data.Maybe (fromJust) import Test.Hspec (Spec, describe, it, shouldBe) import Subscription (SubscriptionTree (..), empty, subscribe) import qualified Data.UUID as UUID import qualified Data.HashMap.Strict as HM spec :: Spec spec = do ...
{-# LANGUAGE OverloadedStrings #-} module SubscriptionTreeSpec (spec) where import Data.Maybe (fromJust) import Test.Hspec (Spec, describe, it, shouldBe) import Subscription (SubscriptionTree (..), empty, subscribe) import qualified Data.UUID as UUID import qualified Data.HashMap.Strict as HM spec :: Spec spec = do ...
Test subscribing to a channel
Test subscribing to a channel Why is it so hard for humans to type properly nested trees??
Haskell
bsd-3-clause
channable/icepeak,channable/icepeak,channable/icepeak
c16f296ee1c4006987f06396c7ddf0dee1a27893
project_template/barebones/src/Main.hs
project_template/barebones/src/Main.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative import Snap.Core import Snap.Util.FileServe import Snap.Http.Server main :: IO () main = quickHttpServe $ ifTop (writeBS "hello world") <|> route [ ("foo", writeBS "bar") , ("echo/...
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative import Snap.Core import Snap.Util.FileServe import Snap.Http.Server main :: IO () main = quickHttpServe site site :: Snap () site = ifTop (writeBS "hello world") <|> route [ ("foo", writeBS...
Improve structure of the barebones template.
Improve structure of the barebones template.
Haskell
bsd-3-clause
sopvop/snap,bitemyapp/snap,snapframework/snap,23Skidoo/snap
6a749b6689ab40e5388f73118e74ae245a01b66e
KML.hs
KML.hs
{-# OPTIONS_GHC -Wall -fno-warn-missing-signatures #-} module KML ( tracksToKML , netLinkKML , Track(..) ) where import Text.XML.Light data Track = Track { name :: String , desc :: String , coord :: [(Double, Double)] } deriving Show tracksToKML :: [Track] -> String tracksToKML = show...
{-# OPTIONS_GHC -Wall -fno-warn-missing-signatures #-} module KML ( tracksToKML , netLinkKML , Track(..) ) where import Text.XML.Light import Strive.Aliases (Latitude, Longitude) data Track = Track { name :: String , desc :: String , coord :: [(Latitude, Longitude)] } deriving Show tr...
Use Latitude, Longitude instead of Doubles
Use Latitude, Longitude instead of Doubles
Haskell
bsd-3-clause
liskin/strava-segments-kml
8424edf271387e66ccff5a3f5393613ced4002f2
library/Data/CapNProto/Errors.hs
library/Data/CapNProto/Errors.hs
{-| Module: Data.CapNProto.Errors Description: Exception types used by haskell-capnp -} module Data.CapNProto.Errors ( Error(..) ) where import Control.Monad.Catch (Exception) data Error -- | A @BoundsError@ is an exception indicating an attempt -- to access an illegal index @index@ within a sequenc...
{-| Module: Data.CapNProto.Errors Description: Exception types used by haskell-capnp -} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Data.CapNProto.Errors ( Error(..) , ThrowError(..) ) where import Control.Monad.Catch (Exception, MonadThrow(throwM)) -- | Similar Mo...
Add our own error type class.
Add our own error type class. Another part of moving towards being able to do reading in parallel; we don't want the @throwM e >> x == throwM e@ constraint.
Haskell
mit
zenhack/haskell-capnp
812de84edc212fd40485903a5abf4d764828032c
src/Hi/Template.hs
src/Hi/Template.hs
module Hi.Template ( withTemplatesFromRepo , untemplate ) where import Hi.Directory (inTemporaryDirectory) import Data.List.Split (splitOn) import System.Exit (ExitCode) import System.FilePath.Glob (compile, globDir1) import System.Pr...
module Hi.Template ( withTemplatesFromRepo , untemplate ) where import Hi.Directory (inTemporaryDirectory) import Data.List.Split (splitOn) import System.Exit (ExitCode) import System.FilePath.Glob (compile, globDir1) import System.Pr...
Comment a inappropriate error handling
Comment a inappropriate error handling
Haskell
bsd-3-clause
jonathankochems/hi
a8ea524634d870e75c3dc13bc96d174b064849ae
src/Rules/Clean.hs
src/Rules/Clean.hs
module Rules.Clean (cleanRules) where import Base import Package import Rules.Generate import Settings.Packages import Settings.Paths import Settings.User import Stage cleanRules :: Rules () cleanRules = do "clean" ~> do putBuild $ "| Remove files in " ++ buildRootPath ++ "..." removeFilesAfter bu...
module Rules.Clean (cleanRules) where import Base import Package import Rules.Generate import Settings.Packages import Settings.Paths import Settings.User import Stage cleanRules :: Rules () cleanRules = do "clean" ~> do putBuild $ "| Remove files in " ++ buildRootPath ++ "..." liftIO $ removeFile...
Use removeFiles instead of removeFilesAfter.
Use removeFiles instead of removeFilesAfter. See #131.
Haskell
bsd-3-clause
sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,bgamari/shaking-up-ghc,sdiehl/ghc,snowleopard/shaking-up-ghc,izgzhen/hadrian,sdiehl/ghc,snowleopard/hadrian
ba9d579e260f4ef2c6c5ce37a5b786e28d5780b9
grin/src/Lens/Micro/Extra.hs
grin/src/Lens/Micro/Extra.hs
{-# LANGUAGE TypeFamilies #-} module Lens.Micro.Extra where import Lens.Micro.Internal import Lens.Micro.Platform import Data.Vector as V type instance Index (Vector a) = Int type instance IxValue (Vector a) = a instance At (Vector a) where at k = lens (V.!? k) (\v -> maybe v (\a -> v V.// [(k, a)]))
{-# LANGUAGE TypeFamilies, RankNTypes #-} module Lens.Micro.Extra where import Lens.Micro.Internal import Lens.Micro.Platform import Data.Vector as V import Data.Functor.Infix ((<$$>)) import Data.Monoid (Any(..)) type instance Index (Vector a) = Int type instance IxValue (Vector a) = a instance At (Vector a) whe...
Add missing combinator from Lens.
Add missing combinator from Lens.
Haskell
bsd-3-clause
andorp/grin,andorp/grin
8dcf226b16af018a438d8a675404bd8f99451806
Entity/Bound.hs
Entity/Bound.hs
module Entity.Bound where import qualified GameData.Entity as E import qualified Gamgine.Math.BoxTree as BT bound :: E.Entity -> E.Bound bound E.Player {E.playerBound = bound} = bound bound E.Platform {E.platformBound = bound} = BT.Leaf bound E.Whatever bound E.Star {E.starBound = bound} = BT.Leaf bound E.Whatever
module Entity.Bound where import qualified Data.List as L import qualified GameData.Entity as E import qualified GameData.Animation as A import qualified Gamgine.Math.BoxTree as BT import qualified Gamgine.Math.Box as B bound :: E.Entity -> E.Bound bound E.Player {E.playerPosition = pos, E.playerBound = bound} = b...
Fix bound function to consider the position/path
Fix bound function to consider the position/path
Haskell
bsd-3-clause
dan-t/layers
4f1850f5cd1ef49a49119166622c6c420ea54bbe
hackerrank/DiagonalDifference.hs
hackerrank/DiagonalDifference.hs
-- https://www.hackerrank.com/challenges/diagonal-difference/problem import Control.Monad(replicateM) import Data.List.Split(splitOn) getIntSquareMatrix :: Int -> IO([[Int]]) getIntSquareMatrix rows = do lines <- replicateM rows getLine let intMatrix = (map . map) read $ map words lines return intMatrix getDiag...
-- https://www.hackerrank.com/challenges/diagonal-difference/problem import Control.Monad(replicateM) import Data.List.Split(splitOn) getIntSquareMatrix :: Int -> IO([[Int]]) getIntSquareMatrix rows = do lines <- replicateM rows getLine let intMatrix = (map . map) read $ map words lines return intMatrix getDiag...
Replace 'foldr (+)' by 'sum'
Replace 'foldr (+)' by 'sum'
Haskell
mit
julianespinel/training,julianespinel/training,julianespinel/trainning,julianespinel/training,julianespinel/training,julianespinel/trainning
c6e0bcdcc3912cfc5f3c07f6012e597d0e914339
src/Action/Test.hs
src/Action/Test.hs
{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-} module Action.Test(testMain) where import Data.Monoid import Query import Action.CmdLine testMain :: CmdLine -> IO () testMain Test{} = do testQuery putStrLn "" testQuery :: IO () testQuery = do let a ===...
{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-} module Action.Test(testMain) where import Data.Monoid import Query import Action.CmdLine import Language.Haskell.Exts testMain :: CmdLine -> IO () testMain Test{} = do testQuery putStrLn "" testQuery :: IO ()...
Add the Hoogle query parser test suite
Add the Hoogle query parser test suite
Haskell
bsd-3-clause
ndmitchell/hoogle,BartAdv/hoogle,wolftune/hoogle,BartAdv/hoogle,wolftune/hoogle,wolftune/hoogle,ndmitchell/hoogle,ndmitchell/hogle-dead,wolftune/hoogle,ndmitchell/hoogle,BartAdv/hoogle,BartAdv/hoogle,ndmitchell/hogle-dead
ae539e20b4c35532da6edaa072714f05fc3a54fb
src/Hans/Timers.hs
src/Hans/Timers.hs
module Hans.Timers ( Milliseconds , Timer() , delay , delay_ , cancel ) where import Control.Concurrent (forkIO,ThreadId,threadDelay,killThread) type Milliseconds = Int newtype Timer = Timer ThreadId deriving (Show,Eq) -- | Delay an action, giving back a handle to allow the timer to b...
module Hans.Timers ( Milliseconds , Timer() , delay , delay_ , cancel ) where import Control.Concurrent (forkIO,ThreadId,threadDelay,killThread) type Milliseconds = Int newtype Timer = Timer ThreadId deriving (Show,Eq) -- | Delay an action, giving back a handle to allow the timer to b...
Fix a precision bug with the new timers
Fix a precision bug with the new timers Delay was (accidentally) in microseconds, not milliseconds.
Haskell
bsd-3-clause
GaloisInc/HaNS,cartazio/HaNS,GaloisInc/HaNS,cartazio/HaNS
e28f33966e0af3740e946e7d6adcdcd244718a1d
src/MB/Defaults.hs
src/MB/Defaults.hs
module MB.Defaults ( preamble , postamble , stylesheet , firstPost ) where preamble :: String preamble = "" postamble :: String postamble = "" stylesheet :: String stylesheet = "" firstPost :: String firstPost = ""
module MB.Defaults ( preamble , postamble , stylesheet , firstPost ) where preamble :: String preamble = "<html>\n\ \ <head>\n\ \ <title>A Blog</title>\n\ \ <link rel=\"stylesheet\" type=\"text/css\" href=\"/stylesheets/stylesheet.css\"/>\n\ \ </h...
Add content for default files
Add content for default files Ignore-this: 43791a70a299d867712bec1a756b1653 darcs-hash:20100731014636-e018d-06f5e372864d2ad18f6b879baf26703bdffb6ca5.gz
Haskell
bsd-3-clause
jtdaugherty/mathblog
657d1955160cf6807b1f2a3b409b1ef2d62c776a
src/Formalize/Actions.hs
src/Formalize/Actions.hs
{-# LANGUAGE OverloadedStrings #-} module Formalize.Actions ( home , submit ) where import Control.Monad.IO.Class (liftIO) import Data.Text.Lazy as LT import Formalize.Html import Formalize.Types import Formalize.Pdf import Formalize.Util import Formalize.Validate import Web.Spock -- Handle successful sub...
{-# LANGUAGE OverloadedStrings #-} module Formalize.Actions ( home , submit ) where import Control.Monad.IO.Class (liftIO) import Data.Text.Lazy as LT import Formalize.Html import Formalize.Types import Formalize.Pdf import Formalize.Util import Formalize.Validate import Web.Spock -- Handle successful sub...
Change bind operator direction so it can be read from left to right.
Change bind operator direction so it can be read from left to right.
Haskell
bsd-3-clause
Lepovirta/Crystallize,thevangelist/Crystallize,thevangelist/Crystallize,thevangelist/Crystallize,Lepovirta/Crystallize,Lepovirta/Crystallize
91f7a3743f48c44e249d640e59232d52ce5144c5
src/Graphics/QML.hs
src/Graphics/QML.hs
-- | This module imports the entire package, except 'Graphics.QML.Debug'. module Graphics.QML ( -- * Overview {-| HsQML layers a low to medium level Haskell API on top of the C++ Qt Quick framework. It allows you to write graphical applications where the front-end is written in Qt Quick's QML language (incorporating J...
-- | This module imports the entire package, except 'Graphics.QML.Debug'. module Graphics.QML ( -- * Overview {-| HsQML layers a low to medium level Haskell API on top of the C++ Qt Quick framework. It allows you to write graphical applications where the front-end is written in Qt Quick's QML language (incorporating J...
Add Weak module to standard imports.
Add Weak module to standard imports. Ignore-this: aa3a9c0ca0c0f54c5b0cdac46f01b699 darcs-hash:20141112221511-4d2ae-87dcefb5c33e64cc831a5a08616177d89a4da660
Haskell
bsd-3-clause
johntyree/HsQML,johntyree/HsQML
ab639d53232d34ea63e3b47844a8edc23918d5af
Hints.hs
Hints.hs
module Hints where import Data.List concat_map f x = concat (map f x) map_map f g x = map f (map g x) box_append x y = [x] ++ y head_index x = x !! 0 tail_drop x = drop 1 x use_replicate n x = take n (repeat x) use_unwords1 x xs = x ++ concatMap (' ':) xs use_unwords2 xs = concat (intersperse " " xs) no_if ...
module Hints where import Data.List -- concatMap f x concat_map f x = concat (map f x) -- map (f . g) x map_map f g x = map f (map g x) -- x : y box_append x y = [x] ++ y -- head x head_index x = x !! 0 -- tail x tail_drop x = drop 1 x -- replicate n x use_replicate n x = take n (repeat x) -- unwords (x:xs) u...
Add the solutions to the hints
Add the solutions to the hints
Haskell
bsd-3-clause
mpickering/hlint,bitemyapp/hlint,gibiansky/hlint,ndmitchell/hlint,eigengrau/hlint,ndmitchell/hlint
406e274759b325b9987634e5f9e1536760b87c8f
examples/Client.hs
examples/Client.hs
module Main (main) where import Control.Concurrent import Control.Monad.Trans import System.Environment import System.Exit import System.IO import Network.BitTorrent parseArgs :: IO FilePath parseArgs = do args <- getArgs case args of [path] -> return path _ -> do hPutStrLn stderr "Usage: clien...
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RecordWildCards #-} module Main (main) where import Control.Concurrent import Control.Monad.Trans import Options.Applicative import System.Environment import System.Exit import System.IO import Text.Read import...
Add command line arguments to tiny client
Add command line arguments to tiny client
Haskell
bsd-3-clause
DavidAlphaFox/bittorrent,pxqr/bittorrent
231a00dc2f9cb7d5a535c72e1e75d40477aa6681
env/src/Byzanz.hs
env/src/Byzanz.hs
-- | Prompt for running byzanz module Byzanz where import Data.Time import XMonad.Prompt import Imports import Prompt data ByzanzPrompt = ByzanzPrompt instance XPrompt ByzanzPrompt where showXPrompt ByzanzPrompt = "Byzanz arguments: " byzanzPrompt :: XX () byzanzPrompt = do env <- ask toXX $ mkXPrompt Byzanz...
-- | Prompt for running byzanz module Byzanz where import Data.Time import XMonad.Prompt import Imports import Prompt data ByzanzPrompt = ByzanzPrompt instance XPrompt ByzanzPrompt where showXPrompt ByzanzPrompt = "Byzanz arguments: " byzanzPrompt :: XX () byzanzPrompt = do env <- ask toXX $ mkXPrompt Byzanz...
Use local time in byzanz screencaps
Use local time in byzanz screencaps
Haskell
mit
mgsloan/compconfig
036a285fba1b720c67a11befc7f30c7a38f4807a
hspec-core/test/All.hs
hspec-core/test/All.hs
{-# OPTIONS_GHC -F -pgmF hspec-meta-discover -optF --module-name=All #-}
{-# OPTIONS_GHC -fforce-recomp -F -pgmF hspec-meta-discover -optF --module-name=All #-}
Use -fforce-recomp for test driver
Use -fforce-recomp for test driver
Haskell
mit
hspec/hspec
1e901c84466c08b14789a43f50dea4c4982bc3a6
Opts.hs
Opts.hs
{-# LANGUAGE OverloadedStrings #-} module Opts ( opts , execParser ) where import Data.Version import Filesystem.Path.CurrentOS import Options.Applicative import Prelude hiding (FilePath) import Paths_popvox_scrape import Pop...
{-# LANGUAGE OverloadedStrings #-} module Opts ( opts , execParser ) where import Data.Version import Filesystem.Path.CurrentOS import Options.Applicative import Options.Applicative.Types import Prelude hiding (FilePath) import ...
Update the custom option reader.
Update the custom option reader.
Haskell
apache-2.0
erochest/popvox-scrape,erochest/popvox-scrape
6f513cdbb4bae083f87d9dcbd0c6f7dda7ca484d
examples/haskell-wreq/src/Main.hs
examples/haskell-wreq/src/Main.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception (catch, SomeException) import Control.Monad (when) import System.Environment (getArgs, getProgName) import System.Exit (exitSuccess, exitFailure) import Network.Wreq main :: IO () main = do args <- getArgs let argc = length args whe...
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception (catch, SomeException) import Control.Monad (when) import System.Environment (getArgs, getProgName) import System.Exit (exitSuccess, exitFailure) import Network.Wreq main :: IO () main = do args <- getArgs let argc = length args whe...
Fix OK and FAIL return values
haskell-wreq: Fix OK and FAIL return values
Haskell
mit
ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls
784455dcc43c39fe313eea0fb2ee4a68971c8198
src/NGramCrackers/ListManipulation.hs
src/NGramCrackers/ListManipulation.hs
module NGramCrackers.ListManipulation ( getNSeqFromList, intToList ) where import Data.List import Data.Char (isAlpha) getNGramsFromList :: Int -> [String] -> [[String]] getNGramsFromList n wordList = getNSeqFromList n wordList {-| Return only alphabetic characters from a string and return the result as a str...
module ListManipulation ( getNSeqFromList , intToList ) where import Data.List {-| Function creates a list of lists of n length -} getNSeqFromList :: Int -> [a] -> [[a]] getNSeqFromList n [] = [] getNSeqFromList n (x:xs) | length (x:xs) >= n = take n (x:xs) : getNSeqFromList n xs | otherwise = [] intToLis...
Move n-gram functions to separate module
Move n-gram functions to separate module
Haskell
agpl-3.0
R-Morgan/NGramCrackers
87289e661ee17dc2b0d6270dddfae3dfc2dce473
exercises/raindrops/src/Example.hs
exercises/raindrops/src/Example.hs
module Raindrops (convert) where convert :: Int -> String convert n = maybe (show n) id maybeSound where maybeSound = sound "Pling" 3 `mappend` sound "Plang" 5 `mappend` sound "Plong" 7 sound noise factor | n `rem` factor == 0 = Just noise | otherwise ...
module Raindrops (convert) where import Data.Maybe (fromMaybe) convert :: Int -> String convert n = fromMaybe (show n) maybeSound where maybeSound = sound "Pling" 3 `mappend` sound "Plang" 5 `mappend` sound "Plong" 7 sound noise factor | n `rem` factor == 0 = Just noise ...
Improve code based on HLint's suggestions.
raindrops: Improve code based on HLint's suggestions.
Haskell
mit
exercism/xhaskell
cead92322407f4b8f68160ea9104939ecb282ed3
Tell.hs
Tell.hs
{-# LANGUAGE OverloadedStrings #-} module Tell (tellAll) where import Core import Data.List import qualified Data.Map as M import qualified Data.Text as T import qualified Data.Set as S tellAll :: M.Map User (Maybe UserMessage) -> M.Map User [UserMessage] -> ([IRCAction], M.Map User [UserMessage]) tellAll on...
{-# LANGUAGE OverloadedStrings #-} module Tell (tellAll) where import Core import Data.List import qualified Data.Map as M import qualified Data.Text as T import qualified Data.Set as S tellAll :: M.Map User (Maybe UserMessage) -> M.Map User [UserMessage] -> ([IRCAction], M.Map User [UserMessage]) tellAll on...
Fix the reversing of tell messages
Fix the reversing of tell messages The way in which the bot relays tell messages to you is now properly reversed so that they are shown in chronological order.
Haskell
mit
jchmrt/btjchm
603dd2fcfe59aaef993ddee34f7dbc6b910521be
src/Language/K3/Analysis/Effects/Common.hs
src/Language/K3/Analysis/Effects/Common.hs
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedLists #-} module Language.K3.Analysis.Effects.Common where import Prelude hiding (any) import Data.Foldable import Data.Monoid import Data.Maybe import qualified Data.Set as S import Language.K3.Core.Annotation import Language.K3.Analysis.Effects.Core readSet ::...
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedLists #-} module Language.K3.Analysis.Effects.Common where import Prelude hiding (any) import Data.Foldable import Data.Monoid import Data.Maybe import qualified Data.Set as S import Language.K3.Core.Annotation import Language.K3.Analysis.Effects.Core readSet ::...
Fix empty case in hasRead/hasWrite.
Fix empty case in hasRead/hasWrite.
Haskell
apache-2.0
yliu120/K3,DaMSL/K3,DaMSL/K3
f54d795ec3663f28c32c8f808df31d7edf373f41
ZoomHub.hs
ZoomHub.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TemplateHaskell #-} module ZoomHub where import Control.Monad.Trans.Either import Data.Char import GHC.Generics import Network.Wai import Servant import Types.Content -- API type API ...
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TemplateHaskell #-} module ZoomHub where import Control.Monad.Trans.Either import Data.Char import GHC.Generics import Network.Wai import Servant import Types.Content -- Servant defaul...
Add `Handler a` type shortcut
Add `Handler a` type shortcut
Haskell
mit
zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub
775cc84993aaced66ed3bfaa13eeb75f52acdc2c
src/ZoomHub/Types/EmbedDimension.hs
src/ZoomHub/Types/EmbedDimension.hs
module ZoomHub.Types.EmbedDimension ( EmbedDimension(..) , toCSSValue , parseCSSValue ) where import qualified Data.Text as T import Servant (FromText, fromText) -- Type data EmbedDimension = Zero | Auto | Pixels Integer | Percentage Integer deriving (Eq, Show) toCSSValue :: EmbedDimension -> S...
module ZoomHub.Types.EmbedDimension ( EmbedDimension(..) , toCSSValue , parseCSSValue ) where import Data.Char (isDigit) import qualified Data.Text as T import Safe (readMay) import Servant (FromText, fromText) -- Type data EmbedDimension = Zero | Auto | Pixels Integer | P...
Add poor man’s CSS dimension parsing
Add poor man’s CSS dimension parsing
Haskell
mit
zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub
3a94424bfe82068dca0d9073543778719c03f759
haskell/Problem22.hs
haskell/Problem22.hs
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 22 -- Names scores module Problem22 where import Data.Char (ord) import Data.List (sort) import System.IO.Unsafe (unsafePerformIO) totalScore :: [String] -> Int totalScore = sum . map mult . zip [1..] . map nameValue . sort wh...
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 22 -- Names scores module Problem22 where import Data.Char (ord) import Data.List (sort) import System.IO.Unsafe (unsafePerformIO) totalScore :: [String] -> Int totalScore = sum . zipWith (*) [1..] . map nameValue . sort where...
Use zipWith instead of map + zip
Use zipWith instead of map + zip
Haskell
mit
mk12/euler,mk12/euler
873762b9cb1530c7aab4e18f1d1e59545b3aa5bc
Models/Readable.hs
Models/Readable.hs
module Models.Readable where import Import hiding (on, (==.)) import Control.Lens hiding (from) import Data.Aeson import Database.Esqueleto hiding ((^.)) import qualified Database.Esqueleto as E chartData :: [Record] -> Text chartData records = decodeUtf8 $ toStrict $ encode $ map encoder records where encoder ...
module Models.Readable where import Import hiding (on, (==.)) import Control.Lens hiding (from) import Data.Aeson import Database.Esqueleto hiding ((^.)) import qualified Database.Esqueleto as E chartData :: [Record] -> Text chartData records = decodeUtf8 $ toStrict $ encode $ map encoder records where encoder ...
Fix profile join to exclude null reading rows
Fix profile join to exclude null reading rows
Haskell
mit
darthdeus/reedink,darthdeus/reedink
c331f5af070eca8b562f1ba4a022e7e475405ec8
Handler/Game.hs
Handler/Game.hs
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Handler.Game where import Data.Aeson (encode) import GameManagement import Text.Blaze.Html (ToMarkup, toMarkup) import qualified Text...
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Handler.Game where import Data.Aeson (encode) import GameManagement import Text.Blaze.Html (ToMarkup, toMarkup) import qualified Text...
Use defaultLayoutJson to save code
Use defaultLayoutJson to save code
Haskell
apache-2.0
jml/haverer-api
313441587068e187ca56adc60a0aaedf71f72e30
travis.hs
travis.hs
import System.Time.Extra import System.Process.Extra main :: IO () main = do system_ "cabal install apply-refact" system_ "hlint --test +RTS -K512K" (time,_) <- duration $ system_ "hlint src --with-group=extra --with-group=future" -- "UNIPLATE_VERBOSE=-1 hlint src +RTS -K1K" putStrLn $ "Running HLint...
import System.Time.Extra import System.Process.Extra main :: IO () main = do system_ "cabal new-install apply-refact --install-method=copy" system_ "hlint --test +RTS -K512K" (time,_) <- duration $ system_ "hlint src --with-group=extra --with-group=future" -- "UNIPLATE_VERBOSE=-1 hlint src +RTS -K1K" ...
Make sure the install works with new Cabal on Windows
Make sure the install works with new Cabal on Windows
Haskell
bsd-3-clause
ndmitchell/hlint,ndmitchell/hlint
b4123966677f190ef422270d8580c5ec30de0ab1
tests/hs/LibTest.hs
tests/hs/LibTest.hs
module Main where import System.Directory import System.Exit import System.FilePath import System.Process import Elm.Internal.Paths as Elm main :: IO () main = do top <- getCurrentDirectory let ioScript s = top</>"IO"</>s runCmd "git submodule init" --runCmd "npm install jsdom" setCurrentDirectory $ top</>...
module Main where import System.Directory import System.Exit import System.FilePath import System.Process import Elm.Internal.Paths as Elm main :: IO () main = do top <- getCurrentDirectory let ioScript s = top</>"IO"</>s runCmd "git submodule init" runCmd "npm install jsdom" setCurrentDirectory $ top</>"t...
Install jsdom in the test
Install jsdom in the test
Haskell
bsd-3-clause
laszlopandy/elm-compiler,JoeyEremondi/elm-pattern-effects,mgold/Elm,deadfoxygrandpa/Elm,Axure/elm-compiler,pairyo/elm-compiler,5outh/Elm
1f6f25ede78166dea7e6824de0039eac3fa0ccf9
src/Development/Shake/Internal/Special.hs
src/Development/Shake/Internal/Special.hs
-- | This module contains rule types that have special behaviour in some way. -- Everything in this module is a hack. module Development.Shake.Internal.Special( specialAlwaysRebuilds, specialIsFileKey ) where import Development.Shake.Internal.Value import Data.Typeable specialAlwaysRebuilds :: Value -...
-- | This module contains rule types that have special behaviour in some way. -- Everything in this module is a hack. module Development.Shake.Internal.Special( specialAlwaysRebuilds, specialIsFileKey ) where import Development.Shake.Internal.Value import Data.Typeable specialAlwaysRebuilds :: Value -...
Remove AlwaysRerunA from the list of "special" things
Remove AlwaysRerunA from the list of "special" things
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
effb9a27313b98f34500a49aee2a482df284e970
Data/Records/Lens.hs
Data/Records/Lens.hs
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE GADTs #-} module Data.Records.Lens ( module Control.Lens , RLens , rLens , rGet , rPut , rMod ) where import Data.Records.Rec import Data.Records.Field imp...
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE GADTs #-} module Data.Records.Lens ( module Control.Lens , RLens , rLens , rGet , rPut , rMod ) where import Data.Records.Rec import Data.Records.Field imp...
Correct rPut and rMod argument order
Correct rPut and rMod argument order Not necessary to flip (this change brings the README closer to typechecking).
Haskell
mit
plow-technologies/Vinyl,VinylRecords/Vinyl
cc1de31c7654a9a27da4a638314a4ff66bb6f4cd
ScottyWebServer.hs
ScottyWebServer.hs
{-# LANGUAGE OverloadedStrings #-} import Web.Scotty import qualified Data.Aeson as Aeson import Network.Beanstalk import Control.Monad import Control.Monad.IO.Class import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as BSL import qualified Control.Exception as E main = scotty 30...
{-# LANGUAGE OverloadedStrings #-} import Web.Scotty import qualified Data.Aeson as Aeson import Network.Beanstalk import Control.Monad import Control.Monad.IO.Class import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as BSL import qualified Control.Exception as E main = scotty 30...
Rename API back to 'hand' for the moment
Rename API back to 'hand' for the moment
Haskell
apache-2.0
derekmcloughlin/BridgeBuddyServer
eca486ee7c2c3347106767b1f7cbd9e3054bcc4e
tests/UITest.hs
tests/UITest.hs
module UITest where import UI hiding (renderSvg) import Core import Data.List (isInfixOf) import Test.HUnit import Test.QuickCheck import Text.Blaze.Svg.Renderer.String (renderSvg) testRenderBullet = TestCase (do let bullet = Bullet { bulletPosition = (1,2), bulletVelocity = undefined -- unimpor...
module UITest where import UI hiding (renderSvg) import Core import Control.Applicative import Data.List (isInfixOf) import Test.HUnit import Test.QuickCheck import Text.Blaze.Svg.Renderer.String (renderSvg) testRenderBullet = TestCase (do let bullet = Bullet { bulletPosition = (1,2), bulletVelo...
Make Bullet's Arbitrary definition more idiomatic
Make Bullet's Arbitrary definition more idiomatic
Haskell
mit
andreyLevushkin/LambdaWars
360cea9a019aeef915f0de1260e120b75d3883a1
LT24/Timing.hs
LT24/Timing.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TemplateHaskell #-} module LT24.Timing where import CLaSH.Prelude import qualified Toolbox.ClockScale as CS import Toolbox.FClk tResetL = 10e-6 tResetH = 120e-3 tWriteL = 355e-9 tWriteH = 355e-9 tReadLFM = 355e-9 tReadLID = 355e-9 tReadH = 355e-9 wResetL = CS.ticksMinPeriod ...
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TemplateHaskell #-} module LT24.Timing where import CLaSH.Prelude import qualified Toolbox.ClockScale as CS import Toolbox.FClk tResetL = 10e-6 tResetH = 120e-3 tWriteL = 15e-9 tWriteH = 15e-9 tWriteC = 66e-9 tReadLFM = 355e-9 tReadLID = 45e-9 tReadAFM = 340e-9 -- Read access...
Adjust timings to actual data from the datasheet
Adjust timings to actual data from the datasheet
Haskell
bsd-2-clause
DigitalBrains1/clash-lt24
72b9411ce13adc8ebb8baa4570f3e45e2aeaf182
Setup.hs
Setup.hs
module Main (main) where import Distribution.Simple main :: IO () main = defaultMainWithHooks defaultUserHooks
module Main (main) where import Distribution.Simple main :: IO () main = defaultMainWithHooks autoconfUserHooks
Use the right setup hooks.
Use the right setup hooks.
Haskell
bsd-2-clause
tibbe/event,tibbe/event,tibbe/event
b62c472e59eaf20064bb781568ff48a7f27845d4
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....
Revert "Focus tests on expr"
Revert "Focus tests on expr" This reverts commit 072df36ca02e5340b26510dafbbf3185894a696c.
Haskell
mit
nikita-volkov/hasql-th
c4a49a1003a849562e31e2bf82d6883d382dc6f3
src/React/Local.hs
src/React/Local.hs
{-# LANGUAGE FlexibleInstances, GADTs, MultiParamTypeClasses, FlexibleContexts, IncoherentInstances, LambdaCase, DataKinds #-} -- Note on IncoherentInstances: the two instances below will both work fine -- for `GeneralizeSignal Void Void`. They should never be called. module React.Local (GeneralizeSignal(..), locally...
{-# LANGUAGE FlexibleInstances, GADTs, MultiParamTypeClasses, FlexibleContexts, IncoherentInstances, LambdaCase, DataKinds #-} -- Note on IncoherentInstances: the two instances below will both work fine -- for `GeneralizeSignal Void Void`. They should never be called. module React.Local (GeneralizeSignal(..), locally...
Add note on why you would use `locally`.
Add note on why you would use `locally`.
Haskell
mit
seanhess/react-haskell,joelburget/react-haskell,adarqui/react-haskell,adarqui/react-haskell,silky/react-haskell,silky/react-haskell,seanhess/react-haskell,joelburget/react-haskell,adarqui/react-haskell,seanhess/react-haskell,joelburget/react-haskell,silky/react-haskell
c4fd704564a3a275d4e1265a04148f5f0bd7f3cf
spec/Text/HerokuErrors/ParserSpec.hs
spec/Text/HerokuErrors/ParserSpec.hs
module Text.HerokuErrors.ParserSpec where import Test.Hspec import Text.HerokuErrors.Parser spec = do describe "HerokuErrors Parser" $ do it "should parse H10 errors" $ do let err = parseHerokuError "at=error code=H10 desc=\"App crashed\" method=GET path=\"/\" host=myapp.herokuapp.com fwd=17.17.17.17 dyn...
module Text.HerokuErrors.ParserSpec where import Test.Hspec import Text.HerokuErrors.Parser spec = do describe "HerokuErrors Parser" $ do it "should parse H10 errors" $ do let err = parseHerokuError "at=error code=H10 desc=\"App crashed\" method=GET path=\"/\" host=myapp.herokuapp.com fwd=17.17.17.17 dyn...
Add failing spec for heroku errors
Add failing spec for heroku errors
Haskell
mit
keithduncan/logplex-statsd,keithduncan/logplex-statsd
0dc62977cc3ab654c1d78019046da4a4563004cd
soh-runner/main/Main.hs
soh-runner/main/Main.hs
{-# LANGUAGE TemplateHaskell #-} module Main (main) where import SchoolOfHaskell.Runner (runner, Settings(Settings)) import Options.Applicative.Simple import Paths_soh_runner (version) import Data.Text (pack) main :: IO () main = id . snd =<< simpleOptions $(simpleVersion version) "soh-runner" "School o...
{-# LANGUAGE TemplateHaskell #-} module Main (main) where import SchoolOfHaskell.Runner (runner, Settings(Settings)) import Options.Applicative.Simple import Paths_soh_runner (version) import Data.Text (pack) main :: IO () main = id . snd =<< simpleOptions $(simpleVersion version) "soh-runner" "School o...
Apply an eta-conversion cleanup ;)
Apply an eta-conversion cleanup ;)
Haskell
mit
fpco/schoolofhaskell,fpco/schoolofhaskell,fpco/schoolofhaskell
9594da23f4dd1d460a71aee50888db759ac20683
src/Drync/Missing.hs
src/Drync/Missing.hs
module Drync.Missing ( missingLocal , missingRemote ) where import Drync.Api import Drync.Transfer import Drync.Options import Drync.System import Network.Google.Drive import System.Directory (createDirectoryIfMissing, doesDirectoryExist) import System.FilePath ((</>)) missingLocal :: Options -> FilePath...
module Drync.Missing ( missingLocal , missingRemote ) where import Drync.Api import Drync.Transfer import Drync.Options import Drync.System import Network.Google.Drive import System.Directory (createDirectoryIfMissing, doesDirectoryExist) import System.FilePath ((</>)) missingLocal :: Options -> FilePath...
Fix assumed bug in missingRemote
Fix assumed bug in missingRemote
Haskell
mit
pbrisbin/drync
38e55b41062ec9e73b9b277ae1975b7363fe8e7c
src/Test/FileLock.hs
src/Test/FileLock.hs
module Test.FileLock(main) where import Development.Shake import Control.Concurrent.Extra import Control.Exception.Extra import Control.Monad import Data.Either.Extra import System.Time.Extra import Test.Type main = shakeTest_ test $ action $ do putNormal "Starting sleep" liftIO $ sleep 5 ...
module Test.FileLock(main) where import Development.Shake import Control.Concurrent.Extra import Control.Exception.Extra import Control.Monad import Data.Either.Extra import System.Time.Extra import System.Info.Extra import Test.Type main = shakeTest_ test $ action $ do putNormal "Starting sleep" ...
Disable the filelock test under mac - it does weird
Disable the filelock test under mac - it does weird
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
a274a93475bd88318e43b4b07639b096ad168fa9
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 intMatrix ...
-- https://www.hackerrank.com/challenges/diagonal-difference/problem import Control.Monad(replicateM) import Data.List.Split(splitOn) getIntSquareMatrix :: Int -> IO([[Int]]) getIntSquareMatrix rows = do matrix <- replicateM rows getLine let intMatrix = (map . map) read $ map words matrix return intMatrix getDi...
Remove nestedMap function, use (map . map) instead.
Remove nestedMap function, use (map . map) instead.
Haskell
mit
julianespinel/trainning,julianespinel/training,julianespinel/training,julianespinel/training,julianespinel/trainning,julianespinel/training
11f97cda4b42874448e78645acb49f804b0ab2d8
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 (,) listZipWith :: (a -> b -> c) -> [a] -> [b] -> [c] listZipWith f (xa : xas) (xb : xbs) = (f xa xb) : listZipWith f xas xbs listZipWith _ _ ...
module E05.A1 where -- We have already seen zipWith in the last exercise, were we used it to -- implement pleat'. See the Haskell docs for more info: -- http://hackage.haskell.org/package/base-4.8.0.0/docs/Prelude.html#v:zipWith -- Here's an implementation of zipWith: {- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] z...
Define Zippable [] in terms of Prelude functions
E05: Define Zippable [] in terms of Prelude functions
Haskell
mit
sebschrader/programmierung-ss2015
45c0ac8eb34f4639228842359fd493a83fa1139a
src/HaddockVersion.hs
src/HaddockVersion.hs
-- -- Haddock - A Haskell Documentation Tool -- -- (c) Simon Marlow 2003 -- module HaddockVersion ( projectName, projectVersion, projectUrl ) where import Paths_haddock_ghc ( version ) import Data.Version ( showVersion ) projectName, projectUrl :: String projectName = "Haddock" projectUrl = "http://www.has...
-- -- Haddock - A Haskell Documentation Tool -- -- (c) Simon Marlow 2003 -- module HaddockVersion ( projectName, projectVersion, projectUrl ) where import Paths_haddock_ghc ( version ) import Data.Version ( showVersion ) projectName, projectUrl :: String projectName = "Haddock-GHC" projectUrl = "http://www...
CHange project name to Haddock-GHC
CHange project name to Haddock-GHC
Haskell
bsd-2-clause
ghcjs/haddock-internal,ghcjs/haddock-internal
8fc2a76c654cb8f38e422dcc41237696c50b279c
Handler/HistoryBG.hs
Handler/HistoryBG.hs
module Handler.HistoryBG where import Import ------------------------------------------------------------------------ getHistoryBGR :: Handler Html getHistoryBGR = do Entity uid _ <- requireAuth -- TODO: pagination sugars <- fmap (map entityVal) $ runDB $ selectList [BloodGlucoseHistoryUid...
{-# LANGUAGE NoDisambiguateRecordFields, NoRecordWildCards #-} module Handler.HistoryBG where import Import ------------------------------------------------------------------------ getHistoryBGR :: Handler Html getHistoryBGR = do Entity uid _ <- requireAuth -- TODO: pagination sugars <- fmap (map entit...
Fix for GHC 8.0.1 crash on travis-ci.org
Fix for GHC 8.0.1 crash on travis-ci.org Just like 4c8283a8e7375a7fe9e9d2901ed6612b9ac3f7b4 and 17cccae6eff185a758ddf270855c287da2f26eb4, but in Handler/HistoryBG.hs
Haskell
agpl-3.0
sajith/betty-web
6e6d94abe9ffdb9369544fed7ac8807457da050a
tests/timing/Bench.hs
tests/timing/Bench.hs
module Main (main) where import Data.Vector.Unboxed as V import Math.FFT.Vector.Unnormalized as FFT import Criterion.Main import Data.Complex main = do let n = 1024 let v = V.replicate n 17 :: Vector (Complex Double) let !p = plan dft n defaultMain [ bench "fftRun" $ whnf (FFT.run dft) v ...
module Main (main) where import Data.Vector.Unboxed as V import Math.FFT.Vector.Unnormalized as U import Math.FFT.Vector.Invertible as I import Criterion.Main import Data.Complex main = do let mkSize planner k = do let !v = V.replicate k 17 :: Vector (Complex Double) let !p = plan planner ...
Add more comprehensive timing benchmarks.
Add more comprehensive timing benchmarks.
Haskell
bsd-3-clause
judah/vector-fftw
88aa27213a8c7a653d97b12672831750be22e0ba
travis.hs
travis.hs
import System.Time.Extra import System.Process.Extra import Control.Exception.Extra main :: IO () main = do let timed x = do putStrLn $ "\n\nSearching for " ++ x (time,_) <- duration $ system_ $ "hoogle +RTS -T -M1.8G -K2000K -RTS " ++ show x putStrLn $ "Search " ++ show x ++ " took " ++ ...
import System.Time.Extra import System.Process.Extra import Control.Exception.Extra main :: IO () main = do let timed x = do putStrLn $ "\n\nSearching for " ++ x (time,_) <- duration $ system_ $ "hoogle +RTS -T -M1.8G -K2000K -RTS " ++ show x putStrLn $ "Search " ++ show x ++ ...
Indent the Travis script more
Indent the Travis script more
Haskell
bsd-3-clause
ndmitchell/hoogle,ndmitchell/hoogle,ndmitchell/hoogle
2daf8bada00217176e9b08175dc3f275d7f71e2e
src/Input/Download.hs
src/Input/Download.hs
{-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-} module Input.Download(downloadInputs) where import General.Util import System.FilePath import Control.Monad.Extra import System.Directory import Data.Conduit.Binary (sinkFile) import qualified Network.HTTP.Conduit as C import qualified Data.Conduit as C impo...
{-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-} module Input.Download(downloadInputs) where import General.Util import System.FilePath import Control.Monad.Extra import System.Directory import Data.Conduit.Binary (sinkFile) import qualified Network.HTTP.Conduit as C import qualified Data.Conduit as C impo...
Switch packdeps back to http
Switch packdeps back to http
Haskell
bsd-3-clause
wolftune/hoogle,wolftune/hoogle,ndmitchell/hoogle,wolftune/hoogle,BartAdv/hoogle,ndmitchell/hoogle,ndmitchell/hoogle,BartAdv/hoogle,BartAdv/hoogle,wolftune/hoogle,BartAdv/hoogle
ec70fdc102b950a23aad5565a08f10ddb8ef10c7
tests/Network/BitTorrent/Tracker/SessionSpec.hs
tests/Network/BitTorrent/Tracker/SessionSpec.hs
module Network.BitTorrent.Tracker.SessionSpec (spec) where import Data.Default import Data.List as L import Test.Hspec import Data.Torrent import Network.BitTorrent.Tracker.Message import Network.BitTorrent.Tracker.List import Network.BitTorrent.Tracker.RPC import Network.BitTorrent.Tracker.Session import Config tes...
module Network.BitTorrent.Tracker.SessionSpec (spec) where import Control.Monad import Data.Default import Data.List as L import Test.Hspec import Data.Torrent import Network.BitTorrent.Tracker.Message import Network.BitTorrent.Tracker.List import Network.BitTorrent.Tracker.RPC import Network.BitTorrent.Tracker.Sessio...
Test specs with empty tracker list too
Test specs with empty tracker list too
Haskell
bsd-3-clause
DavidAlphaFox/bittorrent,pxqr/bittorrent
06127a28701e12655cd794ec61a70f5389ad23a4
testsuite/tests/rename/should_compile/T5306a.hs
testsuite/tests/rename/should_compile/T5306a.hs
{-# LANGUAGE TypeFamilies #-} module T5306a where import T5306b data instance F Bool = FBool
{-# LANGUAGE TypeFamilies #-} module T5306a( F(..) ) where import T5306b data instance F Bool = FBool
Change test, now that imported data families don't get implicitly exported
Change test, now that imported data families don't get implicitly exported
Haskell
bsd-3-clause
nushio3/ghc,tjakway/ghcjvm,ml9951/ghc,wxwxwwxxx/ghc,sgillespie/ghc,AlexanderPankiv/ghc,jstolarek/ghc,ghc-android/ghc,ml9951/ghc,elieux/ghc,mcschroeder/ghc,nushio3/ghc,nkaretnikov/ghc,fmthoma/ghc,GaloisInc/halvm-ghc,ezyang/ghc,AlexanderPankiv/ghc,oldmanmike/ghc,tibbe/ghc,lukexi/ghc-7.8-arm64,mcschroeder/ghc,GaloisInc/ha...
afa396e79929fedafa4e13c4bbb091caa22441e3
src/Language/Dash/Evaluate.hs
src/Language/Dash/Evaluate.hs
{-# LANGUAGE NoImplicitPrelude #-} module Language.Dash.Evaluate (eval) where import Language.Dash.Environment import Prelude (($), Maybe (..), maybe) eval :: Environment -> Term -> Maybe Literal eval e (Variable s) = getEnv e s eval _ (Literal y) = Just y eval (Environment e) (Lambda n l) = Just (LiteralFunction (...
{-# LANGUAGE NoImplicitPrelude #-} module Language.Dash.Evaluate (eval) where import Language.Dash.Environment import Prelude (($), Maybe (..), maybe, (>>=)) eval :: Environment -> Term -> Maybe Literal eval e (Variable s) = getEnv e s eval _ (Literal y) = Just y eval (Environment e) (Lambda n l) = Just (LiteralFun...
Fix letrec crash when substituting a variable bound to an unbound variable
Fix letrec crash when substituting a variable bound to an unbound variable Signed-off-by: Ricky Elrod <3de8762d49a778edd8b1aa9f381ea5a9ccb62944@elrod.me>
Haskell
bsd-3-clause
relrod/-
d2e1eee42251b39360d5a10829b7b46bbeff39ae
Source/Calculator.hs
Source/Calculator.hs
module Calculator where import Data.List.Split calculate :: String -> Double calculate exp = read $ ((splitOn "+" exp)!!0)
module Calculator where import Data.List.Split calculate :: String -> Double calculate exp = read $ head (splitOn "+" exp)
Refactor calculate accordingly to compiler warnings
Refactor calculate accordingly to compiler warnings
Haskell
mit
ksysu/Calculator
44df1cdd8a5c2b8d08f0323abd8cf679ee8098ae
examples/info/Main.hs
examples/info/Main.hs
module Main where import Control.Exception import Data.Foldable import Text.Pretty.Simple import Vulkan.Core10 import Vulkan.Zero main :: IO () main = withInstance zero Nothing bracket $ \i -> do pPrint i (_, layers ) <- enumerateInstanceLayerProperties (_,...
module Main where import Control.Exception import Data.Foldable import Text.Pretty.Simple import Vulkan.Core10 import Vulkan.Zero main :: IO () main = withInstance zero Nothing bracket $ \i -> do myPrint i (_, layers ) <- enumerateInstanceLayerProperties (_...
Correct output of uuids in info example
Correct output of uuids in info example
Haskell
bsd-3-clause
expipiplus1/vulkan,expipiplus1/vulkan,expipiplus1/vulkan
35528f7c0edab6766a4f36be58957ef911a6e1be
src/Hint/All.hs
src/Hint/All.hs
module Hint.All(readHints) where import Control.Monad import Util import Type import Language.Haskell.Exts import Hint.Match import Hint.List import Hint.Monad import Hint.Lambda import Hint.Bracket hints :: [(String,Module -> Hint)] hints = let (*) = (,) in ["Match" * readMatch ,"List" * const listHi...
module Hint.All(readHints) where import Control.Monad import Util import Type import Language.Haskell.Exts import Hint.Match import Hint.List import Hint.Monad import Hint.Lambda import Hint.Bracket hints :: [(String,Hint)] hints = let (*) = (,) in ["List" * listHint ,"Monad" * monadHint ,"Lambda"...
Refactor the list of hints
Refactor the list of hints
Haskell
bsd-3-clause
ndmitchell/hlint,ndmitchell/hlint,bitemyapp/hlint,eigengrau/hlint,mpickering/hlint,gibiansky/hlint
1cd0f29f6b136331783c1e0a49dcb29fced1b563
src/Main.hs
src/Main.hs
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...
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...
Make the `-h` option actually do something
Make the `-h` option actually do something
Haskell
bsd-3-clause
GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script
a62fa8a3181fc479129e78a972dfdde1d6325481
docs/manual/Build.hs
docs/manual/Build.hs
import Development.Shake import Development.Shake.Command import Development.Shake.FilePath import Development.Shake.Util main :: IO () main = shakeArgs shakeOptions{shakeFiles="_build/"} $ do want ["_build/run" <.> exe] phony "clean" $ do putNormal "calling clean" removeFilesAfter "_build" ["...
import Development.Shake import Development.Shake.Command import Development.Shake.FilePath import Development.Shake.Util main :: IO () main = shakeArgs shakeOptions{shakeFiles="_build/"} $ do want ["_build/run" <.> exe] phony "clean" $ do removeFilesAfter "_build" ["//*"] "_build/run" <.> exe *>...
Remove some more debug droppings
Remove some more debug droppings
Haskell
bsd-3-clause
ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake
6cd52a816a10e15a3caceb4fa080ac6f934e837f
fay-shared/SharedTypes.hs
fay-shared/SharedTypes.hs
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} module SharedTypes where import Prelude import Data.Data import Language.Fay.Yesod #ifdef FAY import FFI import Fay.Text as T #else --import Language.Fay.FFI import Database.Persist.TH import Data.Text as T import...
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DeriveDataTypeable #-} module SharedTypes where import Prelude import Data.Data import Language.Fay.Yesod #ifdef FAY import FFI import Fay.Text as T #else --import Language.Fay.FFI import Database.Persist.TH import Data.Text as T import Text.Blaze derivePersistField "Bro...
Revert "remove explicit packing in favor of overloaded strings"
Revert "remove explicit packing in favor of overloaded strings" This reverts commit 7b2ea47b617f60033fcf23155159f3a14b9ed2e2.
Haskell
mit
mostalive/yesod-splittest,mostalive/yesod-splittest
7730caa415a94e8adecb0c3923473dbea4f81627
src/Configuration.hs
src/Configuration.hs
module Configuration where -- This type describes a kind of robotic system depending on its approach of movement data RobotConfig = Vehical VehicalConfig | Humanoid HumanoidConfig data VehicalConfig = VehicalConfig { wheelRadius :: Double , calcMoto...
module Configuration where -- This type describes a kind of robotic system depending on its approach of movement data RobotConfig = Vehical VehicalConfig | Humanoid HumanoidConfig data VehicalConfig = VehicalConfig { wheelRadius :: Double , distBetweenWheels ...
Add one more atribute to HumanoidConfig.
Add one more atribute to HumanoidConfig.
Haskell
mit
research-team/robot-dream,research-team/robot-dream,research-team/robot-dream
93ada32d86142ab387f01c29134dcdbb43756733
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 == "pandoc" ...
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 split and pandoc flags is xmonad-extras.
Enable split and pandoc flags is xmonad-extras.
Haskell
bsd-3-clause
Fuuzetsu/cabal2nix,bennofs/cabal2nix,dmalikov/cabal2nix,spencerjanssen/cabal2nix,gridaphobe/cabal2nix,jb55/cabal2nix,psibi/cabal2nix
e5a2a70640e2305a5a3a3cc070c3ee3a7ecb626e
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 a gamma to beta transformation
Test a gamma to beta transformation
Haskell
bsd-3-clause
zaxtax/hakaru,zachsully/hakaru,zaxtax/hakaru,zachsully/hakaru,bitemyapp/hakaru,suhailshergill/hakaru
1daa30f3fef5c0a6f0614e2653f397e7d69c4dcb
src/Configuration.hs
src/Configuration.hs
-- Copyright 2016 Ruud van Asseldonk -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License version 3. See -- the licence file in the root of the repository. {-# LANGUAGE DeriveGeneric #-} module Configuration (Configuration, loadConfiguratio...
-- Copyright 2016 Ruud van Asseldonk -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License version 3. See -- the licence file in the root of the repository. {-# LANGUAGE DeriveGeneric #-} module Configuration (Configuration, loadConfiguratio...
Add integration branch to configuration
Add integration branch to configuration
Haskell
apache-2.0
ruuda/hoff,ruuda/hoff
f5c0a36135887cd164348a20af40e25476ca143e
src/GridC/Parser2.hs
src/GridC/Parser2.hs
module GridC.Parser2 where import Control.Applicative ((<$>), (<$), (<*>), (<*)) import Text.Parsec (parse, try, many, (<|>)) import GridC.AST import GridC.Lexer import GridC.Util parseGC :: String -> String -> Either String Program parseGC name input = eitherMap show id $ parse programP name input where ...
module GridC.Parser2 where import Control.Applicative ((<$>), (<$), (<*>), (<*)) import Text.Parsec (parse, many, (<|>)) import Text.Parsec.Expr (buildExpressionParser, Operator(..), Assoc(..)) import GridC.AST import GridC.Lexer import GridC.Util parseGC :: String -> String -> Either String Program parseGC name inp...
Use Text.Parsec.Expr for expression parsing
Use Text.Parsec.Expr for expression parsing
Haskell
mit
lessandro/gridc
7721ad605be53ab082f5aaefca86aee32e2961ed
ivory-examples/examples/Coroutine.hs
ivory-examples/examples/Coroutine.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} import Ivory.Language import Ivory.Compile.C.CmdlineFrontend -- No-op "action" for the coroutine to trigger emit :: Def ('[Sint32] :-> ()) emit = proc "emit" $ \ _ -> body $ retVoid sequenced :: Coroutine (Stored Sint32) sequenced = coroutine $ \ yield -> pro...
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} import Ivory.Language import Ivory.Compile.C.CmdlineFrontend -- No-op "action" for the coroutine to trigger emit :: Def ('[Sint32] :-> ()) emit = proc "emit" $ \ _ -> body $ retVoid sequenced :: Coroutine (Stored Sint32) sequenced = coroutine "sequenced" $ Co...
Update coroutine example for proc-less API change.
Update coroutine example for proc-less API change. I broke this in 33075e4e9adb2adae14bf6a3957409dfa988a060.
Haskell
bsd-3-clause
GaloisInc/ivory,GaloisInc/ivory,Hodapp87/ivory
9d7dd1194d4b9d0a1941d7007107f27a8a6cdf74
tests/shouldwork/Signal/SigP.hs
tests/shouldwork/Signal/SigP.hs
import CLaSH.Prelude topEntity :: Signal (Bool, Bool) -> (Signal Bool, Signal Bool) topEntity = unpack . register (False,False)
module SigP where import CLaSH.Prelude topEntity :: Signal (Bool, Bool) -> (Signal Bool, Signal Bool) topEntity = unpack . register (False,False)
Add module header in test
Add module header in test
Haskell
bsd-2-clause
ggreif/clash-compiler,christiaanb/clash-compiler,ggreif/clash-compiler,christiaanb/clash-compiler
221d828c693e2fa26d3a5706ee709e45dc586c17
src/Lib.hs
src/Lib.hs
{-# LANGUAGE OverloadedStrings #-} module Lib ( serve, reqUri ) where import Prelude hiding (length, intercalate) import Data.ByteString.Char8 import Network hiding (accept) import Network.Socket hiding (sClose) import Network.Socket.ByteString (sendAll) import Control.Concurrent import Text.Regex.PCRE ...
{-# LANGUAGE OverloadedStrings #-} module Lib ( serve, reqUri ) where import Prelude hiding (length, intercalate) import Data.ByteString.Char8 import Network hiding (accept) import Network.Socket hiding (sClose) import Network.Socket.ByteString (sendAll) import Control.Concurrent import Text.Regex.PCRE ...
Print request URI when receiving messages
Print request URI when receiving messages
Haskell
bsd-3-clause
tripped/hlog
ef2ae5b9e62ac0994a85669110b292284eb8dcef
chapter4/QuickSort.hs
chapter4/QuickSort.hs
module QuickSort where import Data.List (partition) sort :: [Int] -> [Int] sort [] = [] sort [x] = [x] sort (y : ys) = let pivot = y -- this is where the n in O(n log n) comes from. (lessThanElements, greatherThanElements) = partition (< pivot) ys ...
module QuickSort where import Data.List (partition) sort :: [Int] -> [Int] sort [] = [] sort [x] = [x] sort (y : ys) = let -- if you pick the pivot randomly you can assure that -- you will remain O(n log n) instead of O(n^2) on -- average. p...
Add in note about picking pivot
Add in note about picking pivot
Haskell
mit
mikegehard/grokkingAlgorithms
d463e0582fbd2eb65dc86810db4151399e100c8a
src/HaskellDo/GUI/SimpleMDE/JavascriptInternals.hs
src/HaskellDo/GUI/SimpleMDE/JavascriptInternals.hs
{-# LANGUAGE NoMonomorphismRestriction #-} module HaskellDo.GUI.SimpleMDE.JavascriptInternals ( simpleMDE , initializeSimpleMDE ) where import BasicPrelude hiding (id, div, empty) import GHCJS.Types import Data.JSString import GHCJS.HPlay.View hiding (map, option,input) import HaskellDo.GUI.SimpleMDE.Common f...
{-# LANGUAGE NoMonomorphismRestriction #-} module HaskellDo.GUI.SimpleMDE.JavascriptInternals ( simpleMDE , initializeSimpleMDE ) where import BasicPrelude hiding (id, div, empty) import GHCJS.Types import Data.JSString import GHCJS.HPlay.View hiding (map, option,input) import HaskellDo.GUI.SimpleMDE.Common f...
Make SimpleMDE respond to clicks too
Make SimpleMDE respond to clicks too This will allow clicking on the toolbar and updating the state of it
Haskell
apache-2.0
J2RGEZ/haskell-do,theam/haskell-do,theam/haskell-do
c75dc872963e5f316380eb436bf8a8da7faac601
src/React.hs
src/React.hs
-- Module : React -- Copyright : (C) 2014-15 Joel Burget -- License : MIT -- Maintainer : Joel Burget <joelburget@gmail.com> -- Stability : experimental -- Portability : non-portable module React ( module X -- React.Class , ReactClass() , ClassConfig(..) , smartClass , dumb...
-- Module : React -- Copyright : (C) 2014-15 Joel Burget -- License : MIT -- Maintainer : Joel Burget <joelburget@gmail.com> -- Stability : experimental -- Portability : non-portable module React ( -- * Classes ReactClass() , ClassConfig(..) , smartClass , dumbClass -...
Clean up import list for haddocks.
Clean up import list for haddocks.
Haskell
mit
seanhess/react-haskell,joelburget/react-haskell,silky/react-haskell,silky/react-haskell,joelburget/react-haskell,adarqui/react-haskell,adarqui/react-haskell,joelburget/react-haskell,adarqui/react-haskell,seanhess/react-haskell,silky/react-haskell,seanhess/react-haskell
c1107b767c48ca80a0a24c9b80d1c333815c49db
test/Spec.hs
test/Spec.hs
{-# LANGUAGE ScopedTypeVariables, PartialTypeSignatures #-} module Main where import Streaming.Prelude import Prelude hiding (filter, map, drop) import Test.HUnit import System.Exit import Data.Function ((&)) import Data.Functor.Identity main :: IO () main = do results <- runTestTT tests if (errors results + fail...
{-# LANGUAGE ScopedTypeVariables, PartialTypeSignatures #-} {-# LANGUAGE RebindableSyntax #-} module Main where import Streaming.Prelude import Prelude hiding (filter, map, drop) import qualified Control.Monad.LMonad as L import Test.HUnit import System.IO import Control.Monad.Trans import System.Exit import Data.Func...
Extend test file (broken atm)
Extend test file (broken atm)
Haskell
bsd-3-clause
m0ar/safe-streaming,m0ar/safe-streaming
c607d5709919174826c60071f941ae6bbfe78f04
Test.hs
Test.hs
module Main where import System.Console.HaskLine import System.Console.HaskLine.Monads main :: IO () main = runHaskLineT defaultSettings (loop 0) where loop :: Int -> HaskLineT IO () loop n = do minput <- getHaskLine (show n ++ ":") case minput of Nothing ->...
module Main where import System.Console.HaskLine import System.Console.HaskLine.Monads main :: IO () main = runHaskLineT defaultSettings (loop 0) where loop :: Int -> HaskLineT IO () loop n = do minput <- getHaskLine (show n ++ ":") case minput of Nothing ->...
Add quit command to test program
Add quit command to test program
Haskell
bsd-3-clause
ghc/packages-haskeline,judah/haskeline,ghc/packages-haskeline,judah/haskeline,leroux/packages-haskeline
841025ce62e0539e13bdc8bbfaf0173769c0ca6e
haskell/allergies/Allergies.hs
haskell/allergies/Allergies.hs
module Allergies ( Allergen(..) , allergies , isAllergicTo ) where import Data.Bits (testBit) data Allergen = Eggs | Peanuts | Shellfish | Strawberries | Tomatoes | Chocolate | Pollen | Cats ...
module Allergies ( Allergen(..) , allergies , isAllergicTo ) where import Data.Bits (testBit) data Allergen = Eggs | Peanuts | Shellfish | Strawberries | Tomatoes | Chocolate | Pollen | Cats ...
Use range instead of enumFrom
Use range instead of enumFrom
Haskell
mit
tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions
fcba7b238224719dc5a16c9d20ff83fd97989230
src/Data/Either/Located.hs
src/Data/Either/Located.hs
{-# LANGUAGE FlexibleContexts #-} module Data.Either.Located ( module Data.Either , fromRight, fromLeft ) where import Data.Either import qualified GHC.Err.Located as L fromRight :: L.HasCallStack => Either a b -> b fromRight (Right x) = x fromRight (Left _) = L.error "Either.fromRight: Left" fromLe...
{-# LANGUAGE FlexibleContexts #-} module Data.Either.Located ( module E , fromRight, fromLeft ) where import qualified Data.Either as E import qualified GHC.Err.Located as L fromRight :: L.HasCallStack => Either a b -> b fromRight (Right x) = x fromRight (Left _) = L.error "Either.fromRight: Left" f...
Use a qualified import for GHC 8.2 compatibility
Use a qualified import for GHC 8.2 compatibility It looks like Data.Either exports its own fromLeft and fromRight as of the base included in 8.2
Haskell
bsd-3-clause
gridaphobe/located-base
e4cceaf00b8e5b5eec6fbacbf979aa9fd1b9693f
test/integration/tests/cabal-solver/Main.hs
test/integration/tests/cabal-solver/Main.hs
import StackTest import System.Directory main :: IO () main = do run "cabal" ["sandbox", "init"] stack ["unpack", "acme-dont-1.1"] run "cabal" ["install", "./acme-dont-1.1"] removeDirectoryRecursive "acme-dont-1.1" stack ["init", "--solver"] stack ["build"]
import StackTest import System.Directory main :: IO () main = do run "cabal" ["sandbox", "init"] stack ["unpack", "acme-dont-1.1"] run "cabal" ["install", "./acme-dont-1.1"] removeDirectoryRecursive "acme-dont-1.1" stack ["--install-ghc", "init", "--solver"] stack ["build"]
Fix cabal-solver integration test when solver selects snapshot that uses uninstalled GHC version
Fix cabal-solver integration test when solver selects snapshot that uses uninstalled GHC version
Haskell
bsd-3-clause
deech/stack,juhp/stack,AndreasPK/stack,MichielDerhaeg/stack,Fuuzetsu/stack,MichielDerhaeg/stack,martin-kolinek/stack,AndreasPK/stack,anton-dessiatov/stack,mrkkrp/stack,mrkkrp/stack,deech/stack,juhp/stack,anton-dessiatov/stack,Fuuzetsu/stack,martin-kolinek/stack
9e94f9370cb1baa1373b179f56b56bb771e145ce
hackerrank/PlusMinus.hs
hackerrank/PlusMinus.hs
-- https://www.hackerrank.com/challenges/plus-minus/problem import Control.Exception.Base readInputList :: IO([Int]) readInputList = do listSize <- readLn :: IO Int line <- getLine let inputList = map (read :: String -> Int) $ words line assert (listSize == length inputList) (return inputList) getNumbers :: [...
-- https://www.hackerrank.com/challenges/plus-minus/problem import Control.Exception.Base(assert) import Text.Printf(printf) readInputList :: IO([Int]) readInputList = do listSize <- readLn :: IO Int line <- getLine let inputList = map (read :: String -> Int) $ words line assert (listSize == length inputList) ...
Print each result with 6 decimal places.
Print each result with 6 decimal places.
Haskell
mit
julianespinel/trainning,julianespinel/training,julianespinel/trainning,julianespinel/training,julianespinel/training,julianespinel/training
b66fc778d5ef056169a82fd1785ab5913b48107e
src/Utility.hs
src/Utility.hs
-- | Utility functions and types. module Utility ( -- * Name manipulation uncap , nameTyVar , nameVar ) where import Data.Char -- | Uncapitalise a name. -- -- >>> uncap "Name" -- "name" uncap :: String -> String uncap "" = "" uncap (c:cs) = toLower c:cs -- | Create a name for type v...
-- | Utility functions and types. module Utility ( -- * Name manipulation uncap , nameTyVar , nameVar ) where import Data.Char -- | Uncapitalise a name. -- -- >>> uncap "Name" -- "name" uncap :: String -> String uncap "" = "" uncap (c:cs) = toLower c:cs -- | Create a name for type v...
Use more reasonable type variable names so that the errors look a bit nicer.
Use more reasonable type variable names so that the errors look a bit nicer.
Haskell
bsd-3-clause
vituscze/norri
f6c3c33f64669333d532b1d606180512593361c8
src/Halytics/Monitor.hs
src/Halytics/Monitor.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} module Halytics.Monitor where import GHC.TypeLits data Result a = Result Double class Resultable a where toValue :: [Double] -> Result a data Monitor :: ...
{-# LANGUAGE DataKinds #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} module Halytics.Monitor where import GHC.TypeLits data Result a = Result Double class Resultable a where ...
Use overlappable for Generate instance
Use overlappable for Generate instance
Haskell
bsd-3-clause
nmattia/halytics
83cbb77e05625b143f6ee3c7f024e9563942f25f
src/Main.hs
src/Main.hs
import System.Environment (getArgs) import Control.Monad (forM_) import Text.ParserCombinators.Parsec (spaces, char, chainl1, runParser) import Text.ParserCombinators.Parsec.Number (int) infixOp = do spaces char '+' spaces return (+) expr = chainl1 int infixOp runExpr = runParser expr 0 "<input>" showResult...
import System.Environment (getArgs) import Control.Monad (forM_) import Text.ParserCombinators.Parsec (spaces, char, chainl1, runParser) import Text.ParserCombinators.Parsec.Number (int) infixOp = do spaces char '+' spaces return (+) expr = chainl1 int infixOp runExpr = runParser expr 0 "<input>" showResult...
Use forM_ and pointless expression. HT @bitemyapp
Use forM_ and pointless expression. HT @bitemyapp
Haskell
isc
steshaw/huttons-razor
352733c40828555aaaee1ca23d43c8ac6436a3d4
src/System/OS.hs
src/System/OS.hs
{-# Language BlockArguments #-} {-# Language DerivingStrategies #-} {-# Language GeneralisedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : System.OS -- Copyright : (c) ChaosGroup, 2020 -- License : MIT -- -- Maintainer : daniel.taskoff@...
{-# Language BlockArguments #-} {-# Language DerivingStrategies #-} {-# Language GeneralisedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : System.OS -- Copyright : (c) ChaosGroup, 2020 -- License : MIT -- -- Maintainer : daniel.taskoff@...
Make os a Maybe, because of null pointers
Make os a Maybe, because of null pointers
Haskell
mit
ChaosGroup/system-info