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 |
|---|---|---|---|---|---|---|---|---|---|
901bfd0e167d425eddca44eda64745e867719159 | ivory-examples/examples/Array.hs | ivory-examples/examples/Array.hs | {-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
import Ivory.Interp
import Ivory.Language
import Ivory.Compile.C.CmdlineFrontend
cmodule :: Module
cmodule = package "ArrayExample" $ incl arrayExample
runArrayExample :: IO ()
runArrayExample = runCompiler [cmodule] initialOpts { stdOut = True }
arrayExamp... | {-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
import Ivory.Language
import Ivory.Compile.C.CmdlineFrontend
cmodule :: Module
cmodule = package "ArrayExample" $ incl arrayExample
runArrayExample :: IO ()
runArrayExample = runCompiler [cmodule] initialOpts { stdOut = True }
arrayExample :: Def('[Ref s (Ar... | Remove interpreter import from array examples. | Remove interpreter import from array examples.
| Haskell | bsd-3-clause | GaloisInc/ivory,Hodapp87/ivory,GaloisInc/ivory |
80f1b13ac1edd898fd4067574f26f7a70d78f364 | .xmonad/xmonad.hs | .xmonad/xmonad.hs | import XMonad
import XMonad.Actions.SpawnOn
import XMonad.Hooks.DynamicLog
myWorkspaces = ["web", "editor", "terms", "socials"] ++ ["5..9"]
main = xmonad =<< xmobar myConfig
myConfig = def
{ terminal = "urxvt"
, modMask = mod4Mask
, borderWidth = 3
, workspaces = my... | import XMonad
import XMonad.Actions.SpawnOn
import XMonad.Hooks.DynamicLog
myWorkspaces = ["rambox", "web", "editor", "terms"] ++ ["5..9"]
main = xmonad =<< xmobar myConfig
myConfig = def
{ terminal = "urxvt"
, modMask = mod4Mask
, borderWidth = 3
, workspaces = myW... | Rework workspace order for double monitors | Rework workspace order for double monitors
| Haskell | bsd-3-clause | MattBlack85/dotfiles |
d152f714764f69b9579f928994244442b41c2f0d | test/PrimTypeTests.hs | test/PrimTypeTests.hs | {-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-}
module PrimTypeTests (primTypeTests) where
import TestHelpers
import Control.Parallel.MPI.Storable
import C2HS
primTypeTests :: Rank -> [(String,TestRunnerTest)]
primTypeTests rank =
[ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int))
... | {-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-}
module PrimTypeTests (primTypeTests) where
import TestHelpers
import Control.Parallel.MPI.Storable
import C2HS
primTypeTests :: Rank -> [(String,TestRunnerTest)]
primTypeTests rank =
[ mpiTestCase rank "intMaxBound" (sendRecvSingleValTest (maxBound :: Int))
... | Fix minBound/maxBound test to work with arbitrary number of testing processes | Fix minBound/maxBound test to work with arbitrary number of testing processes
| Haskell | bsd-3-clause | bjpop/haskell-mpi,bjpop/haskell-mpi,bjpop/haskell-mpi |
8077e5a2731d96e0252ca42cc0e75e4d3b19c994 | src/Main.hs | src/Main.hs | module Main where
import Text.Blaze.Svg.Renderer.Utf8 (renderSvg)
import Web.Scotty
import Render
svg drawing = do
setHeader "Content-Type" "image/svg+xml"
setHeader "Vary" "Accept-Encoding"
raw $ renderSvg drawing
main :: IO ()
main = scotty 3000 $ do
get "/" $ file "static/index.html"
post "/draw" $ do... | module Main where
import Text.Blaze.Svg.Renderer.Utf8 (renderSvg)
import Web.Scotty
import Render
import Shapes
import StyleSheet
svg drawing = do
setHeader "Content-Type" "image/svg+xml"
setHeader "Vary" "Accept-Encoding"
raw $ renderSvg drawing
main :: IO ()
main = scotty 3000 $ do
get "/" $ file "static/... | Add back in the demo page | Add back in the demo page
| Haskell | mit | houli/shape-server |
3984b04a2d15972f436844da9240bc2901384454 | src/Main.hs | src/Main.hs | import System.Environment
import Parser
import Eval
import Expr
import Error
main :: IO ()
main = getArgs >>= handleArgs . getFirst
where getFirst args = if null args then "" else head args
handleArgs args = case args of
"--ast" -> putAst
_ -> put... | import Control.Monad (liftM)
import System.Environment
import Parser
import Eval
import Expr
import Error
main :: IO ()
main = getArgs >>= handleArgs . getFirst
where getFirst args = if null args then "" else head args
handleArgs args = case args of
"--ast" -> putAst
... | Add result printing to main | Add result printing to main
| Haskell | mit | apollo-lang/apollo |
002b284269de63504ed3b0c1e22c8ecfd74e78d9 | testsuite/tests/lib/base/T16916.hs | testsuite/tests/lib/base/T16916.hs | module Main where
import Control.Concurrent
import Foreign.C
import GHC.Clock
import GHC.Event
import System.CPUTime
import System.Posix.Types
foreign import ccall unsafe "socket" c_socket ::
CInt -> CInt -> CInt -> IO CInt
makeTestSocketFd :: IO Fd
makeTestSocketFd = do
sockNum <-
c_socke... | module Main where
import Control.Concurrent
import Foreign.C
import GHC.Clock
import GHC.Event
import System.CPUTime
import System.Posix.Types
foreign import ccall unsafe "socket" c_socket ::
CInt -> CInt -> CInt -> IO CInt
makeTestSocketFd :: IO Fd
makeTestSocketFd = do
sockNum <-
c_socke... | Make test 16916 more stable across runs | Make test 16916 more stable across runs
| Haskell | bsd-3-clause | sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc |
c2468004266758a29716a91352b2f3b4ed463bf7 | src/UI.hs | src/UI.hs | module UI where
import Data.Label
import Data.Vector.V2
import Core (BotState, Bullet, botPosition, bulletPosition, World(..))
import Data.String (fromString)
import Text.Blaze.Svg (Svg)
import Text.Blaze.Svg11
import Text.Blaze.Svg11.Attributes
showBoard :: [BotState] -> [Bullet] -> IO ()
showBoard = undefined
re... | {-# LANGUAGE OverloadedStrings #-}
module UI where
import Data.Label
import Data.Vector.V2
import Core (BotState, Bullet, botPosition, bulletPosition, World(..))
import Data.String (fromString)
import Text.Blaze.Svg (Svg)
import Text.Blaze.Svg11
import Text.Blaze.Svg11.Attributes
showBoard :: [BotState] -> [Bullet... | Add directive and removed renderSvg | Add directive and removed renderSvg
Added OverloadedStrings directive and removed renderSvg because of a
name clash
| Haskell | mit | andreyLevushkin/LambdaWars |
c6146d440d92673a0784db9780cd527811be83fd | States/MovingEntity.hs | States/MovingEntity.hs | {-# LANGUAGE TupleSections #-}
module States.MovingEntity where
#include "Gamgine/Utils.cpp"
import Control.Applicative ((<$>))
import qualified Gamgine.Math.Vect as V
import Gamgine.Control (applyIf, (?))
import qualified States.State as ST
import qualified States.GameRunning as GR
import qualified GameData.Level as ... | {-# LANGUAGE TupleSections #-}
module States.MovingEntity where
#include "Gamgine/Utils.cpp"
import Control.Applicative ((<$>))
import qualified Gamgine.Math.Vect as V
import Gamgine.Control ((?))
import qualified States.State as ST
import qualified States.GameRunning as GR
import qualified GameData.Level as LV
import... | Change data type of MoveEntity | Change data type of MoveEntity
| Haskell | bsd-3-clause | dan-t/layers |
994e73ddad73f8c8b2e7bedeee1fc6ee4e6abcd8 | src/Data/Linear.hs | src/Data/Linear.hs | {-# LANGUAGE GADTs#-}
module Data.Linear where
import Prelude (Show(..), Eq(..))
import Data.Bool(Bool(..), bool)
id :: a ⊸ a
id a = a
liftUnit :: a ⊸ () ⊸ a
liftUnit a () = a
flip :: (a ⊸ b ⊸ c ) ⊸ b ⊸ a ⊸ c
flip f b a = f a b
infixr 0 $
($) :: (a ⊸ b) ⊸ a ⊸ b
f $ x = f x
{-# INLINE ($) #-}
(.) :: (b ⊸ c) ⊸ (... | {-# LANGUAGE GADTs#-}
module Data.Linear where
import Prelude (Show(..), Eq(..))
import Data.Bool(Bool(..), bool)
id :: a ⊸ a
id a = a
liftUnit :: a ⊸ () ⊸ a
liftUnit a () = a
flip :: (a ⊸ b ⊸ c ) ⊸ b ⊸ a ⊸ c
flip f b a = f a b
infixr 0 $
($) :: (a ⊸ b) ⊸ a ⊸ b
f $ x = f x
{-# INLINE ($) #-}
(.) :: (b ⊸ c) ⊸ (... | Add linear ++ to toolbox | Add linear ++ to toolbox
| Haskell | bsd-3-clause | m0ar/safe-streaming,m0ar/safe-streaming |
61209edd785674af9c562c9ec26f126daff7bd91 | src/Development/Shake/Language/C/Host/Linux.hs | src/Development/Shake/Language/C/Host/Linux.hs | -- Copyright 2012-2014 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-2014 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... | Use uname -m instead of arch | Use uname -m instead of arch
More portable; coreutils `arch` as an alias for `uname -m` is not available on
all distros (e.g. NixOS).
Fixes #26
| Haskell | apache-2.0 | samplecount/shake-language-c |
8b1f1405d4e9152d777c9f5d629fa2c3d3013051 | test/Spec.hs | test/Spec.hs | import Test.Hspec
-- import Bombastic
main :: IO ()
main = hspec $ do
describe "foo" $ do
it "does something" $ do
(1 :: Integer) `shouldBe` (2 :: Integer)
| import Test.Hspec
import Data.List
import Bombastic
validMap :: [String]
validMap =
[ "######"
, "#S. #"
, "#.S..#"
, "#.. S#"
, "######"
]
main :: IO ()
main = hspec $ do
describe "Map load" $ do
it "valid map loads correctly" $ do
opaque `shouldBe` e... | Add first draft of actual test. | Add first draft of actual test.
| Haskell | bsd-3-clause | ahri/bombastic-hs |
59b058f2a79862c4b4715e1179924a5e31620b02 | Bucketeer/WebServer.hs | Bucketeer/WebServer.hs | {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Bucketeer.WebServer (main) where
import Bucketeer.Persistence (remaining)
import Bucketeer.Types
import Database.Red... | {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Bucketeer.WebServer (main) where
import Bucketeer.Persistence (remaining,
tick,
... | Add POST to tick bucket | Add POST to tick bucket
| Haskell | bsd-2-clause | MichaelXavier/Bucketeer |
ec8e78b0b1b3a2ef2224378822a633e3e0ebfcf1 | distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration/Maintainers.hs | distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration/Maintainers.hs | module Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Maintainers ( globalPackageMaintainers ) where
import Data.Map as Map
import Data.Set as Set
import Distribution.Nixpkgs.Haskell.FromCabal.Configuration
import Control.Lens.Create
globalPackageMaintainers :: Map PackageName (Set Identifier)
globalPackageMain... | module Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Maintainers ( globalPackageMaintainers ) where
import Data.Map as Map
import Data.Set as Set
import Distribution.Nixpkgs.Haskell.FromCabal.Configuration
import Control.Lens.Create
globalPackageMaintainers :: Map PackageName (Set Identifier)
globalPackageMain... | Add myself as a maintainer for git-annex. | Add myself as a maintainer for git-annex.
| Haskell | bsd-3-clause | bennofs/cabal2nix,gridaphobe/cabal2nix,Fuuzetsu/cabal2nix |
47a89283b012a8d3dffb58dc59c80cbfe78efff5 | library/SetGame.hs | library/SetGame.hs | module SetGame where
import SetGame.PlayGame
import System.Random
runGame :: IO [CardSet]
runGame = do
generator <- getStdGen
let initialState = initializeGame generator
(GameState _ _ finalSets) = playRounds initialState
return finalSets
| module SetGame where
import SetGame.PlayGame
import System.Random
runGame :: IO [CardSet]
runGame = do
generator <- getStdGen
let initialState = initializeGame generator
(GameState _ _ finalSets) = playRounds initialState
let (_, newGenerator) = split generator
setStdGen newGenerator
... | Split StdGen between rounds of rungame so we don't get locked with same results | Split StdGen between rounds of rungame so we don't get locked with same results
| Haskell | mit | cmwilhelm/setGame,cmwilhelm/setGame,cmwilhelm/setGame |
66b5eba72d6fb2e018cea7bb754b3954eee16b0b | src/Main.hs | src/Main.hs | {-# LANGUAGE RecursiveDo, ScopedTypeVariables, FlexibleContexts, TupleSections, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}
import Rules
import Common.DomUtil
import Types
import Player.Dom
import Errors.Dom
import Style
import Settings.Dom
import Reflex.Dom.Main as M
import Reflex.Dom
import Cont... | {-# LANGUAGE RecursiveDo, ScopedTypeVariables, FlexibleContexts, TupleSections, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings, CPP #-}
import Rules
import Common.DomUtil
import Types
import Player.Dom
import Errors.Dom
import Style
import Settings.Dom
import Reflex.Dom.Main as M
import Reflex.Dom
import... | Make it compile with ghcjs | Make it compile with ghcjs
| Haskell | mit | martin-kolinek/some-board-game |
48bb03610c15b263b6eb32e0bb7ef2f3de699ecb | Databrary/Controller/Audit.hs | Databrary/Controller/Audit.hs | {-# LANGUAGE OverloadedStrings #-}
module Databrary.Controller.Audit
( viewActivity
) where
import Control.Arrow (second)
import Data.Ord (comparing)
import Databrary.Ops
import qualified Databrary.JSON as JSON
import Databrary.Model.VolumeAccess
import Databrary.Model.Authorize
import Databrary.Model.Party
impor... | {-# LANGUAGE OverloadedStrings #-}
module Databrary.Controller.Audit
( viewActivity
) where
import Control.Arrow (second)
import Data.Function (on)
import Data.List (nubBy)
import Data.Ord (comparing)
import Databrary.Ops
import qualified Databrary.JSON as JSON
import Databrary.Model.Party
import Databrary.Model.... | Remove duplicates from news feed | Remove duplicates from news feed
Fixes #3515
| Haskell | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
ba7fb17251b7373f75945b4db17fc2e32055c5fd | Tests/PubKey.hs | Tests/PubKey.hs | module Tests.PubKey
( arbitraryRSAPair
) where
import Test.QuickCheck
import qualified Crypto.Random.AESCtr as RNG
import qualified Crypto.Cipher.RSA as RSA
import qualified Data.ByteString as B
arbitraryRSAPair :: Gen (RSA.PublicKey, RSA.PrivateKey)
arbitraryRSAPair = do
rng <- (either (error . show) id . RNG.m... | module Tests.PubKey
( arbitraryRSAPair
, globalRSAPair
, getGlobalRSAPair
) where
import Test.QuickCheck
import qualified Crypto.Random.AESCtr as RNG
import qualified Crypto.Cipher.RSA as RSA
import qualified Data.ByteString as B
import Control.Concurrent.MVar
import System.IO.Unsafe
arbitraryRSAPair :: Gen (R... | Add a RSA keypair cache through a global variable. | Add a RSA keypair cache through a global variable.
Prevent the RSA key generation to be done for each tests.
| Haskell | bsd-3-clause | lancelotsix/hs-tls,erikd/hs-tls,beni55/hs-tls,beni55/hs-tls,erikd/hs-tls,AaronFriel/hs-tls,tolysz/hs-tls,tolysz/hs-tls,AaronFriel/hs-tls,lancelotsix/hs-tls |
6924e569b9862aaffe43a0d868fb15e914e5209a | Dmenu.hs | Dmenu.hs | module XMonadContrib.Dmenu (dmenu, dmenuXinerama, runProcessWithInput) where
import XMonad
import qualified StackSet as W
import System.Process
import System.IO
import Control.Monad
import Control.Monad.State
import Data.Maybe
import qualified Data.Map as M
runProcessWithInput :: FilePath -> [String] -> String -> IO ... | module XMonadContrib.Dmenu (dmenu, dmenuXinerama, runProcessWithInput) where
import XMonad
import qualified StackSet as W
import System.Process
import System.IO
import Control.Monad
import Control.Monad.State
import Data.Maybe
import qualified Data.Map as M
runProcessWithInput :: FilePath -> [String] -> String -> IO ... | Put dmenu in X too | Put dmenu in X too
darcs-hash:20070503053727-a5988-b8529a73c0dc6ae32f9683c1b34784223d2c063c
| Haskell | bsd-3-clause | kmels/xmonad-launcher,kmels/xmonad-launcher |
78cea3cf41ed58ac5c9112c8c2248e31ee8b1b40 | Setup.hs | Setup.hs | import Distribution.Simple
import System.Exit (ExitCode (..))
import System.Process (waitForProcess, runProcess)
import System.Directory (getAppUserDataDirectory)
main = defaultMainWithHooks $ simpleUserHooks {postInst = buildHasteStdLib}
-- The Haste standard library needs to be built so users can link to it.
buildH... | import Distribution.Simple
import System.Exit (ExitCode (..))
import System.Process (waitForProcess, runProcess)
import System.Directory (getAppUserDataDirectory)
main = defaultMainWithHooks $ simpleUserHooks {postInst = buildHasteStdLib}
-- The Haste standard library needs to be built so users can link to it.
buildH... | Build the standard library with -Wall | Build the standard library with -Wall
| Haskell | bsd-3-clause | jtojnar/haste-compiler,santolucito/haste-compiler,joelburget/haste-compiler,santolucito/haste-compiler,akru/haste-compiler,jtojnar/haste-compiler,szatkus/haste-compiler,crodjer/haste-compiler,akru/haste-compiler,kranich/haste-compiler,nyson/haste-compiler,kranich/haste-compiler,jtojnar/haste-compiler,joelburget/haste-c... |
9fe680cfc97096893d7e377a37580e6f851fbe2b | src-lib/Control/Monad/Errors/Class.hs | src-lib/Control/Monad/Errors/Class.hs | {-# LANGUAGE NoMonomorphismRestriction, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}
module Control.Monad.Errors.Class
( MonadErrors (..)
, module Control.Monad.Error.Class
) where
import Control.Monad.Error.Class
import Data.Monoid
import Control.Monad.Writer
import... | {-# LANGUAGE NoMonomorphismRestriction, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}
module Control.Monad.Errors.Class
( MonadErrors (..)
, module Control.Monad.Error.Class
) where
import Control.Monad.Error.Class
import Data.Monoid
import Control.Monad.Writer(Writer... | Reduce cosmetic differences between instances | Reduce cosmetic differences between instances
recover for StateT is actually different, so it's good if it looks
different.
| Haskell | bsd-3-clause | Blaisorblade/pts,Toxaris/pts |
925ec67b82ed563741b0e8399b17335e737c4721 | 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 = shakeTest_ test $ forwardRule $ do
let obj = id
let src = root </> "src/Test/C"
cs <- getDirectoryFiles src ["*.c"]
os <- forP... |
module Test.Forward(main) where
import Development.Shake
import Development.Shake.Forward
import Development.Shake.FilePath
import Control.Monad.Extra
import Test.Type
main = shakeTest_ test $ forwardRule $ do
let src = root </> "src/Test/C"
cs <- getDirectoryFiles src ["*.c"]
os <- forP cs $ \c -> do
... | Delete obj = id from forward | Delete obj = id from forward
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
8ce85f0fe3686ebd603985454ceec1003f00624b | src/Test/Hspec/Compat.hs | src/Test/Hspec/Compat.hs | {-# LANGUAGE CPP #-}
module Test.Hspec.Compat where
import Data.Typeable (Typeable, typeOf, typeRepTyCon)
#if MIN_VERSION_base(4,5,0)
import Data.Typeable (tyConModule, tyConName)
#endif
showType :: Typeable a => a -> String
showType a = let t = typeRepTyCon (typeOf a) in
#if MIN_VERSION_base(4,... | {-# LANGUAGE CPP #-}
module Test.Hspec.Compat where
import Data.Typeable (Typeable, typeOf, typeRepTyCon)
#if MIN_VERSION_base(4,4,0)
import Data.Typeable.Internal (tyConModule, tyConName)
#endif
showType :: Typeable a => a -> String
showType a = let t = typeRepTyCon (typeOf a) in
#if MIN_VERSIO... | Make sure that full exception type is printed with base-4.4.* | Make sure that full exception type is printed with base-4.4.*
| Haskell | mit | hspec/hspec,beni55/hspec |
ba4e13e13aeef04e876b7633b1c3b1310119f53b | src/HSE/Eq.hs | src/HSE/Eq.hs |
module HSE.Eq(eqExpShell) where
import HSE.Type
import HSE.Util
import Data.Function
eqExpShell :: Exp_ -> Exp_ -> Bool
eqExpShell x y = eqExpShellFast x y && eqExpShellSlow x y
eqExpShellFast x y = f (show x) (show y)
where f (x:xs) (y:ys) | x == y = x == ' ' || f xs ys
f [] [] = True
f _... |
module HSE.Eq(eqExpShell) where
import HSE.Type
import HSE.Util
import Data.Function
import Data.Data
eqExpShell :: Exp_ -> Exp_ -> Bool
eqExpShell x y = eqExpShellFast x y && eqExpShellSlow x y
eqExpShellFast x y = toConstr x == toConstr y
eqExpShellSlow = (==) `on` descend (const $ Do an [])
| Improve the shell eq test, now uses SYB to do the constructor equality test | Improve the shell eq test, now uses SYB to do the constructor equality test | Haskell | bsd-3-clause | mpickering/hlint,eigengrau/hlint,ndmitchell/hlint,gibiansky/hlint,ndmitchell/hlint,bitemyapp/hlint |
f9091b53f97b6ba20a94bdf20fa081ebd3a0d6e8 | src/Input/Reorder.hs | src/Input/Reorder.hs | {-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-}
module Input.Reorder(reorderItems) where
import Input.Item
import Data.List.Extra
import Data.Maybe
import Data.Tuple.Extra
-- | Reorder items so the most popular ones are first, using reverse dependencies
reorderItems :: (String -> Int) -> [(a, Item)] -> ... | {-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-}
module Input.Reorder(reorderItems) where
import Input.Item
import Data.List.Extra
import Data.Maybe
import Data.Tuple.Extra
-- | Reorder items so the most popular ones are first, using reverse dependencies
reorderItems :: (String -> Int) -> [(a, Item)] -> ... | Make reorder take at least some time, by forcing its output | Make reorder take at least some time, by forcing its output
| Haskell | bsd-3-clause | wolftune/hoogle,wolftune/hoogle,wolftune/hoogle,ndmitchell/hoogle,ndmitchell/hoogle,wolftune/hoogle,ndmitchell/hoogle |
d5d38f31fcb5d6df9a003d767c0cefde3bb76f88 | foldl-benchmark/Main.hs | foldl-benchmark/Main.hs | module Main where
import Prelude
import Criterion
import Criterion.Main
import qualified Control.Foldl as A
import qualified Data.Vector as F
import qualified VectorBuilder.Builder as N
import qualified VectorBuilder.Vector as O
main =
defaultMain [group 100, group 10000, group 1000000]
where
group size =
... | module Main where
import Prelude
import Criterion
import Criterion.Main
import qualified Control.Foldl as A
import qualified Data.Vector as F
import qualified VectorBuilder.Builder as N
import qualified VectorBuilder.Vector as O
main =
defaultMain [group 1000, group 10000, group 100000, group 1000000, group 100000... | Cover more sizes in the benchmarks | Cover more sizes in the benchmarks
| Haskell | mit | nikita-volkov/vector-builder |
3be69a808b0886d87c13929555cf1c5b85ce0e2f | src/Tinc/Package.hs | src/Tinc/Package.hs | module Tinc.Package where
import Data.List
data Package
= Package {
packageName :: String,
packageVersion :: String
}
deriving (Eq, Ord, Show)
showPackage :: Package -> String
showPackage (Package name version) = name ++ "-" ++ version
parsePackage :: String -> Package
parsePackage s = case ... | {-# LANGUAGE ViewPatterns #-}
module Tinc.Package where
import Data.List
data Package
= Package {
packageName :: String,
packageVersion :: String
}
deriving (Eq, Ord, Show)
showPackage :: Package -> String
showPackage (Package name version) = name ++ "-" ++ version
parsePackage :: String -> ... | Handle the situation when our desired sandbox is empty | Handle the situation when our desired sandbox is empty
| Haskell | unknown | haskell-tinc/tinc,beni55/tinc,zalora/tinc,sol/tinc,robbinch/tinc |
b612301470da37fdba540ca2f18b54d5b6dea29f | mosaic/AtkeyScript.hs | mosaic/AtkeyScript.hs | -- this mosaic explores the way laid out by Robert Atkey in
-- http://bentnib.org/posts/2015-04-19-algebraic-approach-typechecking-and-elaboration.html
{-# LANGUAGE TypeOperators #-}
import Control.Monad
data Type = A | B | C | Type :-> Type deriving (Eq, Show)
infixr 9 :->
type TypeChecker = [Type] -> Maybe Type... | -- this mosaic explores the way laid out by Robert Atkey in
-- http://bentnib.org/posts/2015-04-19-algebraic-approach-typechecking-and-elaboration.html
{-# LANGUAGE TypeOperators #-}
import Control.Monad
data Type = A | B | C | Type :-> Type deriving (Eq, Show)
infixr 9 :->
type TypeChecker = [Type] -> Maybe Type... | Fix two ugly bugs in the checker | Fix two ugly bugs in the checker
Look:
*Main> typeCheck (Lam A (Lam (A :-> A :-> B) $ Var 0 `App` Var 1 `App` Var 1)) []
Just (A :-> ((A :-> (A :-> B)) :-> B))
| Haskell | bsd-3-clause | cartazio/omega,minad/omega |
bc8d497679fa54ba3f22588c134cc901be61850a | haskell/hw5.hs | haskell/hw5.hs | -- See https://github.com/Jakehp/PLC/blob/master/pdfs/hwk5.pdf
is_member :: (Eq a) => [a] -> a -> Bool
is_member l x = foldl (\hasBeenFound e -> if not hasBeenFound then x == e else hasBeenFound) False l
split_string_list = [' ','.',';','?',':','!','\t', '\n']
removeFirstSymbols :: [Char] -> [Char]
removeFirstSymbol... | -- See https://github.com/Jakehp/PLC/blob/master/pdfs/hwk5.pdf
is_member :: (Eq a) => [a] -> a -> Bool
is_member l x = foldl (\hasBeenFound e -> if not hasBeenFound then x == e else hasBeenFound) False l
split_string_list = [' ','.',';','?',':','!','\t', '\n']
removeFirstSymbols :: [Char] -> [Char]
removeFirstSymbol... | Convert removeFirstSymbols to use fold left. | Convert removeFirstSymbols to use fold left.
| Haskell | mit | Jakehp/PLC |
2456eee18a86f2d38fa6d1fe843508cd9ef6cc01 | src/Config.hs | src/Config.hs | {-# LANGUAGE OverloadedStrings #-}
module Config where
import Data.ByteString
import Data.ByteString.Char8 ()
import Data.Text (Text)
import Database.HDBC.MySQL
isDeveloperMode :: Bool
isDeveloperMode = True
adminLogin :: ByteString
adminLogin = "admin"
adminPassword :: ByteString
adminPassword = "admin"
domain ::... | {-# LANGUAGE OverloadedStrings #-}
module Config where
import Data.ByteString
import Data.ByteString.Char8 ()
import Data.Text (Text)
import Database.HDBC.MySQL
isDeveloperMode :: Bool
isDeveloperMode = False
adminLogin :: ByteString
adminLogin = "admin"
adminPassword :: ByteString
adminPassword = "admin"
domain :... | Set developermode off in production | Set developermode off in production
| Haskell | bsd-2-clause | dikmax/haskell-blog,dikmax/haskell-blog,dikmax/haskell-blog |
6fbabdea766f0955c7272916ccf8fa00c535af28 | p0071/p0071.hs | p0071/p0071.hs | import Data.List
import Data.Ratio
import Data.Function
main = print answer
closestTo f den = let denF = denominator f
numF = numerator f
in ((numF * den) - 1 `div` denF) % den
closestToUpTo f denMax = map (closestTo f) [2..denMax]
minDiffClosestTo f denMax = minimumBy (compa... | import Data.List
import Data.Ratio
import Data.Function
main = print answer
closestTo f den = let denF = denominator f
numF = numerator f
in ((numF * den - 1) `div` denF) % den
closestToUpTo f denMax = map (closestTo f) [2..denMax]
minDiffClosestTo f denMax = minimumBy (compa... | Fix solution to problem 71 | Fix solution to problem 71
| Haskell | mit | arekfu/project_euler |
ae0607850c57ea87b10324b5a545f38d10817543 | src/Site.hs | src/Site.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Site where
import Control.Lens
import Snap
import CharDatabase
import EncodingTable
import WebUi
import RestApi
data App = App
{ _charDatabase :: Snaplet CharDatabase
, _encodingTable :: Snaplet Encodin... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
module Site where
import Control.Lens
import Snap
import CharDatabase
import EncodingTable
import WebUi
import RestApi
data App = App
{ _charDatabase :: Snaplet CharDatabase
, _encodingTable :: Snaplet Encodin... | Move the route `/wui` to `/web`. | Move the route `/wui` to `/web`.
| Haskell | bsd-3-clause | g0v/encoding-mashup-server,g0v/encoding-mashup-server,g0v/encoding-mashup-server |
89444aac484f75389edf4b74d464709e87e80968 | src/Hyakko/Types.hs | src/Hyakko/Types.hs | {-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-}
module Hyakko.Types where
import Control.Applicative ((<$>), (<*>), empty)
import Data.Aeson
import Data.HashMap.Strict (HashMap)
import Data.Text (Text)
import System.Console.CmdArgs
-- The `Sections` type is just an alias to keep type signatures short.
type Se... | {-# LANGUAGE OverloadedStrings #-}
module Hyakko.Types where
import Control.Applicative ((<$>), (<*>), empty)
import Data.Aeson
import Data.HashMap.Strict (HashMap)
import Data.Text (Text)
-- The `Sections` type is just an alias to keep type signatures short.
type Sections = [HashMap String Text]
-- Alias `Language... | Remove dervived types coming from cmdargs | Remove dervived types coming from cmdargs
| Haskell | mit | sourrust/hyakko |
540c8d764e4c11ba4b64912fd91d3cb3becafda1 | test/Data/String/StripSpec.hs | test/Data/String/StripSpec.hs | module Data.String.StripSpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Data.String.Strip
-- `main` is here so that this module can be run from GHCi on its own. It is
-- not needed for automatic spec discovery.
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "week1" $ do
... | module Data.String.StripSpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Data.String.Strip
-- `main` is here so that this module can be run from GHCi on its own. It is
-- not needed for automatic spec discovery.
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "week1:checkpo... | Modify tag to make it easier to parse | Modify tag to make it easier to parse
| Haskell | mit | jxv/cis-194-winter-2016 |
fb7b265973a97b9ceb04fd9b936cea6504b2dd6c | test/Iptf/Hosts_Test.hs | test/Iptf/Hosts_Test.hs | {-# LANGUAGE OverloadedStrings #-}
module Iptf.Internal.Hosts_Test where
import Iptf.Hosts.Internal
import Iptf.Ip.Internal
import Test.HUnit
testHosts :: Test
testHosts = TestList [getHostsTest]
getHostsTest :: Test
getHostsTest = TestCase $ assertEqual
"One IP and Host"... | {-# LANGUAGE OverloadedStrings #-}
module Iptf.Hosts_Test where
import Iptf.Hosts.Internal
import Iptf.Ip.Internal
import Test.HUnit
testHosts :: Test
testHosts = TestList [getHostsTest]
getHostsTest :: Test
getHostsTest = TestCase $ assertEqual
"One IP and Host"
... | Remove "Internal" from hosts test module | Remove "Internal" from hosts test module
| Haskell | mit | werbitt/ip-to-file |
44d261a19032ed42cd2482f6d944f401efc45e15 | Euler94.hs | Euler94.hs | import Math.NumberTheory.Powers.Squares (isSquare)
import Control.Parallel.Strategies
type Triangle = (Integer, Integer, Integer)
perimeter :: Triangle -> Integer
perimeter (a, b, c) = a + b + c
isAlmostEquilateral :: Triangle -> Bool
isAlmostEquilateral t@(a, b, c) =
let s2 = perimeter t -- Two times s
... | import Math.NumberTheory.Powers.Squares (isSquare)
import Control.Parallel.Strategies
type Triangle = (Integer, Integer, Integer)
perimeter :: Triangle -> Integer
perimeter (a, b, c) = a + b + c
isAlmostEquilateral :: Triangle -> Bool
isAlmostEquilateral t@(a, b, c) =
let s2 = perimeter t -- Two times s
... | Improve 94 speed by 2 | Improve 94 speed by 2
| Haskell | apache-2.0 | ulikoehler/ProjectEuler,ulikoehler/ProjectEuler |
d1a7e14c2add0ac09f01e8300f468d53cf3fc908 | XMonad/Config/Desktop.hs | XMonad/Config/Desktop.hs | {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Config.Desktop
-- Copyright : (c) Spencer Janssen <sjanssen@cse.unl.edu>
-- License : BSD
--
-- Maintainer : Spencer Janssen <sjanssen@cse.unl.edu>
--
-... | {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Config.Desktop
-- Copyright : (c) Spencer Janssen <sjanssen@cse.unl.edu>
-- License : BSD
--
-- Maintainer : Spencer Janssen <sjanssen@cse.unl.edu>
--
-... | Add ToggleStruts to the desktop config | Add ToggleStruts to the desktop config
| Haskell | bsd-3-clause | reenberg/XMonadContrib,reenberg/XMonadContrib |
b3a89cf7b9e6cfe30bcd1f472e744d0369a1398b | analysis-app/src/DataAnalysis/Application/Prelude.hs | analysis-app/src/DataAnalysis/Application/Prelude.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module DataAnalysis.Application.Prelude
(runAnalysisApp)
where
import Data.Proxy (Proxy)
import Data.Text (Text)
import Yesod
import Yesod.Static
#ifdef FPHC
... | {-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module DataAnalysis.Application.Prelude
(runAnalysisApp)
where
import Data.Proxy (Proxy)
import Data.Text (Text)
import Yesod
import Yesod.Static
import DataA... | Make sure ifdef'd imports come last | Make sure ifdef'd imports come last | Haskell | mit | teuffy/min-var-ci,teuffy/min-var-ci |
b2d6e8b7367d91989d2f3a7602e37145240df551 | cabal-install/Hackage/Utils.hs | cabal-install/Hackage/Utils.hs | module Hackage.Utils where
import Distribution.Package
( Dependency(..) )
import Distribution.Text
( display )
import Distribution.Simple.Utils (intercalate)
import Control.Monad (guard)
import Control.Exception (Exception, catchJust, ioErrors)
import System.IO.Error (isDoesNotExistError)
readFileI... | module Hackage.Utils where
import Distribution.Package
( Dependency(..) )
import Distribution.Text
( display )
import Distribution.Simple.Utils (intercalate)
import Data.List
( sortBy, groupBy )
import Control.Monad (guard)
import Control.Exception (Exception, catchJust, ioErrors)
import Sy... | Add new utils, duplicates, duplicatesBy and mergeBy | Add new utils, duplicates, duplicatesBy and mergeBy
| Haskell | bsd-3-clause | IreneKnapp/Faction,IreneKnapp/Faction |
07d3751356fa07f0754ba490862bb52529056f7e | examples/example0003-classification.hs | examples/example0003-classification.hs | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
import SubHask
import SubHask.Algebra.Array
import SubHask.Algebra.Vector
import SubHask.Algebra.Container
import HLearn.Dat... | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
import SubHask
import SubHask.Algebra.Array
import SubHask.Algebra.Vector
import SubHask.Algebra.Container
import HLearn.Dat... | Change csv path in example0003 to relative path. | Change csv path in example0003 to relative path.
| Haskell | bsd-3-clause | arnabgho/HLearn,arnabgho/HLearn,arnabgho/HLearn,arnabgho/HLearn,mikeizbicki/HLearn,mikeizbicki/HLearn,arnabgho/HLearn,mikeizbicki/HLearn,mikeizbicki/HLearn,elkingtonmcb/HLearn,arnabgho/HLearn,mikeizbicki/HLearn,mikeizbicki/HLearn,elkingtonmcb/HLearn,elkingtonmcb/HLearn,elkingtonmcb/HLearn,elkingtonmcb/HLearn,elkingtonm... |
94c7386431c85b2bd9c6d36322f2ea81406137fc | src/Test/Util.hs | src/Test/Util.hs | module Test.Util where
import Control.Applicative
import System.Directory
import System.Process.Extra
-- Path to the fay executable, looks in cabal-dev, dist, PATH in that order.
fayPath :: IO (Maybe FilePath)
fayPath = do
cabalDev <- doesFileExist cabalDevPath
if cabalDev
then r... | module Test.Util where
import Control.Applicative
import System.Directory
import System.Process.Extra
-- Path to the fay executable, looks in cabal-dev, dist, PATH in that order.
fayPath :: IO (Maybe FilePath)
fayPath = do
cabalDev <- doesFileExist cabalDevPath
if cabalDev
then r... | Fix bugs in fayPath test util | Fix bugs in fayPath test util
| Haskell | bsd-3-clause | fpco/fay,beni55/fay,beni55/fay,fpco/fay |
58831cbf3855ce7548b2755a1232fa3610ff4dbf | src/HaskellWorks/Data/Json/Internal/Words.hs | src/HaskellWorks/Data/Json/Internal/Words.hs | module HaskellWorks.Data.Json.Internal.Words where
import Data.Word
import Data.Word8
isLeadingDigit :: Word8 -> Bool
isLeadingDigit w = w == _hyphen || (w >= _0 && w <= _9)
isTrailingDigit :: Word8 -> Bool
isTrailingDigit w = w == _plus || w == _hyphen || (w >= _0 && w <= _9) || w == _period || w == _E || w == _e
... | module HaskellWorks.Data.Json.Internal.Words where
import Data.Char
import Data.Word
import Data.Word8
isLeadingDigit :: Word8 -> Bool
isLeadingDigit w = w == _hyphen || (w >= _0 && w <= _9)
isTrailingDigit :: Word8 -> Bool
isTrailingDigit w = w == _plus || w == _hyphen || (w >= _0 && w <= _9) || w == _period || w =... | Define some useful Word8 constants | Define some useful Word8 constants
| Haskell | bsd-3-clause | haskell-works/hw-json |
d06f74066fea6058d9fa64e171d8c55bec4d61df | src/TimeSeriesData/Retrieve.hs | src/TimeSeriesData/Retrieve.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module TimeSeriesData.Retrieve where
import Servant
import Servant.Client
import Control.Monad.Trans.Either
import Data.List (nub)
import Data.ByteString (ByteString)
import TimeSeriesData.Types
import Time
getTSData :: Stri... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module TimeSeriesData.Retrieve where
import Servant
import Servant.Client
import Control.Monad.Trans.Either
import Data.List (nub)
import Data.ByteString (ByteString)
import TimeSeriesData.Types
import Time
getTSData :: Stri... | Fix wrong order of args in diffUTCTime | Fix wrong order of args in diffUTCTime
| Haskell | bsd-3-clause | hectorhon/autotrace2,hectorhon/autotrace2 |
e445ac24bebd91e56692f03f690d23771ea11a2b | src/Beautifier.hs | src/Beautifier.hs | module Beautifier(beautify) where
import Datatypes
beautify :: Program -> Program
beautify (Program statements) =
Program (map beautifyStatement statements)
beautifyStatement :: Statement -> Statement
beautifyStatement (AssignmentStatement (Assignment lefthand assignmentOperator oldExpression)) =
let expression... | module Beautifier(beautify) where
import Datatypes
beautify :: Program -> Program
beautify (Program statements) =
Program (map beautifyStatement statements)
beautifyStatement :: Statement -> Statement
beautifyStatement statement@(AssignmentStatement (Assignment lefthand assignmentOperator oldExpression)) =
let ... | Use handy @ syntax for labeled destructuring | Use handy @ syntax for labeled destructuring
| Haskell | mit | aleksanb/hdc |
c95fbf95e7ec5858316046d2d7babe92f4bef401 | src/Test/Cache.hs | src/Test/Cache.hs |
module Test.Cache(main) where
import Development.Shake
import Development.Shake.FilePath
import Data.Char
import Test.Type
main = shakeTest_ test $ do
let obj = id
vowels <- newCache $ \file -> do
src <- readFile' file
liftIO $ appendFile (obj "trace.txt") "1"
return $ length $ filte... |
module Test.Cache(main) where
import Development.Shake
import Development.Shake.FilePath
import Data.Char
import Test.Type
main = shakeTest_ test $ do
vowels <- newCache $ \file -> do
src <- readFile' file
liftIO $ appendFile "trace.txt" "1"
return $ length $ filter isDigit src
"*.ou... | Delete obj = id in cache | Delete obj = id in cache
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
008bc06e42609037ea84ac54db4924e90c25635e | src/Query.hs | src/Query.hs | {-# LANGUAGE PatternGuards #-}
module Query(Query(..), Restrict(..), parseQuery, parseRestrict) where
import Data.List
import Data.Tuple.Extra
import Language.Haskell.Exts
import Control.Monad
import Data.Monoid
data Query = Query [Restrict] [String] (Maybe Type) deriving (Show,Eq)
instance Monoid Query where
... | {-# LANGUAGE PatternGuards #-}
module Query(Query(..), Restrict(..), parseQuery, parseRestrict) where
import Data.List
import Data.Tuple.Extra
import Language.Haskell.Exts
import Control.Monad
import Data.Monoid
---------------------------------------------------------------------
-- DATA TYPE
data Query = Query [R... | Add sections in the query module | Add sections in the query module
| Haskell | bsd-3-clause | wolftune/hoogle,wolftune/hoogle,BartAdv/hoogle,BartAdv/hoogle,ndmitchell/hoogle,ndmitchell/hoogle,wolftune/hoogle,ndmitchell/hogle-dead,BartAdv/hoogle,BartAdv/hoogle,wolftune/hoogle,ndmitchell/hoogle,ndmitchell/hogle-dead |
e20cb206bec7d5c7e1d304036d75b2ac398976af | day12/day12.hs | day12/day12.hs | import qualified Data.ByteString as B
import Data.Aeson
import Data.Scientific
import qualified Data.HashMap.Strict as HM
import Data.Maybe (fromMaybe)
main :: IO ()
main = do
input <- B.readFile "input.txt"
let decoded = fromMaybe (error "Could not parse") $ decodeStrict input
print $ addDigits decoded
a... | {-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString as B
import Data.Aeson
import Data.Scientific
import qualified Data.HashMap.Strict as HM
import Data.Maybe (fromMaybe)
main :: IO ()
main = do
input <- B.readFile "input.txt"
let decoded = fromMaybe (error "Could not parse") $ decodeStrict inp... | Complete Day 12 Part 2 | Complete Day 12 Part 2
| Haskell | mit | devonhollowood/adventofcode,devonhollowood/adventofcode |
2301c815d614b84fd86bb0aa5d2637913b7b68fe | Main.hs | Main.hs | module Main where
import qualified Parser
import qualified Text.Parsec as Parsec
main :: IO ()
main = do
c <- getContents
putStrLn $ show $ Parsec.parse Parser.cueSheet "stdin" c
| module Main where
import qualified Parser
import qualified Text.Parsec as Parsec
import System.Exit
main :: IO ()
main = do
c <- getContents
case Parsec.parse Parser.cueSheet "stdin" c of
(Left e) -> putStrLn ("Error while parsing:\n" ++ show e) >> exitFailure
(Right r) -> putStrLn $ show r ++ "--- END --... | Update main to print a parseable output | Update main to print a parseable output
| Haskell | mit | rwoll-hmc/project |
18c18d91fc067fe1010228d4340288e8542e04db | src/Input/Download.hs | src/Input/Download.hs | {-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} -- Use conduitManagerSettings to work with http-conduit-2.1.6 and below
module Input.Download(downloadInput) where
import System.FilePath
import Control.Monad.Extra
import System.Directory
import Data.Conduit.Binary (sinkFile)
import q... | {-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} -- Use conduitManagerSettings to work with http-conduit-2.1.6 and below
module Input.Download(downloadInput) where
import System.FilePath
import Control.Monad.Extra
import System.Directory
import Data.Conduit.Binary (sinkFile)
import q... | Use the recommended URL parsing function | Use the recommended URL parsing function
| Haskell | bsd-3-clause | ndmitchell/hoogle,ndmitchell/hoogle,ndmitchell/hoogle |
e465776f5acc29f2ebee9ca89f3fe3bbd7f72ede | tests/FileIO.hs | tests/FileIO.hs | import Control.Concurrent.MVar
import Control.Exception
import Data.IORef
import Foreign.C.Error (throwErrnoIfMinus1Retry_)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Storable
import System.Directory
import System.Event
import System.IO
import System.Posix.IO
import System.Posix.Internals (c_close, c_read, c_... | import Control.Concurrent.MVar
import Control.Exception
import Data.IORef
import Foreign.C.Error (throwErrnoIfMinus1Retry_)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Storable
import System.Directory
import System.Event
import System.IO
import System.Posix.IO
import System.Posix.Internals (c_close, c_read, c_... | Make the file I/O test a little safer. | Make the file I/O test a little safer.
| Haskell | bsd-2-clause | tibbe/event,tibbe/event,tibbe/event |
c56eab8779c09908cb617526bb74a71c7b8ba3b0 | src/Main.hs | src/Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Scotty
main = do
putStrLn "Starting server..."
scotty 3000 $ do
get "/hello" $ do
text "Hello world!"
| {-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Scotty
main :: IO ()
main = do
putStrLn "Starting server..."
scotty 3000 routes
routes :: ScottyM ()
routes = do
get "/hello" sayHello
sayHello :: ActionM()
sayHello = do
text "Hello!"
| Break down into smaller functions | Break down into smaller functions
| Haskell | mit | mikegehard/haskell-api |
615dc4683933a61efcb072a0b4216041b884e22c | Main.hs | Main.hs | module Main where
import Regex
main :: IO ()
main = print $ matches regex "aabbc"
where regex = Seq (Seq (Kleene (Symbol 'a')) (Kleene (Symbol 'b'))) (Kleene (Symbol 'c'))
| module Main where
import System.Environment
import Parse
import Regex
main :: IO ()
main = do
args <- getArgs
case length args of
2 -> case parseRegex $ head args of
Left err -> print err
Right reg -> print $ matches reg $ head $ tail args
_ -> print "Wrong numb... | Refactor main to take command line arguments | Refactor main to take command line arguments
| Haskell | bsd-2-clause | eneas193933/regex-derivatives,dwnusbaum/regex-derivatives |
a235df66ef08bc2438aa18dcf5edcda7e07950fd | 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 Text -> 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... | Change type signature of renderTemplate | Change type signature of renderTemplate
Along with it comes the change in pattern matching of the Identity case for
mergeMap.
| Haskell | bsd-3-clause | ibotty/stencil,sourrust/karver |
1552fcbebf779584cb961191aaef08fef3729e86 | data/Test.hs | data/Test.hs | -- These hints are for test purposes, and are not intended to
-- be used for real.
module HLint.Test where
error = Prelude.readFile ==> bad
error = (x :: Int) ==> (x :: Int32)
where _ = notTypeSafe
error "Test1" = map ==> map
error "Test2" = filter ==> filter
ignore "Test1" = ""
ignore "Test2" = ignoreTest
... | -- These hints are for test purposes, and are not intended to
-- be used for real.
module HLint.Test where
error = Prelude.readFile ==> bad
error = (x :: Int) ==> (x :: Int32)
where _ = notTypeSafe
error "Test1" = map ==> map
error "Test2" = filter ==> filter
ignore "Test1" = ""
ignore "Test2" = ignoreTest
w... | Add another test for warning levels | Add another test for warning levels | Haskell | bsd-3-clause | mpickering/hlint,gibiansky/hlint,eigengrau/hlint,ndmitchell/hlint,bitemyapp/hlint,ndmitchell/hlint |
535881d14a8d5e5c21206f8d5820443ab9e396e1 | lib/hugs/Quote.hs | lib/hugs/Quote.hs | module Quote where
class Quote a where
quote :: a -> String
instance Quote Char where
quote c = [c]
instance Quote String where
quote = id
instance Quote Bool where
quote = show
instance Show a => Quote (Maybe a) where
quote = show
instance Quote Int where
quote = show
instance Quote Inte... | module Quote(Quote, quote, trim) where
class Quote a where
quote :: a -> String
instance Quote Char where
quote c = [c]
instance Quote String where
quote = id
instance Quote Bool where
quote = show
instance Show a => Quote (Maybe a) where
quote = show
instance Quote Int where
quote = show
... | Add `trim' - useful for laying out quoted documents that are indented in the source file (but not indented in the output). | Add `trim' - useful for laying out quoted documents that are indented in the
source file (but not indented in the output).
| Haskell | bsd-3-clause | FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs |
bdaec81485ef99ebd7c4f97f7b37afb127039227 | source/library/Calculator/CLI.hs | source/library/Calculator/CLI.hs | {-# LANGUAGE OverloadedStrings #-}
module Calculator.CLI where
import Calculator.Evaluation
import Calculator.Parsing
import Calculator.Printing
import Calculator.Tokens
import Control.Monad (forever)
import Data.Monoid ((<>))
import Data.Text (Text)
import System.IO (hSetBuffering, stdout, BufferMode (NoBuffering... | {-# LANGUAGE OverloadedStrings #-}
module Calculator.CLI where
import Calculator.Evaluation
import Calculator.Parsing
import Calculator.Printing
import Calculator.Tokens
import Control.Monad (forever)
import Data.Monoid ((<>))
import Data.Text (Text)
import System.IO (hSetBuffering, stdout, BufferMode (NoBuffering... | Rewrite a function application to make the order consistent (in this case, from right-to-left). | Rewrite a function application to make the order consistent (in this case, from right-to-left).
| Haskell | bsd-3-clause | jonathanknowles/haskell-calculator |
652fde55006cc70479ecfcdefb855dd73ce4292a | src/Language/Haskell/Refact/HaRe.hs | src/Language/Haskell/Refact/HaRe.hs | {-# LANGUAGE ScopedTypeVariables #-}
module Language.Haskell.Refact.HaRe
(
-- * Data Structures
RefactSettings(..)
, VerboseLevel (..)
, defaultSettings
, SimpPos
-- ** Re-exported from ghc-mod
, GM.Options(..)
, GM.defaultOptions
-- * Refactorings
, ifToCase
, compIfToCase
, duplicateDef
, compDuplica... | {-# LANGUAGE ScopedTypeVariables #-}
module Language.Haskell.Refact.HaRe
(
-- * Data Structures
RefactSettings(..)
, VerboseLevel (..)
, defaultSettings
, SimpPos
-- ** Re-exported from ghc-mod
, GM.Options(..)
, GM.defaultOptions
-- * Refactorings
, ifToCase, compIfToCase
, duplicateDef, compD... | Add new commands to top level module | Add new commands to top level module
| Haskell | bsd-3-clause | SAdams601/HaRe,SAdams601/HaRe,RefactoringTools/HaRe,SAdams601/HaRe,RefactoringTools/HaRe,RefactoringTools/HaRe,kmate/HaRe,kmate/HaRe,kmate/HaRe |
46e89556bb2dec68deea8c86405587a246d4b3f9 | test/lazyTreeThrow.hs | test/lazyTreeThrow.hs | module Main where
import Text.XML.Expat.Tree
import qualified Data.ByteString as B
import Data.ByteString.Internal (c2w, w2c)
import qualified Data.ByteString.Lazy as L
import Control.Monad
infiniteDoc = "<?xml version=\"1.0\"?><infinite>"++body 1
where
body i | i == 5000 = "</bad-xml>" ++ body (i+1)
... | module Main where
import Text.XML.Expat.Tree
import qualified Data.ByteString as B
import Data.ByteString.Internal (c2w, w2c)
import qualified Data.ByteString.Lazy as L
import Control.Monad
infiniteDoc = "<?xml version=\"1.0\"?><infinite>"++body 1
where
body i | i == 5000 = "</bad-xml>" ++ body (i+1)
... | Add a note about exceptions | Add a note about exceptions
Ignore-this: 44c57604e9b162a1873d4e81395f44d4
darcs-hash:20090317225243-ed7c9-f5292c89525acf9541090d7452f839943a72b923.gz
| Haskell | bsd-3-clause | the-real-blackh/hexpat,the-real-blackh/hexpat,the-real-blackh/hexpat |
5923632abcc04627b5026c76914d9445c0905668 | Dmenu.hs | Dmenu.hs | module XMonadContrib.Dmenu (dmenu, dmenuXinerama, runProcessWithInput) where
import XMonad
import qualified StackSet as W
import System.Process
import System.IO
import Control.Monad
import Control.Monad.State
import Data.Maybe
import qualified Data.Map as M
runProcessWithInput :: FilePath -> [String] -> String -> IO ... | module XMonadContrib.Dmenu (dmenu, dmenuXinerama, runProcessWithInput) where
import XMonad
import qualified StackSet as W
import System.Process
import System.IO
import Control.Monad
import Control.Monad.State
import Data.Maybe
import qualified Data.Map as M
runProcessWithInput :: FilePath -> [String] -> String -> IO ... | Put dmenu in X too | Put dmenu in X too
darcs-hash:20070503053727-a5988-b8529a73c0dc6ae32f9683c1b34784223d2c063c
| Haskell | bsd-3-clause | yzhou61/xmonad-contrib,yzhou61/xmonad-contrib,yzhou61/xmonad-contrib |
b59980841f76f1134e1aa6cb1aedd4995df6a381 | testsuite/tests/ghc-regress/th/TH_genEx.hs | testsuite/tests/ghc-regress/th/TH_genEx.hs | {-# OPTIONS -fth -ddump-splices #-}
module TH_genEx where
import TH_genExLib
import Language.Haskell.TH
class MyInterface a where
foo :: a -> Int
foo1 :: Int -> a -> Int
$(genAny (reify ''MyInterface))
| {-# OPTIONS -fth -ddump-splices -XExistentialQuantification #-}
module TH_genEx where
import TH_genExLib
import Language.Haskell.TH
class MyInterface a where
foo :: a -> Int
foo1 :: Int -> a -> Int
$(genAny (reify ''MyInterface))
| Add -XExistentialQuantification flag (should have been there all along) | Add -XExistentialQuantification flag (should have been there all along) | Haskell | bsd-3-clause | mettekou/ghc,snoyberg/ghc,ghc-android/ghc,christiaanb/ghc,shlevy/ghc,holzensp/ghc,tjakway/ghcjvm,christiaanb/ghc,ghc-android/ghc,nushio3/ghc,mettekou/ghc,oldmanmike/ghc,nushio3/ghc,christiaanb/ghc,holzensp/ghc,nathyong/microghc-ghc,nathyong/microghc-ghc,GaloisInc/halvm-ghc,tibbe/ghc,green-haskell/ghc,oldmanmike/ghc,ant... |
950f5d553a411c9ea5ec5eb59b87ae7fa3480177 | test/lazyTreeThrow.hs | test/lazyTreeThrow.hs | module Main where
import Text.XML.Expat.Tree
import qualified Data.ByteString as B
import Data.ByteString.Internal (c2w, w2c)
import qualified Data.ByteString.Lazy as L
import Control.Monad
infiniteDoc = "<?xml version=\"1.0\"?><infinite>"++body 1
where
body i | i == 5000 = "</bad-xml>" ++ body (i+1)
... | module Main where
import Text.XML.Expat.Tree
import qualified Data.ByteString as B
import Data.ByteString.Internal (c2w, w2c)
import qualified Data.ByteString.Lazy as L
import Control.Monad
infiniteDoc = "<?xml version=\"1.0\"?><infinite>"++body 1
where
body i | i == 5000 = "</bad-xml>" ++ body (i+1)
... | Add a note about exceptions | Add a note about exceptions
Ignore-this: 44c57604e9b162a1873d4e81395f44d4
darcs-hash:20090317225243-ed7c9-f5292c89525acf9541090d7452f839943a72b923.gz
| Haskell | bsd-3-clause | sol/hexpat,sol/hexpat |
2c144d327c84875887fd1b22fa5418224c987c6d | Model.hs | Model.hs | {-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
... | {-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
import Text.Blaze (ToHtml(toHtml))
-- You can define all of your database entities in the entities file.
-- Yo... | Declare ToHtml instance for Sex (compilation pass on cabal but failed on cabal-dev) | Declare ToHtml instance for Sex (compilation pass on cabal but failed on cabal-dev)
| Haskell | bsd-2-clause | cutsea110/tut |
d76e8a468190cac4410c493268e2ecafcdb0051a | src/Hans/Layer/Tcp/Monad.hs | src/Hans/Layer/Tcp/Monad.hs | module Hans.Layer.Tcp.Monad where
import Hans.Channel
import Hans.Layer
import Hans.Layer.IP4
import Hans.Layer.Tcp.Connection
import Hans.Layer.Timer
import MonadLib (get)
-- TCP Monad -------------------------------------------------------------------
type TcpHandle = Channel (Tcp ())
type Thread = IO ()
type ... | module Hans.Layer.Tcp.Monad where
import Hans.Channel
import Hans.Layer
import Hans.Layer.IP4
import Hans.Layer.Tcp.Connection
import Hans.Layer.Timer
import MonadLib (get)
-- TCP Monad -------------------------------------------------------------------
type TcpHandle = Channel (Tcp ())
type Tcp = Layer TcpState
... | Remove unnecessary parameter from the TcpState structure | Remove unnecessary parameter from the TcpState structure
| Haskell | bsd-3-clause | GaloisInc/HaNS,cartazio/HaNS,GaloisInc/HaNS,cartazio/HaNS |
4d0f44e42947c2ee01fb01d07b686df6a40c621e | Example/Validate.hs | Example/Validate.hs | {-
Example program for TagSoup.
Detects basic syntax errors like isolated ampersands and unquoted attribute values.
-}
module Main where
import Text.HTML.TagSoup
import qualified Text.HTML.TagSoup.Position as Position
import System.Environment (getArgs)
import Data.Maybe (mapMaybe)
validate :: FilePath -> String -... | {-
Example program for TagSoup.
Detects basic syntax errors like isolated ampersands and unquoted attribute values.
-}
module Main where
import Text.HTML.TagSoup
import Text.HTML.TagSoup.Position
import System.Environment
validate :: FilePath -> String -> String
validate file input = unlines
[toReportText (setFi... | Change the validate example to do the same thing, but be more simple | Change the validate example to do the same thing, but be more simple | Haskell | bsd-3-clause | silkapp/tagsoup |
87478384d4c096dcb9d868d2902b0d5fb98e649a | src/Boilerplate/Types.hs | src/Boilerplate/Types.hs | {-# LANGUAGE OverloadedStrings #-}
module Boilerplate.Types
(
Flag
, InitFlags(..)
, Label
, Arg(..)
, Mode(..)
) where
type Flag = String
data InitFlags =
InitFlags { packageName :: Flag
, moduleName :: Flag
, author :: Flag
, email ... | {-# LANGUAGE OverloadedStrings #-}
module Boilerplate.Types
(
Flag
, InitFlags(..)
, Label
, Arg(..)
, Mode(..)
) where
type Flag = String
data InitFlags =
InitFlags { packageName :: !Flag
, moduleName :: !Flag
, author :: !Flag
, emai... | Make Flag values strict to raise error early | Make Flag values strict to raise error early
| Haskell | bsd-3-clause | jonathankochems/hi |
63d7fd8fa2fa75e4787acbb7f4690d91df8b38f0 | data/HLint_TypeCheck.hs | data/HLint_TypeCheck.hs |
-- Used with --typecheck
module HLint_TypeCheck where
(==>) :: a -> a -> a
(==>) = undefined
_noParen_ = id
_eval_ = id
|
-- Used with --typecheck
module HLint_TypeCheck where
(==>) :: a -> a -> a
(==>) = undefined
_noParen_ = id
_eval_ = id
---------------------------------------------------------------------
-- EXAMPLES
main :: IO ()
main = return ()
{-# LINE 116 "data\\Default.hs" #-}
_test64 = \ p x -> (and (map p x)) ==> (all ... | Add an example to the TypeCheck boilerplate so it can be tested standalone | Add an example to the TypeCheck boilerplate so it can be tested standalone
| Haskell | bsd-3-clause | bitemyapp/hlint,ndmitchell/hlint,ndmitchell/hlint,gibiansky/hlint,mpickering/hlint,eigengrau/hlint |
6f1be4f6804de60636cca9fd358497a26ef483b9 | wai-extra/Network/Wai/Middleware/StreamFile.hs | wai-extra/Network/Wai/Middleware/StreamFile.hs | {-# LANGUAGE OverloadedStrings #-}
module Network.Wai.Middleware.StreamFile
(streamFile) where
import Network.Wai
import Network.Wai.Internal
import Network.Wai (Middleware, responseToStream)
import Network.HTTP.Types (Status, ResponseHeaders)
import qualified Data.ByteString.Char8 as S8
import qualified Data.Byt... | {-# LANGUAGE OverloadedStrings #-}
module Network.Wai.Middleware.StreamFile
(streamFile) where
import Network.Wai
import Network.Wai.Internal
import Network.Wai (Middleware, responseToStream)
import Network.HTTP.Types (Status, ResponseHeaders)
import qualified Data.ByteString.Char8 as S8
import qualified Data.Byt... | Add documentation for streamFile function. | Add documentation for streamFile function.
| Haskell | mit | rgrinberg/wai,yesodweb/wai,coypoop/wai,creichert/wai,jberryman/wai,tolysz/wai,awpr/wai,tolysz/wai,jberryman/wai,ygale/wai,AndrewRademacher/wai,mfine/wai,dylex/wai,frontrowed/wai,iquiw/wai,urbanslug/wai,urbanslug/wai,rgrinberg/wai,sordina/wai,soenkehahn/wai,AndrewRademacher/wai,AndrewRademacher/wai,coypoop/wai,creichert... |
3a2d6bbbd098b31afcb87a16d8ee74a86eb34916 | test/ModelTypesSpec.hs | test/ModelTypesSpec.hs | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
module ModelTypesSpec where
import ModelTypes
import SpecHelper
instance Arbitrary JudgeStatus where
arbitrary = elements [Accepted, WrongAnswer, RuntimeError, TimeLimitExceeded,
MemoryLimitExceeded, OutputLimitExceeded, CompileError,
... | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
module ModelTypesSpec where
import ModelTypes
import SpecHelper
instance Arbitrary JudgeStatus where
arbitrary = elements [Accepted, WrongAnswer, RuntimeError, TimeLimitExceeded,
MemoryLimitExceeded, OutputLimitExceeded, CompileError,
... | Fix the spec of JudgeStatus. | Fix the spec of JudgeStatus.
| Haskell | mit | wass80/WXCS,asi1024/WXCS |
6fe7b70f99374fdc90388c4e915cf2a0e92a85e1 | engine-src/Game/LambdaHack/Client/UI/PointUI.hs | engine-src/Game/LambdaHack/Client/UI/PointUI.hs | -- | UI screen coordinates.
module Game.LambdaHack.Client.UI.PointUI
( PointUI(..), mapStartY
) where
import Prelude ()
import Game.LambdaHack.Core.Prelude
-- | Screen coordinates, independent of whether square or monospace fonts
-- are being placed on the screen. These are not game map coordinates,
-- becuse UI... | -- | UI screen coordinates.
module Game.LambdaHack.Client.UI.PointUI
( PointUI(..), PointSquare(..), squareToUI, uiToSquare
, mapStartY, squareToMap, mapToSquare
) where
import Prelude ()
import Game.LambdaHack.Core.Prelude
import Game.LambdaHack.Common.Point
-- | UI screen coordinates, independent of whether... | Introduce game map coordinates: PointSquare | Introduce game map coordinates: PointSquare
| Haskell | bsd-3-clause | LambdaHack/LambdaHack |
2032d8c5d1290679852f2ac48fa64ce2e60a8fad | travis.hs | travis.hs |
import System.Time.Extra
import System.Process.Extra
main :: IO ()
main = do
let timed x = do
putStrLn $ "\n\nSearching for " ++ x
(time,_) <- duration $ system_ $ "hogle +RTS -T -RTS " ++ (if x == "" then "" else show x)
putStrLn $ "Search " ++ show x ++ " took " ++ showDuration time
... |
import System.Time.Extra
import System.Process.Extra
main :: IO ()
main = do
let timed x = do
putStrLn $ "\n\nSearching for " ++ x
(time,_) <- duration $ system_ $ "hogle +RTS -T -RTS " ++ (if x == "" then "" else show x)
putStrLn $ "Search " ++ show x ++ " took " ++ showDuration time
... | Move generate before test when checking the program | Move generate before test when checking the program
| Haskell | bsd-3-clause | ndmitchell/hoogle,wolftune/hoogle,BartAdv/hoogle,BartAdv/hoogle,wolftune/hoogle,ndmitchell/hoogle,ndmitchell/hoogle,wolftune/hoogle,BartAdv/hoogle,ndmitchell/hogle-dead,ndmitchell/hogle-dead,wolftune/hoogle,BartAdv/hoogle |
ee18826a8800bc7f959601598c8a7e9de1f07ea9 | tests/UnitTest/Distribution.hs | tests/UnitTest/Distribution.hs | module UnitTest.Distribution where
import Test.HUnit
import Statistics.Distribution
import Statistics.Distribution.Gamma
distributionTests :: [Test]
distributionTests =
[TestCase $ assertEqual "density (gammaDistr 150 1/150) 1 == 4.883311" 4.883311418525483 (density (gammaDistr 150 (1/150)) 1)
]
| module UnitTest.Distribution where
import Test.HUnit
import Statistics.Constants
import Statistics.Distribution
import Statistics.Distribution.Gamma
-- Approximate equality
eq :: Double -> Double -> Double -> Bool
eq eps a b = abs (a - b) / max (abs a) (abs b) <= eps
-- Approximately equal up to 1 ulp
(=~) :: Double... | Fix test for gamma distibution. Compare values with 1 ulp accuracy | Fix test for gamma distibution. Compare values with 1 ulp accuracy
| Haskell | bsd-2-clause | 00tau/statistics,00tau/statistics |
5f0787535f070f4e14daf8b76ccaf07218694ff4 | Examples/Test/Manual.hs | Examples/Test/Manual.hs |
module Examples.Test.Manual(main) where
import Development.Shake
import Development.Shake.FilePath
import Examples.Util
import General.Base
import System.Directory
main = shaken test $ \args obj ->
action $ liftIO $ error "The 'manual' example should only be used in test mode"
test build obj = do
copyDirec... |
module Examples.Test.Manual(main) where
import Development.Shake
import Development.Shake.FilePath
import Examples.Util
import General.Base
import System.Directory
main = shaken test $ \args obj ->
action $ liftIO $ error "The 'manual' example should only be used in test mode"
test build obj = do
copyDirec... | Build the user manual with -j2, just to test a wider range of pieces | Build the user manual with -j2, just to test a wider range of pieces
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
c5e7acfc727aa73ecc7057c24533788f91d2ae34 | tests/properties.hs | tests/properties.hs | {-# LANGUAGE TemplateHaskell #-}
module Main
( main -- :: IO ()
) where
import Prelude as Prelude
import Data.List as List
import Data.Maybe
import Data.Function
import Control.Monad
import Control.DeepSeq
import Debug.Trace
import Test.Tasty
import Test.Tasty.TH
import Test.Tasty.QuickCheck as QC
impo... | {-# LANGUAGE TemplateHaskell #-}
module Main
( main -- :: IO ()
) where
import Prelude as Prelude
import Data.List as List
import Data.Maybe
import Data.Function
import Control.Monad
import Control.DeepSeq
import Debug.Trace
import Test.Tasty
import Test.Tasty.TH
import Test.Tasty.QuickCheck as QC
impo... | Remove artificial list length in prop_lookupMany | Remove artificial list length in prop_lookupMany
Signed-off-by: Austin Seipp <48c905ac3851f382b914247d97dd93273d5ff555@pobox.com>
| Haskell | bsd-2-clause | ekmett/structures,hsavit1/structures |
fbfef9de439b4c35477b1f2c417bc9cb02114ca8 | tests/CheckTranslationStage.hs | tests/CheckTranslationStage.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module CheckTranslationStage
( checkTranslationStage
, main
)
where
import Core.Data.Structures
import Core.Text.Rope ()
import Core.System
import Data.DList
import Test.Hspec
import Technique.Internal
import Technique.Language
import Techni... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module CheckTranslationStage
( checkTranslationStage
, main
)
where
import Core.Data.Structures
import Core.Text.Rope ()
import Core.System
import Data.DList
import Test.Hspec
import Technique.Internal
import Technique.Language
import Techni... | Check for unknown variable and undeclared procedure | Check for unknown variable and undeclared procedure
| Haskell | mit | oprdyn/technique,oprdyn/technique |
921dcce1ab2e0cc1e6df25df98bb24f134fe0742 | src/Main.hs | src/Main.hs | import Base
import Rules
import Rules.Cabal
import Rules.Config
import Rules.Generate
import Rules.Libffi
import Rules.IntegerGmp
import Rules.Oracles
main :: IO ()
main = shakeArgs options $ do
cabalRules -- see Rules.Cabal
configRules -- see Rules.Config
copyRules -- see Rules.Generate
... | module Main (main) where
import qualified Base as B
import qualified Rules as R
import qualified Rules.Cabal as RCabal
import qualified Rules.Config as RConfig
import qualified Rules.Copy as RCopy
import qualified Rules.Generate as RGen
import qualified Rules.IntegerGmp as RInt
... | Make value sources more explicit | Make value sources more explicit
[skip ci]
Rather than relying on comments, move the documentation
into the source, so it's checked by the compiler automatically
| Haskell | bsd-3-clause | sdiehl/ghc,snowleopard/shaking-up-ghc,izgzhen/hadrian,sdiehl/ghc,bgamari/shaking-up-ghc,sdiehl/ghc,snowleopard/hadrian,quchen/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc |
287199b090e55fb56e504df85f9e326dc0e6a0b6 | lib/CRDT/Cm/TwoPSet.hs | lib/CRDT/Cm/TwoPSet.hs | {-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TypeFamilies #-}
-- | TODO(cblp, 2017-09-29) USet?
module CRDT.Cm.TwoPSet
( TwoPSet (..)
) where
import Control.Monad (guard)
import Data.Set (Set)
import qualified Data.Set as Set
import CRDT.Cm (CausalOrd (..), CmRDT (..))
data TwoPSet... | {-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TypeFamilies #-}
-- | TODO(cblp, 2017-09-29) USet?
module CRDT.Cm.TwoPSet
( TwoPSet (..)
, initial
, query
) where
import Control.Monad (guard)
import Data.Set (Set)
import qualified Data.Set as Set
import CRDT.Cm (CausalOrd (..),... | Add `initial` and `query` for 2P-set | Add `initial` and `query` for 2P-set
| Haskell | bsd-3-clause | cblp/crdt |
201c2e6b4035acc4537ce57331d9efcb740cde8b | academic/icfp2008/Include.hs | academic/icfp2008/Include.hs |
import Prelude hiding (map)
import Data.List hiding (map)
-- # do
-- # c ; v ; y ; v_1 ; i ; s_0
-- # IO ; Double
-- # Show
-- # primCatch
-- # s ; b ; a ; e
-- # l' ; b'
-- # lam ; case_ ; let_ ; app
-- # apply
-- instance Eq Expr
data World = World
y = undefined
x = undefined
v = undefined
g = undefined
e = undef... |
import Prelude hiding (map)
import Data.List hiding (map)
-- # do
-- # c ; v ; y ; v_1 ; i ; s_0 ; n ; l_n' ; xs_
-- # IO ; Double
-- # Show
-- # primCatch
-- # s ; b ; a ; e
-- # l' ; b'
-- # lam ; case_ ; let_ ; app
-- # apply
-- instance Eq Expr
data World = World
y = undefined
x = undefined
v = undefined
g = un... | Add a few more things to paper haskell to get success | Add a few more things to paper haskell to get success | Haskell | bsd-3-clause | ndmitchell/firstify |
77b54edb66623735147d6838ffea1f25e8d596d2 | examples/Jumbled.hs | examples/Jumbled.hs | module Main where
import Control.Monad (when)
import Data.Default.Class (def)
import System.Environment (getArgs)
import System.Exit (exitFailure)
import qualified SDL
import qualified SDL.Mixer
main :: IO ()
main = do
SDL.initialize [SDL.InitAudio]
SDL.Mixer.openAudio def 256
putStr "Available ch... | module Main where
import Control.Monad (when)
import Data.Default.Class (def)
import System.Environment (getArgs)
import System.Exit (exitFailure)
import qualified SDL
import qualified SDL.Mixer as Mix
main :: IO ()
main = do
SDL.initialize [SDL.InitAudio]
Mix.openAudio def 256
putStr "Available c... | Use the same qualification in both examples. | Use the same qualification in both examples.
| Haskell | bsd-3-clause | sbidin/sdl2-mixer |
afcdb9da284c117cbf90649fe915371723d35ee8 | src/Data/LLVM/Testing.hs | src/Data/LLVM/Testing.hs | -- | Various functions to help test this library and analyses based on
-- it.
module Data.LLVM.Testing (
readInputAndExpected,
testAgainstExpected,
module Data.LLVM.Testing.BuildModule
) where
import System.FilePath
import System.FilePath.Glob
import Data.LLVM.Types
import Data.LLVM.Testing.BuildModule
readI... | -- | Various functions to help test this library and analyses based on
-- it.
module Data.LLVM.Testing (
readInputAndExpected,
testAgainstExpected,
module Data.LLVM.Testing.BuildModule
) where
import System.FilePath.Glob
import Data.LLVM.Types
import Data.LLVM.Testing.BuildModule
readInputAndExpected :: (Rea... | Clean up the testing interface. | Clean up the testing interface.
Just take a pattern to glob instead of a directory and extension.
Tweak the comparison function to take a descriptive string (the
filename) as the first parameter. This is useful for diagnosis and it
happens to match the signature of assertEqual in HUnit.
| Haskell | bsd-3-clause | wangxiayang/llvm-analysis,wangxiayang/llvm-analysis,travitch/llvm-analysis,travitch/llvm-analysis |
3abe48beea5573871cda6b8d93a0958a5599d813 | compiler/Elm/Internal/Utils.hs | compiler/Elm/Internal/Utils.hs | {- | This module exports functions for compiling Elm to JS.
-}
module Elm.Internal.Utils (compile, moduleName) where
import qualified Data.List as List
import qualified Generate.JavaScript as JS
import qualified Build.Source as Source
import qualified Parse.Module as Parser
import qualified SourceSyntax.Module... | {- | This module exports functions for compiling Elm to JS.
-}
module Elm.Internal.Utils (compile, moduleName, nameAndImports) where
import qualified Data.List as List
import qualified Generate.JavaScript as JS
import qualified Build.Source as Source
import Parse.Module (getModuleName)
import Parse.Parse (depe... | Add a function to read imports | Add a function to read imports
| Haskell | bsd-3-clause | 5outh/Elm,laszlopandy/elm-compiler,JoeyEremondi/elm-pattern-effects,Axure/elm-compiler,pairyo/elm-compiler,mgold/Elm |
576cf809016d1e3ad8ce49f6b6243c5fc0e4cbfb | src/Optimizer/DeadCodeElimination.hs | src/Optimizer/DeadCodeElimination.hs | module Optimizer.DeadCodeElimination(optimize) where
import Datatypes
import Control.Monad.Writer
import Optimizer.Dataflow(getLiveVariables, fixedPoint)
import Data.List
optimize :: [IR] -> Writer [String] [IR]
optimize ir = do
let prunedIR = fixedPoint (\ir -> let liveVariables = foldl union [] (getLiveVariables ... | module Optimizer.DeadCodeElimination(optimize) where
import Datatypes
import Control.Monad.Writer
import Optimizer.Dataflow(getLiveVariables, fixedPoint)
import Data.List
optimize :: [IR] -> Writer [String] [IR]
optimize ir = do
let prunedIR =
fixedPoint
(\ir ->
let liveVariables = fol... | Rewrite parts of dce for readability | Rewrite parts of dce for readability
| Haskell | mit | aleksanb/hdc |
8cb696553e71098a5bd1d1ea9e7eb9f9a879f025 | examples/Simple.hs | examples/Simple.hs | {-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-}
module Main where
--------------------------------------------------------------------------
-- imports
import Test.QuickCheck
import Test.QuickCheck.All
--------------------------------------------------------------------------
-- example 1
allEqual x y z = x ... | {-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-}
module Main where
--------------------------------------------------------------------------
-- imports
import Test.QuickCheck
import Test.QuickCheck.All
--------------------------------------------------------------------------
-- example 1
allEqual x y z = x ... | Add a conjunction and disjunction example | Add a conjunction and disjunction example
| Haskell | bsd-3-clause | Warbo/quickcheck,nh2/quickcheck,beni55/quickcheck,soenkehahn/quickcheck,srhb/quickcheck |
743b879bd666cf7c1038310121a959779af3550c | test/Model/PermissionTest.hs | test/Model/PermissionTest.hs | module Model.PermissionTest where
import Test.Tasty
import Test.Tasty.HUnit
import Model.Permission
import TestHarness ()
test_checkPermission :: [TestTree]
test_checkPermission =
[ testCase "Can read when granted edit"
$ checkPermission (const PermissionEDIT) () PermissionREAD
@?= PermissionGran... | module Model.PermissionTest where
import Test.Tasty
import Test.Tasty.HUnit
import Model.Permission
import TestHarness ()
test_checkPermission :: [TestTree]
test_checkPermission =
[ testCase "Can read when granted edit"
$ checkPermission (const PermissionEDIT) () PermissionREAD
@?= PermissionGran... | Add check for edge case | Add check for edge case
| Haskell | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
795ba6051e9a26823a55604cb58fd4b0c41710bd | client/Sound/LV2/Atom.hs | client/Sound/LV2/Atom.hs | module Sound.LV2.Atom where
| module Sound.LV2.Atom (
ToAtom(..)
, FromAtom(..)
, encode
, decode
) where
import Sound.LV2.Atom.Get (FromAtom(..), decode)
import Sound.LV2.Atom.Put (ToAtom(..), encode)
| Add convenience exports from top-level module | Add convenience exports from top-level module
| Haskell | apache-2.0 | samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla,samplecount/methcla |
cad682e86ac456d4378b8a14f2f589978bcc1da7 | benchmarks/bench1.hs | benchmarks/bench1.hs | {-# LANGUAGE CPP #-}
module Main
( main -- :: IO ()
) where
import Criterion.Main
import Crypto.Sign.Ed25519
import Control.DeepSeq
import qualified Data.ByteString as B
--------------------------------------------------------------------------------
#if !MIN_VERSION_bytestring(0,10,0)
instance NFData... | {-# LANGUAGE CPP #-}
module Main
( main -- :: IO ()
) where
import Criterion.Main
import Crypto.Sign.Ed25519
import Control.DeepSeq
import qualified Data.ByteString as B
--------------------------------------------------------------------------------
#if !MIN_VERSION_bytestring(0,10,0)
instance NFData... | Fix orphan NFData instance (again) | Fix orphan NFData instance (again)
Signed-off-by: Austin Seipp <48c905ac3851f382b914247d97dd93273d5ff555@pobox.com>
| Haskell | mit | thoughtpolice/hs-ed25519,thoughtpolice/hs-ed25519 |
a9a223f6e384b24329e37e33edec536f613dea9f | src/Language/F2JS/CodeGen.hs | src/Language/F2JS/CodeGen.hs | {-# LANGUAGE LambdaCase #-}
module Language.F2JS.CodeGen where
import Control.Applicative
import Language.F2JS.Target
import Language.F2JS.Util
import qualified Language.JavaScript.AST as J
import qualified Language.JavaScript.NonEmptyList as J
jname :: String -> J.Name
jname = either error id . J.name
jvar :: Name -... | {-# LANGUAGE LambdaCase #-}
module Language.F2JS.CodeGen where
import Control.Applicative
import Language.F2JS.Target
import Language.F2JS.Util
import qualified Language.JavaScript.AST as J
import qualified Language.JavaScript.NonEmptyList as J
jname :: String -> J.Name
jname = e... | Call the RTS mkLit function in lit | Call the RTS mkLit function in lit
| Haskell | mit | jozefg/f2js |
05c8e0e30aad6e28482bce9f712e6b6c7b3c9207 | compiler/Parse/Literal.hs | compiler/Parse/Literal.hs | {-# OPTIONS_GHC -Wall -fno-warn-unused-do-bind #-}
module Parse.Literal (literal) where
import Control.Applicative ((<$>))
import Text.Parsec hiding (newline,spaces)
import Parse.Helpers
import SourceSyntax.Literal
literal :: IParser Literal
literal = num <|> (Str <$> str) <|> (Chr <$> chr)
num :: IParser Literal
nu... | {-# OPTIONS_GHC -W #-}
module Parse.Literal (literal) where
import Control.Applicative ((<$>))
import Text.Parsec hiding (newline,spaces)
import Parse.Helpers
import SourceSyntax.Literal
literal :: IParser Literal
literal = num <|> (Str <$> str) <|> (Chr <$> chr) <?> "literal"
num :: IParser Literal
num = toLit <$> ... | Add support for exponent notation for floating point numbers | Add support for exponent notation for floating point numbers
Brought to my attention by this thread:
https://groups.google.com/forum/#!topic/elm-discuss/jQXmaqLHcIA
| Haskell | bsd-3-clause | JoeyEremondi/elm-pattern-effects,mgold/Elm,laszlopandy/elm-compiler,5outh/Elm,Axure/elm-compiler,deadfoxygrandpa/Elm,pairyo/elm-compiler |
44b897c6a5203f2247707c75dbb59f782abdf763 | test/Main.hs | test/Main.hs | import Spec
import Dir
import Test.Hspec
import System.Process
main = do
let sandboxes = [ "test/data", "test/data/check-packageid"
, "test/data/duplicate-pkgver/" ]
genSandboxCfg dir = withDirectory dir $ \cwd -> do
system ("sed 's|@CWD@|" ++ cwd ++ "|g' cabal.sandbox.config.in > c... | {-# LANGUAGE ScopedTypeVariables #-}
import Spec
import Dir
import Test.Hspec
import System.Process
import Language.Haskell.GhcMod (debugInfo, defaultOptions, findCradle)
import Control.Exception as E
main = do
let sandboxes = [ "test/data", "test/data/check-packageid"
, "test/data/duplicate-pkgv... | Print useful information when running spec | Print useful information when running spec
| Haskell | bsd-3-clause | phaazon/ghc-mod,cabrera/ghc-mod |
10d7dc69c57b21e77195a7c9a3065731243ce0a4 | src/CabalCargs/Format.hs | src/CabalCargs/Format.hs |
module CabalCargs.Format
( format
) where
import CabalCargs.CompilerArgs (CompilerArgs(..))
import CabalCargs.Formatting (Formatting(..))
import Data.Maybe (maybeToList)
format :: Formatting -> CompilerArgs -> [String]
format Ghc cargs = concat [ map ("-i" ++) (hsSourceDirs cargs)
, ... | {-# Language PatternGuards #-}
module CabalCargs.Format
( format
) where
import CabalCargs.CompilerArgs (CompilerArgs(..))
import CabalCargs.Formatting (Formatting(..))
import Data.Maybe (maybeToList)
format :: Formatting -> CompilerArgs -> [String]
format Ghc cargs = concat [ map ("-i" ++) (hsSourceDirs carg... | Add the socket argument for hdevtools | Add the socket argument for hdevtools
| Haskell | bsd-3-clause | dan-t/cabal-cargs |
03cb66052d571fd30d42f5b8f3b60b2fdc337739 | src/ASPico/Handler/Root/Conversion.hs | src/ASPico/Handler/Root/Conversion.hs | module ASPico.Handler.Root.Conversion
( ApiConversion
, serverConversion
) where
import ASPico.Prelude
import Servant ((:>), Get, Header(..), QueryParam, ServerT)
import Web.HttpApiData (FromHttpApiData, ToHttpApiData)
import ASPico.Db (AffiliateId, CvId)
import ASPico.Error (AppErr)
import ASPico.Monad (Monad... | module ASPico.Handler.Root.Conversion
( ApiConversion
, serverConversion
) where
import ASPico.Prelude
import Database.Persist.Sql (Key(..), toSqlKey)
import Servant ((:>), Get, Header(..), QueryParam, ServerT)
import Web.Cookie (parseCookies)
import Web.HttpApiData (FromHttpApiData(..), ToHttpApiData)
import ... | Change to check actual cookie value. | Change to check actual cookie value.
| Haskell | mit | arowM/ASPico |
fbb08a1a5081ae68432345100d62976a7fc7f3f1 | src/Language/K3/Optimization.hs | src/Language/K3/Optimization.hs | module Language.K3.Optimization where
import Data.List
import Language.K3.Core.Annotation
import Language.K3.Core.Declaration
import Language.K3.Analysis.Effects.InsertEffects
import Language.K3.Transform.Writeback
passes :: [K3 Declaration -> K3 Declaration]
passes = [writebackOpt]
runOptimization :: K3 Declarati... | module Language.K3.Optimization where
import Data.List
import Language.K3.Core.Annotation
import Language.K3.Core.Declaration
import Language.K3.Analysis.Effects.InsertEffects
import Language.K3.Transform.Writeback
import Language.K3.Transform.LambdaForms
passes :: [K3 Declaration -> K3 Declaration]
passes = [write... | Add lambda to default optimization pass list. | Add lambda to default optimization pass list.
| Haskell | apache-2.0 | DaMSL/K3,DaMSL/K3,yliu120/K3 |
90220b405f3b38e876c37f600c5be24c1c0a9b44 | haskell/playpen/blockchain/2018-06-lambda-conf/src/X02_LedgerWithPool.hs | haskell/playpen/blockchain/2018-06-lambda-conf/src/X02_LedgerWithPool.hs | {-# OPTIONS_GHC -Wno-unused-do-bind #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module X02_LedgerWithPool where
import qualified Control.Concurrent as CC
import qualified Control.Concurrent.Async as Async
import qualified... | {-# OPTIONS_GHC -Wno-unused-do-bind #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module X02_LedgerWithPool where
import qualified Control.Concurrent as CC
import qualified Control.Concurrent.Async as Async
import qualified... | Use Async.concurrently to ensure miner threads get terminated. | Use Async.concurrently to ensure miner threads get terminated.
| Haskell | unlicense | haroldcarr/learn-haskell-coq-ml-etc,haroldcarr/learn-haskell-coq-ml-etc,haroldcarr/learn-haskell-coq-ml-etc |
70b38bab14b977cdafe19e7fabb423bae55dd954 | src/Famous/Core/Node.hs | src/Famous/Core/Node.hs | {-# LANGUAGE JavaScriptFFI #-}
module Famous.Core.Node where
import GHCJS.Foreign
import GHCJS.Types
data Node_ a
type Node a = JSRef (Node_ a)
| {-# LANGUAGE JavaScriptFFI #-}
module Famous.Core.Node where
import GHCJS.Foreign
import GHCJS.Types
data Node_ a
type Node a = JSRef (Node_ a)
-- | APIs for a Node object
-- | show a node
foreign import javascript unsafe "($1).show()"
fms_showNode :: Node a -> IO ()
showNode = fms_showNode
-- | hide a node
f... | Add functions to set fields in the node class | Add functions to set fields in the node class
| Haskell | bsd-3-clause | manyoo/ghcjs-famous |
b3b57c35842d1ae587f6c2702a7cc8497a5c479c | Numeric/Tools/Equation.hs | Numeric/Tools/Equation.hs | module Numeric.Tools.Equation (
solveBisection
) where
-- | Solve equation @f(x) = 0@ using bisection method
solveBisection :: Double -- ^ Required precision
-> (Double,Double) -- ^ Range
-> (Double -> Double) -- ^ Equation
-> Maybe Double
solveBisecti... | -- |
-- Module : Numeric.Tools.Equation
-- Copyright : (c) 2011 Aleksey Khudyakov
-- License : BSD3
--
-- Maintainer : Aleksey Khudyakov <alexey.skladnoy@gmail.com>
-- Stability : experimental
-- Portability : portable
--
-- Numerical solution of ordinary equations.
module Numeric.Tools.Equation (
solveBis... | Fix bug in solveBisection when desired precision couldn't be reached with finite precision and function loops | Fix bug in solveBisection when desired precision couldn't be reached with
finite precision and function loops
Document solveBisection
| Haskell | bsd-3-clause | Shimuuar/numeric-tools |
6cfd999a66014630fe61108045949248301f38d0 | Main.hs | Main.hs | {-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static
import System.Environment
import System.Process
import Control.Monad
import Control.Monad.IO.Class
import Data.Monoid (mconcat)
import Data.Aeson (FromJSO... | {-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static
import System.Environment
import System.Process
import Control.Monad
import Control.Monad.IO.Class
import Data.Monoid (mconcat)
import Data.Aeson (FromJSO... | Use the correct location for pointfree binary | Use the correct location for pointfree binary
| Haskell | mit | keathley/pointfree.io,keathley/pointfree.io |
0c657b85db9d0bc00aa1f712b85593706d0e9297 | test/Databrary/OpsTest.hs | test/Databrary/OpsTest.hs | module Databrary.OpsTest where
import Test.Tasty
import Test.Tasty.HUnit
import Databrary.Ops
unit_thenUse :: Assertion
unit_thenUse = do
-- example
True `thenUse` ("abc" :: String) @?= Just "abc"
False `thenUse` ("abc" :: String) @?= Nothing
unit_useWhen :: Assertion
unit_useWhen = do
-- example
... | module Databrary.OpsTest where
import Test.Tasty
import Test.Tasty.HUnit
import Databrary.Ops
-- doctest style examples
unit_Ops_examples :: Assertion
unit_Ops_examples = do
-- TODO: delete Ops module
True `thenUse` ("abc" :: String) @?= Just "abc"
False `thenUse` ("abc" :: String) @?= Nothing
("abc"... | Add example usage for Ops module | Add example usage for Ops module
| Haskell | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
3cb30db4b3fba88d6a6be3ecb55e82d87c2dc21b | src/ForeignHandle.hs | src/ForeignHandle.hs | -- http://hackage.haskell.org/packages/archive/mtp/latest/doc/html/src/Foreign-Handle.html
{-# LANGUAGE ForeignFunctionInterface #-}
module ForeignHandle (
fdopen, fflush, fclose,
handleToCFile
) where
import GHC.IO.Handle (Handle, hDuplicate)
import Foreign (Ptr(..))
import Foreign.C (CInt(..), CString(.... | -- http://hackage.haskell.org/packages/archive/mtp/latest/doc/html/src/Foreign-Handle.html
{-# LANGUAGE ForeignFunctionInterface #-}
module ForeignHandle (
fdopen, fflush, fclose,
handleToCFile
) where
import GHC.IO.Handle (Handle, hDuplicate)
import Foreign (Ptr)
import Foreign.C (CInt(..), CString, CFil... | Fix some warnings from ghc. | Fix some warnings from ghc.
| Haskell | bsd-3-clause | bradlarsen/hs-cudd,bradlarsen/hs-cudd,bradlarsen/hs-cudd |
435484071557fa1ae3c65ef84235f109d004f8c0 | Gamgine/Coroutine.hs | Gamgine/Coroutine.hs |
module Gamgine.Coroutine where
import Control.Monad
newtype Coroutine i o = Coroutine {
runCoroutine :: i -> (o, Coroutine i o)
}
newtype (Monad m) => CoroutineM m i o = CoroutineM {
runCoroutineM :: i -> m (o, CoroutineM m i o)
}
|
module Gamgine.Coroutine where
newtype Coroutine i o = Coroutine {
runCoroutine :: i -> (o, Coroutine i o)
}
newtype CoroutineM m i o = CoroutineM {
runCoroutineM :: i -> m (o, CoroutineM m i o)
}
| Remove Monad constraint from type definition | Remove Monad constraint from type definition
| Haskell | bsd-3-clause | dan-t/layers |
dc5ad401e2cea38f3d315545d775eddbb5e4d245 | Dmenu.hs | Dmenu.hs | module XMonadContrib.Dmenu (dmenu, dmenuXinerama, runProcessWithInput) where
import XMonad
import qualified StackSet as W
import System.Process
import System.IO
import Control.Monad
import Control.Monad.State
import Data.Maybe
import qualified Data.Map as M
runProcessWithInput :: FilePath -> [String] -> String -> IO ... | module XMonadContrib.Dmenu (dmenu, dmenuXinerama, runProcessWithInput) where
import XMonad
import qualified StackSet as W
import System.Process
import System.IO
import Control.Monad
import Control.Monad.State
import Data.Maybe
import qualified Data.Map as M
runProcessWithInput :: FilePath -> [String] -> String -> IO ... | Put dmenu in X too | Put dmenu in X too
| Haskell | bsd-3-clause | MP2E/XMonadContrib,MP2E/XMonadContrib,reenberg/XMonadContrib,reenberg/XMonadContrib |
62130e5df0fa6b74ef14d7b9128d52af15123f4e | bin/HackageDownloadsApi.hs | bin/HackageDownloadsApi.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Control.Monad.IO.Class
import HackageDownloads
import Web.Spock.Safe
import Web.Spock.Worker
onScrapeError :: E... | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Control.Monad.IO.Class
import Data.Maybe
import HackageDownloads
import System.Environment
import Web.... | Read the PORT from the environment | Read the PORT from the environment
| Haskell | mit | haskellbr/hackage-downloads |
85c380c323f79b3b089ff8c092309aa3d2f1d0d3 | Databrary/Controller/Format.hs | Databrary/Controller/Format.hs | {-# LANGUAGE OverloadedStrings #-}
module Databrary.Controller.Format
( viewFormats
, formatIcon
) where
import Control.Monad.Trans.Reader (asks)
import Data.Monoid ((<>))
import System.Posix.FilePath (splitFileName, splitExtension)
import Databrary.Iso.Types (invMap)
import Databrary.Model.Format
import Databr... | {-# LANGUAGE OverloadedStrings #-}
module Databrary.Controller.Format
( viewFormats
, formatIcon
) where
import Control.Monad.Trans.Reader (asks)
import Data.Monoid ((<>))
import System.Posix.FilePath (splitFileName, splitExtension)
import Databrary.Iso.Types (invMap)
import Databrary.Model.Format
import Databr... | Mark asset/formats an angular page | Mark asset/formats an angular page
| Haskell | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.