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 |
|---|---|---|---|---|---|---|---|---|---|
2824a21d0477fb99e8442afed8f039b8d82e222f | Examples/Test/Basic1.hs | Examples/Test/Basic1.hs |
module Examples.Test.Basic1(main) where
import Development.Shake
import Examples.Util
main = shaken test $ \obj -> do
want [obj "AB.txt"]
obj "AB.txt" *> \out -> do
need [obj "A.txt", obj "B.txt"]
text1 <- readFile' $ obj "A.txt"
text2 <- readFile' $ obj "B.txt"
writeFile' out... |
module Examples.Test.Basic1(main) where
import Development.Shake
import Examples.Util
main = shaken test $ \obj -> do
want [obj "AB.txt"]
obj "AB.txt" *> \out -> do
need [obj "A.txt", obj "B.txt"]
text1 <- readFile' $ obj "A.txt"
text2 <- readFile' $ obj "B.txt"
writeFile' out... | Add some assertions about file pattern matches | Add some assertions about file pattern matches
| Haskell | bsd-3-clause | nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake |
441c3e5045c55f86722e882b8eb898be81407e25 | src/Network/Statsd/Cluster.hs | src/Network/Statsd/Cluster.hs | module Network.Statsd.Cluster (
Cluster,
cluster,
Network.Statsd.Cluster.increment,
Network.Statsd.Cluster.decrement,
Network.Statsd.Cluster.count,
Network.Statsd.Cluster.gauge,
Network.Statsd.Cluster.timing,
Network.Statsd.Cluster.histogram,
) where
import Network.Statsd as Statsd
import Data.Digest.... | module Network.Statsd.Cluster (
Cluster,
cluster,
Network.Statsd.Cluster.increment,
Network.Statsd.Cluster.decrement,
Network.Statsd.Cluster.count,
Network.Statsd.Cluster.gauge,
Network.Statsd.Cluster.timing,
Network.Statsd.Cluster.histogram,
) where
import Network.Statsd as Statsd
import Data.Digest.... | Check that a cluster has members | Check that a cluster has members
| Haskell | mit | keithduncan/statsd-client,keithduncan/statsd-client |
762eee5a122aebb028e96d38d1bbef6e0870451c | tests/Binary.hs | tests/Binary.hs | module Binary (tests) where
import Control.Applicative
import Data.Binary.Put
import Data.Binary.Get
import Linear
import qualified Data.ByteString.Lazy as BS
import Linear.Binary
import Test.HUnit
originalVecs :: (V3 Float, V2 Char)
originalVecs = (V3 1 2 3, V2 'a' 'b')
bytes :: BS.ByteString
bytes = runPut $ do put... | module Binary (tests) where
import Control.Applicative
import Data.Binary.Put
import Data.Binary.Get
import Linear
import qualified Data.ByteString.Lazy as BS
import Test.HUnit
originalVecs :: (V3 Float, V2 Char)
originalVecs = (V3 1 2 3, V2 'a' 'b')
bytes :: BS.ByteString
bytes = runPut $ do putLinear $ fst original... | Remove redundant import from tests | Remove redundant import from tests
Fixes #35
| Haskell | bsd-3-clause | meteogrid/linear,bgamari/linear,phaazon/linear,isomorphism/linear |
9d7bfadb27287603e841c8d875c5558a343479bf | benchmark/Main.hs | benchmark/Main.hs | module Main where
import Main.Prelude
import Criterion.Main
import qualified Hasql as H
import qualified Hasql.Serialization as HS
import qualified Hasql.Deserialization as HD
import qualified Main.Queries as Q
main =
H.connect settings >>= either (fail . show) use
where
settings =
H.ParametricSettings... | module Main where
import Main.Prelude
import Criterion.Main
import qualified Hasql as H
import qualified Hasql.Serialization as HS
import qualified Hasql.Deserialization as HD
import qualified Main.Queries as Q
main =
H.connect settings >>= either (fail . show) use
where
settings =
H.ParametricSettings... | Fix the benchmarks declaration evaluation issues | Fix the benchmarks declaration evaluation issues
| Haskell | mit | nikita-volkov/hasql |
95cc3f532067143776d1f7e65d5153c6903582c7 | test/Test/Hspec/MonadicSpec.hs | test/Test/Hspec/MonadicSpec.hs | module Test.Hspec.MonadicSpec (main, spec) where
import Test.Hspec.ShouldBe
import System.IO (stdout)
import System.IO.Silently
import qualified Test.Hspec.Monadic as H
main :: IO ()
main = hspecX spec
run :: H.Specs -> IO [String]
-- FIXME: use a mocked file handle for `stdout` instea... | module Test.Hspec.MonadicSpec (main, spec) where
import Test.Hspec.ShouldBe
import System.IO (stdout)
import System.IO.Silently
import qualified Test.Hspec.Monadic as H
main :: IO ()
main = hspecX spec
run :: H.Spec -> IO [String]
-- FIXME: use a mocked file handle for `stdout` instead... | Fix warning in test suite | Fix warning in test suite
| Haskell | mit | beni55/hspec,hspec/hspec |
11517361746c9f2abeac28589d66d8f150e92d5b | Foreign/Marshal/Utils/Lifted.hs | Foreign/Marshal/Utils/Lifted.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleContexts #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Safe #-}
#endif
{- |
Module : Foreign.Marshal.Utils.Lifted
Copyright : Bas van Dijk, Anders Kaseorg, Michael Steele
License : BSD-style
Maintainer : Bas van Dijk <v.di... | {-# LANGUAGE CPP #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleContexts #-}
#if __GLASGOW_HASKELL__ >= 710
{-# LANGUAGE Safe #-}
#elif __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
{- |
Module : Foreign.Marshal.Utils.Lifted
Copyright : Bas van Dijk, Anders Kaseorg, Michael Stee... | Fix build with ghc 7.8 | Fix build with ghc 7.8
Building with ghc-7.8 results in:
Foreign: Can't be safely imported! The module itself isn't safe.
Keep `Safe` for ghc 7.10 and above but switch back to `Trustworthy` for
earlier versions. Tested with 7.8.4, 7.10.3 and 8.0.1
Closes: https://github.com/basvandijk/lifted-base/issues/31
h '... | Haskell | bsd-3-clause | basvandijk/lifted-base |
120d266b884e80a84b39fed8bd15af86fc8d2608 | testsuite/tests/safeHaskell/safeLanguage/SafeLang15_A.hs | testsuite/tests/safeHaskell/safeLanguage/SafeLang15_A.hs | module SafeLang13_A (IsoInt, h, showH, P, p, showP) where
newtype IsoInt = I Int
h :: IsoInt
h = I 2
showH :: String
showH = let I n = h
in show n
data P = P Int
p :: P
p = P 3
showP :: P -> String
showP (P n) = "Should be 3 := " ++ show n
| module SafeLang15_A (IsoInt, h, showH, P, p, showP) where
newtype IsoInt = I Int
h :: IsoInt
h = I 2
showH :: String
showH = let I n = h
in show n
data P = P Int
p :: P
p = P 3
showP :: P -> String
showP (P n) = "Should be 3 := " ++ show n
| Fix silly mistake with SafeLang15 | Fix silly mistake with SafeLang15
| Haskell | bsd-3-clause | da-x/ghc,wxwxwwxxx/ghc,green-haskell/ghc,holzensp/ghc,ghc-android/ghc,nathyong/microghc-ghc,ghc-android/ghc,tjakway/ghcjvm,elieux/ghc,GaloisInc/halvm-ghc,oldmanmike/ghc,bitemyapp/ghc,ml9951/ghc,sdiehl/ghc,ml9951/ghc,holzensp/ghc,frantisekfarka/ghc-dsi,shlevy/ghc,elieux/ghc,da-x/ghc,hferreiro/replay,spacekitteh/smcghc,c... |
4346fb9a8b28b288207f3aadeaf5f8c2d2f6daed | src/NGramCrackers/DataTypes.hs | src/NGramCrackers/DataTypes.hs | module NGramCrackers.DataTypes
( Paragraph
, Sentence
, Word
, PageRange (..)
, PageBound (..)
, Level (..)
) where
import qualified Data.Text as T
data Paragraph = Paragraph [Sentence] deriving (Show, Read, Eq)
data Sentence = Sentence [Word] deriving (Show, Read, Eq)
type Word = T.Text
-- Page Range
data Page... | {-# LANGUAGE OverloadedStrings #-}
module NGramCrackers.DataTypes
( Paragraph
, Sentence
, Word
, PageRange (..)
, PageBound (..)
, Level (..)
) where
import qualified Data.Text as T
data Paragraph = Paragraph [Sentence] deriving (Show, Read, Eq)
data Sentence = Sentence [Word] deriving (Show, Read, Eq)
type Wor... | Add toLevel function and expand Level type | Add toLevel function and expand Level type
- toLevel was created to handle converting Text to Level.
- The OverloadedStrings pragma was added to obivate the need
to pack each Text block.
| Haskell | agpl-3.0 | R-Morgan/NGramCrackers |
e4ffc330eb0a5c3a6d727ed6d6b0dc64ef8ab9b8 | src/Hint/Util.hs | src/Hint/Util.hs | {-# LANGUAGE PatternGuards, ViewPatterns #-}
module Hint.Util where
import HSE.All
-- generate a lambda, but prettier (if possible)
niceLambda :: [String] -> Exp_ -> Exp_
niceLambda xs (Paren _ x) = niceLambda xs x
niceLambda xs (Lambda _ ((view -> PVar_ v):vs) x) = niceLambda (xs++[v]) (Lambda an vs x)
niceLambda ... | {-# LANGUAGE PatternGuards, ViewPatterns #-}
module Hint.Util where
import HSE.All
-- generate a lambda, but prettier (if possible)
niceLambda :: [String] -> Exp_ -> Exp_
niceLambda xs (Paren _ x) = niceLambda xs x
niceLambda xs (Lambda _ ((view -> PVar_ v):vs) x) = niceLambda (xs++[v]) (Lambda an vs x)
niceLambda ... | Add an extra rule to niceLambda | Add an extra rule to niceLambda | Haskell | bsd-3-clause | mpickering/hlint,ndmitchell/hlint,bitemyapp/hlint,ndmitchell/hlint,gibiansky/hlint,eigengrau/hlint |
d6f8abc6020af3d3b012b9e5cac8ee64c8745b78 | testsuite/tests/ghc-regress/numeric/should_run/arith013.hs | testsuite/tests/ghc-regress/numeric/should_run/arith013.hs | -- Test gcdInt/gcdInteger
import GHC.Base ( gcdInt )
import GHC.Num ( gcdInteger )
main :: IO ()
main = do
test gcdInt [ -42, 0, 105 ]
test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ]
test :: Integral a => (a -> a -> a) -> [a] -> IO ()
test f xs = mapM_ p... | -- Test gcdInt/gcdInteger
import GHC.Real ( gcdInt )
import GHC.Num ( gcdInteger )
main :: IO ()
main = do
test gcdInt [ -42, 0, 105 ]
test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ]
test :: Integral a => (a -> a -> a) -> [a] -> IO ()
test f xs = mapM_ p... | Adjust for the changed location of gcdInt | Adjust for the changed location of gcdInt | Haskell | bsd-3-clause | lukexi/ghc-7.8-arm64,gridaphobe/ghc,sgillespie/ghc,ml9951/ghc,mcschroeder/ghc,bitemyapp/ghc,gcampax/ghc,siddhanathan/ghc,mettekou/ghc,sdiehl/ghc,forked-upstream-packages-for-ghcjs/ghc,snoyberg/ghc,oldmanmike/ghc,da-x/ghc,vikraman/ghc,bitemyapp/ghc,elieux/ghc,siddhanathan/ghc,anton-dessiatov/ghc,wxwxwwxxx/ghc,fmthoma/gh... |
3c320c27b455decd9292f63010ccc39439a83597 | haskell/matrix/Matrix.hs | haskell/matrix/Matrix.hs | module Matrix
( Matrix
, cols
, column
, flatten
, fromList
, fromString
, reshape
, row
, rows
, shape
, transpose
) where
import Data.Vector (Vector)
data Matrix a = Matrix a
deriving (Eq, Show)
cols :: Matrix a -> Int
cols _ = undefined
column :: Int -> Matrix a -> Vector a
column _ _ = undefined
flatten ::... | module Matrix
( Matrix
, cols
, column
, flatten
, fromList
, fromString
, reshape
, row
, rows
, shape
, transpose
) where
import qualified Data.Vector as V
type Matrix a = V.Vector (V.Vector a)
chunks :: Int -> V.Vector a -> V.Vector (V.Vector a)
chunks n xs
| n < 1 || V.null xs = V.empty
| otherwise = h `... | Add Haskell solution to matrix | Add Haskell solution to matrix
| Haskell | mit | tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions |
3e2e16775ae76c76c0eb74a7d62e30cdf0056191 | wallet/src/Cardano/Wallet/API/Internal.hs | wallet/src/Cardano/Wallet/API/Internal.hs | -- | This module contains the top level API definition for frontend-related
-- tasks. The API endpoints presented here are intended for use with the
-- Daedalus client, and aren't useful for wallets, exchanges, and other users.
module Cardano.Wallet.API.Internal where
import Pos.Chain.Update (SoftwareVersio... | -- | This module contains the top level API definition for frontend-related
-- tasks. The API endpoints presented here are intended for use with the
-- Daedalus client, and aren't useful for wallets, exchanges, and other users.
module Cardano.Wallet.API.Internal where
import Pos.Chain.Update (SoftwareVersio... | Add tag description for internal API | Add tag description for internal API
| Haskell | apache-2.0 | input-output-hk/pos-haskell-prototype,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl |
cca69cf8e72c494ab32b09aae1a08ad58d8ef9f6 | compiler/SourceSyntax/Literal.hs | compiler/SourceSyntax/Literal.hs | {-# OPTIONS_GHC -Wall #-}
module SourceSyntax.Literal where
import SourceSyntax.PrettyPrint
import qualified Text.PrettyPrint as PP
data Literal = IntNum Int
| FloatNum Double
| Chr Char
| Str String
| Boolean Bool
deriving (Eq, Ord, Show)
instance Pre... | {-# OPTIONS_GHC -Wall #-}
module SourceSyntax.Literal where
import SourceSyntax.PrettyPrint
import qualified Text.PrettyPrint as PP
data Literal = IntNum Int
| FloatNum Double
| Chr Char
| Str String
| Boolean Bool
deriving (Eq, Ord, Show)
instance Pre... | Fix Char literal printing bug. | Fix Char literal printing bug.
| Haskell | bsd-3-clause | laszlopandy/elm-compiler,JoeyEremondi/elm-pattern-effects,mgold/Elm,pairyo/elm-compiler,Axure/elm-compiler,deadfoxygrandpa/Elm,5outh/Elm |
9a4ffa1072c69fee7fd35c187c1d7444fd1c4270 | testsuite/tests/ghc-regress/simplCore/should_compile/simpl003.hs | testsuite/tests/ghc-regress/simplCore/should_compile/simpl003.hs | -- !! INLINE on recursive functions.
{-
Date: Thu, 8 Dec 94 11:38:24 GMT
From: Julian Seward (DRL PhD) <sewardj@computer-science.manchester.ac.uk>
Message-Id: <9412081138.AA16652@rdf009.cs.man.ac.uk>
To: partain@dcs.gla.ac.uk
-}
module ShouldCompile where
type IMonad a
= IMonadState -> IMonadReturn a
data IMonadRe... | -- !! INLINE on recursive functions.
{-
Date: Thu, 8 Dec 94 11:38:24 GMT
From: Julian Seward (DRL PhD) <sewardj@computer-science.manchester.ac.uk>
Message-Id: <9412081138.AA16652@rdf009.cs.man.ac.uk>
To: partain@dcs.gla.ac.uk
-}
module ShouldCompile where
type IMonad a
= IMonadState -> IMonadReturn a
data IMonadRe... | Remove INLINE for recursive function | Remove INLINE for recursive function | Haskell | bsd-3-clause | ezyang/ghc,snoyberg/ghc,nushio3/ghc,fmthoma/ghc,lukexi/ghc,anton-dessiatov/ghc,hferreiro/replay,frantisekfarka/ghc-dsi,christiaanb/ghc,elieux/ghc,mcschroeder/ghc,gridaphobe/ghc,bitemyapp/ghc,shlevy/ghc,tjakway/ghcjvm,ml9951/ghc,ryantm/ghc,mettekou/ghc,oldmanmike/ghc,lukexi/ghc,wxwxwwxxx/ghc,vTurbine/ghc,fmthoma/ghc,chr... |
5812c00fc8fb2ea943eab5db6987f93288459fb3 | ZoomHub.hs | ZoomHub.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module ZoomHub where
import Data.Aeson
import GHC.Generics
import Network.Wai
import Servant
data DeepZoomImage = DeepZoomImage
{ url :: String
, width :: Integer
, height :: Integer
, tileSi... | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module ZoomHub where
import Data.Aeson
import GHC.Generics
import Network.Wai
import Servant
data DeepZoomImage = DeepZoomImage
{ url :: String
, width :: Integer
, height :: Integer
, tileSi... | Add content ID route parameter | Add content ID route parameter
| Haskell | mit | zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub |
ed642367e2cfa62a8c8bc51a08b15411ded0b285 | demo/soe/BouncingBall.hs | demo/soe/BouncingBall.hs | {- Written by Antti-Juhani Kaijanaho.
You may treat this file as if it were in the public domain.
-}
module Main where
import Graphics.SOE.Gtk
main = runGraphics $
do w <- openWindowEx "Bouncing Ball" Nothing (Just (300, 300)) drawBufferedGraphic (Just 30)
let loop x y xd yd
= do... | {- Written by Antti-Juhani Kaijanaho.
You may treat this file as if it were in the public domain.
-}
module Main where
import Graphics.SOE.Gtk
main = runGraphics $
do w <- openWindowEx "Bouncing Ball" Nothing (Just (300, 300)) drawBufferedGraphic
let loop x y xd yd
= do setGraphi... | Fix ball soe demo to work with newer soe api | Fix ball soe demo to work with newer soe api | Haskell | lgpl-2.1 | vincenthz/webkit |
7d294861e043932aab98d759f2d9115665020ebd | 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 qualified Data.Set as S
import Language.K3.Core.Annotation
import Language.K3.Analysis.Effects.Core
readSet :: K3 Effect -> S.Se... | {-# 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 ::... | Switch symbol comparisons to be on SID. | Switch symbol comparisons to be on SID.
This shouldn't be necessary, but it's a precaution against adding
annotations to the symbol itself.
| Haskell | apache-2.0 | DaMSL/K3,yliu120/K3,DaMSL/K3 |
66aa649bfa03857a4a117451caee7a823a083228 | src/HL/M/Markdown.hs | src/HL/M/Markdown.hs | {-# LANGUAGE BangPatterns #-}
-- | Markdown files.
module HL.M.Markdown where
import HL.C
import HL.Types
import Control.Exception
import qualified Data.Text.IO as ST
import qualified Data.Text.Lazy as L
import System.Directory
import System.FilePath
import ... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
-- | Markdown files.
module HL.M.Markdown where
import HL.C
import HL.Types
import HL.V.Code
import Control.Exception
import qualified Data.Text.IO as ST
import qualified Data.Text.Lazy as L
import Sy... | Support highlighting Haskell code in code fences in markdown pages | Support highlighting Haskell code in code fences in markdown pages
| Haskell | bsd-3-clause | commercialhaskell/commercialhaskell.com,erantapaa/hl,josefs/hl,snoyberg/hl,bitemyapp/commercialhaskell.com,imalsogreg/hl,sergio0213/hl,haskell-infra/hl,gbaz/hl,josefs/hl,haskell-lang/haskell-lang,haskell-lang/haskell-lang,yogsototh/hl,snoyberg/hl,imalsogreg/hl,yogsototh/hl,gbaz/hl,snoyberg/hl,commercialhaskell/commerci... |
cf047c21f8cd782c88e06ccea2bdf7cf8a0cba2b | Example.hs | Example.hs |
module Example where
{-
main xs = map head xs
-}
{-
main x = neq x
neq = not . eq
eq x = x == (0::Int)
-}
{-
main x y = neq (x::Int) y
neq x y = not (x == y)
-}
{-
main xs = (a . b . c) xs
a x = x+(1::Int)
b x = x*(4::Int)
c x = x-(3::Int)
-}
{-
main x = even (x :: Int)
-}
{-
main x = show (x :: Int)
-}
{-
mai... |
module Example where
{-
main xs = map head xs
-}
{-
main x = neq x
neq = not . eq
eq x = x == (0::Int)
-}
{-
main x y = neq (x::Int) y
neq x y = not (x == y)
-}
{-
main xs = (a . b . c) xs
a x = x+(1::Int)
b x = x*(4::Int)
c x = x-(3::Int)
-}
{-
main x = even (x :: Int)
-}
{-
main x = show (x :: Int)
-}
{-
mai... | Add a new example, based on arrays | Add a new example, based on arrays | Haskell | bsd-3-clause | ndmitchell/firstify |
117d2b78b9878278840808b049ca8b428c81d2ac | Examples/Test/Makefile.hs | Examples/Test/Makefile.hs |
module Examples.Test.Makefile(main) where
import Development.Shake(action, liftIO)
import Development.Shake.FilePath
import qualified Development.Make.Main as Makefile
import System.Environment
import System.Directory
import Examples.Util
import Control.Monad
import Data.List
import Data.Maybe
main = shaken test $ ... |
module Examples.Test.Makefile(main) where
import Development.Shake(action, liftIO)
import Development.Shake.FilePath
import qualified Development.Make.Main as Makefile
import System.Environment
import System.Directory
import Examples.Util
import Control.Monad
import Data.List
import Data.Maybe
main = shaken test $ ... | Test the makefile actually rebuilds the second time round | Test the makefile actually rebuilds the second time round
| Haskell | bsd-3-clause | nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,nh2/shake,nh2/shake |
e2f56ec993d2a555312864b846b37fccfcbac95c | src/PgRecorder.hs | src/PgRecorder.hs | {-|
Module : PgRecorder
Description : PgRecorder's main module
This is a haddock comment describing your library
For more information on how to write Haddock comments check the user guide:
<https://www.haskell.org/haddock/doc/html/index.html>
-}
module PgRecorder
( listenSession
, dbNotificationHandler
... | {-|
Module : PgRecorder
Description : PgRecorder's main module
This is a haddock comment describing your library
For more information on how to write Haddock comments check the user guide:
<https://www.haskell.org/haddock/doc/html/index.html>
-}
module PgRecorder
( listenSession
, dbNotificationHandler
... | Add listen command before wait for notifications. | Add listen command before wait for notifications.
| Haskell | bsd-3-clause | diogob/pg-recorder |
349c999fe575d0edbf856c42f490d9ca81d93598 | examples/Sysfs.hs | examples/Sysfs.hs | -- Compile from top-level with "ghc -isrc"
module Main where
import System.GPIO.Free
import System.GPIO.Linux.Sysfs (Sysfs, runSysfs)
getPins :: Sysfs [Pin]
getPins = pins
main :: IO ()
main =
do availablePins <- runSysfs getPins
print availablePins
| {-# LANGUAGE FlexibleContexts #-}
-- Compile from top-level with "ghc -isrc"
module Main where
import Control.Monad (void)
import Control.Monad.Except (MonadError, runExceptT, throwError)
import Control.Monad.IO.Class (MonadIO, liftIO)
import System.GPIO.Free
import System.GPIO.Linux.Sysfs (runSysfsT)
output :: (Mo... | Make the example program more useful. | Make the example program more useful.
| Haskell | bsd-3-clause | dhess/gpio |
b00e7657955d496f28deb29925e55171a7a514a8 | haskellCIS194/homework5/HW05.hs | haskellCIS194/homework5/HW05.hs | module HW05 where
import Ring
import Parser
-- | Exercise 1
-- >>> intParsingWorks
-- True
intParsingWorks :: Bool
intParsingWorks = (parse "3" == Just (3 :: Integer, "")) &&
(parseRing "1 + 2 * 5" == Just (11 :: Integer)) &&
(addId == (0 :: Integer))
data Mod5 = MkMod Integer
... | module HW05 where
import Ring
import Parser
import Data.Maybe
-- | Exercise 1
-- >>> intParsingWorks
-- True
intParsingWorks :: Bool
intParsingWorks = (parse "3" == Just (3 :: Integer, "")) &&
(parseRing "1 + 2 * 5" == Just (11 :: Integer)) &&
(addId == (0 :: Integer))
data Mod5... | Work on Parsing of Mod5 Ring | Work on Parsing of Mod5 Ring
| Haskell | unlicense | romanofski/codesnippets,romanofski/codesnippets,romanofski/codesnippets |
a05e1e7096e42e92d39bec351007fcd127fc8b56 | euler008/euler008.hs | euler008/euler008.hs | import Data.Char (digitToInt)
productFold :: Num a => Int -> [a] -> [a]
productFold _ [] = []
productFold n all@(_:xs) =
if length partialList == n
then product partialList : (productFold n xs)
else []
where partialList = take n all
main = do
str <- readFile "number.txt"
let number = map digitToInt ... | import Data.Char (digitToInt)
takeOrNone :: Int -> [a] -> [a]
takeOrNone n xs =
if length taken == n
then taken
else []
where taken = take n xs
productFold :: Num a => Int -> [a] -> [a]
productFold _ [] = []
productFold n all@(_:xs) =
let partialList = takeOrNone n all
in product partialList : (prod... | Move take part of solution into seperate function to clean up code | Move take part of solution into seperate function to clean up code
| Haskell | mit | marknsikora/euler |
98a22ddc5faea19b8d42bd4178ed2c8938dd368c | System/Timeout/Control.hs | System/Timeout/Control.hs | {-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}
-------------------------------------------------------------------------------
-- |
-- Module : System.Timeout.Control
-- Copyright : (c) The University of Glasgow 2007
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : lib... | {-# LANGUAGE UnicodeSyntax, NoImplicitPrelude #-}
-------------------------------------------------------------------------------
-- |
-- Module : System.Timeout.Control
-- Copyright : (c) The University of Glasgow 2007
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : lib... | Add note about side-effects to timeout | Add note about side-effects to timeout
| Haskell | bsd-3-clause | basvandijk/lifted-base |
bb054ee8429e2d60472e2a39ac66e76f8782ca41 | 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 -K100K -RTS " ++ show x
putStrLn $ "Search " ++ show x ++ " took " ++ s... |
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 -K100K -RTS " ++ show x
putStrLn $ "Search " ++ show x ++ " took " ++ s... | Add a test of Frege on Travis | Add a test of Frege on Travis
| Haskell | bsd-3-clause | ndmitchell/hoogle,ndmitchell/hoogle,ndmitchell/hoogle |
13246b0280376bcea82bb97d931f43494a48f302 | src/Mdb/Templates.hs | src/Mdb/Templates.hs |
{-# LANGUAGE OverloadedStrings, TypeOperators #-}
module Mdb.Templates (
mkHeist, indexPage
) where
import Control.Monad.Trans.Either ( eitherT )
import Data.Monoid ( (<>) )
import qualified Data.Text as T
import Heist as HEIST
import Mdb.Database
mkHeist :: FilePath -> IO (HE... |
{-# LANGUAGE OverloadedStrings, TypeOperators #-}
module Mdb.Templates (
mkHeist, indexPage
) where
import Control.Monad.Trans.Either ( eitherT )
import Data.Monoid ( (<>) )
import qualified Data.Text as T
import Heist as HEIST
import Mdb.Database
mkHeist :: FilePath -> IO (HE... | Set Heist namespace for Heist >= 0.14 | ui: Set Heist namespace for Heist >= 0.14
| Haskell | apache-2.0 | waldheinz/mdb,waldheinz/mdb,waldheinz/mdb,waldheinz/mdb |
fc2f66de8852b23bd5de210846d506637f4ea6ce | src/TechniqueMain.hs | src/TechniqueMain.hs | {-# LANGUAGE OverloadedStrings #-}
import Core.Program
import Technique.Procedure ()
main :: IO ()
main = execute $ do
write "Start" | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
import Core.Program
import Technique.Procedure ()
program :: Program None ()
program = do
write "Start"
version :: Version
version = $(fromPackage)
main :: IO ()
main = do
context <- configure version None (simple
[
])
e... | Configure program stub using package version | Configure program stub using package version
| Haskell | mit | oprdyn/technique,oprdyn/technique |
41b63f8f2b86052e0779a367e7a08ce0cca4a2a4 | src/Ganeti/JQueue/Lens.hs | src/Ganeti/JQueue/Lens.hs | {-# LANGUAGE TemplateHaskell #-}
{-| Lenses for job-queue objects
-}
{-
Copyright (C) 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your... | {-# LANGUAGE TemplateHaskell #-}
{-| Lenses for job-queue objects
-}
{-
Copyright (C) 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your... | Add a prism for ValidOpCode | Add a prism for ValidOpCode
...to be able to operate on the MetaOpCode that
is behind an InputOpCode (if we're in the right
component of the sum).
Signed-off-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>
Reviewed-by: Petr Pudlak <9d19625f8ee825a2c398462ed335cbcf98f79c32@google.com>
| Haskell | bsd-2-clause | andir/ganeti,mbakke/ganeti,mbakke/ganeti,apyrgio/ganeti,bitemyapp/ganeti,leshchevds/ganeti,bitemyapp/ganeti,yiannist/ganeti,onponomarev/ganeti,onponomarev/ganeti,andir/ganeti,andir/ganeti,yiannist/ganeti,ganeti/ganeti,dimara/ganeti,grnet/snf-ganeti,ganeti-github-testing/ganeti-test-1,grnet/snf-ganeti,leshchevds/ganeti,... |
44300e1a819c43031e6ec9c2fc3e847a573fd5d3 | sig-api/TechnicalIndicators/SMA.hs | sig-api/TechnicalIndicators/SMA.hs | module TechnicalIndicators.SMA (sma) where
import Control.Applicative ((<$>), (<*>))
import Control.Arrow ((***))
import Data.List (tails, unfoldr)
import Data.Maybe (isNothing, fromJust)
-- | Global Proposition : We suggest that the list of key value pair has been sorted by key.
-- This module just only calculate ... | module TechnicalIndicators.SMA (sma) where
import Control.Applicative ((<$>), (<*>))
import Data.List (tails, unfoldr)
cross (f, g) (x, y) = (f x, g y)
-- | Global Proposition : We suggest that the list of key value pair has been sorted by key.
-- This module just only calculate simple moving value.
sma :: Fracti... | Revert a combination of next 3 commits. | Revert a combination of next 3 commits.
Revert "[Comment] excuse for repair spec"
This reverts commit c7215083bfb48d280791f7c5153869084195cb5a.
Revert "[Refactor] arrange repair"
This reverts commit 0d61831feaa4924fcc6e888a1200392d8dbc1e2a.
Revert "cleansing and repair the argument list (key value pair list)"
This rev... | Haskell | bsd-3-clause | cutsea110/sig,cutsea110/sig |
32f0b83157275f4abbf644e8c646a7f5fc73132a | Development/Shake/Special.hs | Development/Shake/Special.hs |
-- | This module contains rule types that have special behaviour in some way.
-- Everything in this module is a hack.
module Development.Shake.Special(
specialAlwaysRebuilds,
specialIsFileKey
) where
import Development.Shake.Value
import Data.List
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.Special(
specialAlwaysRebuilds,
specialIsFileKey
) where
import Development.Shake.Value
import Data.Typeable
specialAlwaysRebuilds :: Value -> Bool
specialAlwa... | Make the special detection of always rebuilding a bit less dependent on Show instances | Make the special detection of always rebuilding a bit less dependent on Show instances
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
02be346bdb44aa06ec1311e778768eeb3e1cc5aa | mkExe.hs | mkExe.hs | {-# OPTIONS_GHC -Wall #-}
import Control.Monad
import System.Exit
import System.FilePath
import System.Process
import System.Environment
import Elm.Internal.Paths as Elm
import qualified Paths_ElmIO as ElmIO
catToFile :: [FilePath] -> FilePath -> IO ()
catT... | {-# OPTIONS_GHC -Wall #-}
import Control.Monad
import System.Exit
import System.FilePath
import System.Process
import System.Environment
import Elm.Internal.Paths as Elm
import qualified Paths_ElmIO as ElmIO
catToFile :: [FilePath] -> FilePath -> IO ()
catT... | Add some error checking for arg handler | Add some error checking for arg handler
| Haskell | bsd-3-clause | boxdot/elm-console,deadfoxygrandpa/Elm-Benchmark,boxdot/elm-console,laszlopandy/elm-console,joefiorini/IO,maxsnew/IO,maxsnew/IO,joefiorini/IO,laszlopandy/elm-console |
facca3958da8aae3dbf3fd0a8b64bf637bf623c9 | src/Application.hs | src/Application.hs | {-# LANGUAGE OverloadedStrings #-}
module Application where
import Blog.Auth
import Blog.Common
import Blog.Controllers.CommentsController
import Blog.Controllers.PostsController
import Network.Wai.Middleware.MethodOverridePost
import Web.Simple
import Web.Simple.Session
import Web.Simple.Templates
import Web.REST (re... | {-# LANGUAGE OverloadedStrings #-}
module Application where
import Blog.Auth
import Blog.Common
import Blog.Controllers.CommentsController
import Blog.Controllers.PostsController
import Network.Wai.Middleware.MethodOverridePost
import Web.Simple
import Web.Simple.Session
import Web.Simple.Templates
import Web.REST (re... | Change default admin page to new post | Change default admin page to new post
| Haskell | agpl-3.0 | alevy/mappend,alevy/mappend |
127e04ccd958b257aa20d93e505b14067799182c | MS4/dna-programs/ddp-in-memory.hs | MS4/dna-programs/ddp-in-memory.hs | {-# LANGUAGE TemplateHaskell #-}
module Main(main) where
import Data.Int
import DNA
import DDP
import DDP_Slice
----------------------------------------------------------------
-- Distributed dot product
----------------------------------------------------------------
-- | Actor for calculating dot product
ddpDot... | {-# LANGUAGE TemplateHaskell #-}
module Main(main) where
import Data.Int
import DNA
import DDP
import DDP_Slice
----------------------------------------------------------------
-- Distributed dot product
----------------------------------------------------------------
-- | Actor for calculating dot product
ddpDot... | Reduce number of elements in DDP | Reduce number of elements in DDP
| Haskell | apache-2.0 | SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC |
c0edca7d5ae15297d003581565d23f85876ea969 | src/Main.hs | src/Main.hs | -- | Main entry point.
module Main where
import HN.Config
import HN.Model.Migrations
import HN.Model.Import
import HN.Server
import HN.Types
import Snap.App
import Snap.App.Migrate
import Snap.App.Cache
import System.Environment
-- | Main entry point.
main :: IO ()
main = do
cpath:action <- getArgs
config <- ge... | -- | Main entry point.
module Main where
import HN.Config
import HN.Model.Migrations
import HN.Model.Import
import HN.Server
import HN.Types
import Snap.App
import Snap.App.Migrate
import Snap.App.Cache
import System.Environment
-- | Main entry point.
main :: IO ()
main = do
cpath:action <- getArgs
config <- ge... | Reset the cache on server restart. | Reset the cache on server restart.
| Haskell | bsd-3-clause | erantapaa/haskellnews,chrisdone/haskellnews,jwaldmann/haskellnews,haskellnews/haskellnews,jwaldmann/haskellnews,haskellnews/haskellnews,lwm/haskellnews,chrisdone/haskellnews,erantapaa/haskellnews,lwm/haskellnews |
5664d68da0feddbd5cf5a601f7a787e7eb59e964 | src/Arhelk/Lexer/Token.hs | src/Arhelk/Lexer/Token.hs | module Arhelk.Lexer.Token(
Token(..)
) where
import Data.Monoid
import Data.Text as T
import TextShow
data Token =
Word Text
| EndSentence
| QuestionMark
| ExclamationMark
| MotiveMark
| DependentMark
| Comma
| Semicolon
| Citation
| Quotation [Token]
-- | TODO: direct speech
derivin... | module Arhelk.Lexer.Token(
Token(..)
) where
import Data.Monoid
import Data.Text as T
import TextShow
-- | Kinds of tokens in generic lexer
-- Some tokens could be not used in particular languages.
data Token =
-- | Sequence on non space and non punctuational symbols
Word Text
-- | End of sentence. Ex... | Add direct speech token (not yet in lexer) and some docs | Add direct speech token (not yet in lexer) and some docs
| Haskell | bsd-3-clause | Teaspot-Studio/arhelk-lexer |
6a043bedbd2d1e93d7179fc2558abd5097a2541c | src/Language/K3/Codegen/CPP/Representation.hs | src/Language/K3/Codegen/CPP/Representation.hs | {-# LANGUAGE OverloadedStrings #-}
module Language.K3.Codegen.CPP.Representation where
import Data.String
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
class Stringifiable a where
stringify :: a -> Doc
data Name
= Name Identifier
| Qualified Identifier Name
| Specialized [Type] Name
deriving... | {-# LANGUAGE OverloadedStrings #-}
module Language.K3.Codegen.CPP.Representation where
import Data.String
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
class Stringifiable a where
stringify :: a -> Doc
data Name
= Name Identifier
| Qualified Identifier Name
| Specialized [Type] Name
deriving... | Define AST fragment for declarations. | Define AST fragment for declarations.
| Haskell | apache-2.0 | DaMSL/K3,yliu120/K3,DaMSL/K3 |
4069066e43bf0e88b511344a3db63d9ffbd9ef89 | src/ParseCabal.hs | src/ParseCabal.hs | {-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-}
module ParseCabal(parseCabal) where
import Data.List.Extra
parseCabal :: String -> [String]
parseCabal src = f ["license"] ++ f ["category"] ++ f ["author","maintainer"]
where
f name = nub [ "@" ++ head name ++ " " ++ intercalate ", " xs
... | {-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-}
module ParseCabal(parseCabal) where
import Data.List.Extra
parseCabal :: String -> [String]
parseCabal src = f ["license"] ++ f ["category"] ++ f ["author","maintainer"]
where
f name = nub [ "@" ++ head name ++ " " ++ intercalate ", " xs
... | Improve the name filter a bit | Improve the name filter a bit
| Haskell | bsd-3-clause | BartAdv/hoogle,wolftune/hoogle,ndmitchell/hogle-dead,wolftune/hoogle,ndmitchell/hoogle,BartAdv/hoogle,ndmitchell/hoogle,wolftune/hoogle,ndmitchell/hogle-dead,BartAdv/hoogle,wolftune/hoogle,ndmitchell/hoogle,BartAdv/hoogle |
e0484f1a370b55785ebe02236dfc2e0487dd86f0 | Statistics/Sample/Normalize.hs | Statistics/Sample/Normalize.hs | {-# LANGUAGE FlexibleContexts #-}
-- |
-- Module : Statistics.Sample.Normalize
-- Copyright : (c) 2017 Gregory W. Schwartz
-- License : BSD3
--
-- Maintainer : gsch@mail.med.upenn.edu
-- Stability : experimental
-- Portability : portable
--
-- Functions for normalizing samples.
module Statistics.Sample.Normal... | {-# LANGUAGE FlexibleContexts #-}
-- |
-- Module : Statistics.Sample.Normalize
-- Copyright : (c) 2017 Gregory W. Schwartz
-- License : BSD3
--
-- Maintainer : gsch@mail.med.upenn.edu
-- Stability : experimental
-- Portability : portable
--
-- Functions for normalizing samples.
module Statistics.Sample.Normal... | Make standardize return Nothing is stddev couldn't be computed | Make standardize return Nothing is stddev couldn't be computed
Add specializations and INLINABLE pragmas & expand documentation
| Haskell | bsd-2-clause | Shimuuar/statistics,bos/statistics,bos/statistics,Shimuuar/statistics |
817d76436c396784286d358f03890be26ec0ed87 | ZoomHub.hs | ZoomHub.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module ZoomHub where
import Control.Applicative
import Control.Monad.Trans.Either
import Data.Aeson as Aeson
import Data.Char
import GHC.Generics
import Network.Wai
import Servant
import System.Directory
import Types.Content
... | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module ZoomHub where
import Control.Applicative
import Control.Monad.Trans.Either
import Data.Aeson as Aeson
import Data.Char
import GHC.Generics
import Network.Wai
import Servant
import System.Directory
import Types.Content
... | Return proper HTTP 400 for missing `url` | Return proper HTTP 400 for missing `url`
| Haskell | mit | zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub |
12ba68ca559f77d4ac14c069a8fc73ceafd26dfe | src/Convention.hs | src/Convention.hs | module Convention
( Signature(..)
) where
import Data.ByteString.Builder
import Test.QuickCheck
-- |Datatype for function arguments: integers of different sizes and a pointer type
data ArgumentType
= I8
| I16
| I32
| I64
| Pointer
deriving (Eq, Enum, Bounded, Ord, Show)
-- |C syntax for data type
cT... | module Convention
( Signature(..)
) where
import Data.ByteString.Builder
import Test.QuickCheck
-- |Datatype for function arguments: integers of different sizes and a pointer type
data ArgumentType
= I8
| I16
| I32
| I64
| Pointer
deriving (Eq, Enum, Bounded, Ord, Show)
-- |C syntax for data type
pr... | Add module for function signatures | Add module for function signatures
| Haskell | bsd-3-clause | m-schmidt/fuzzer |
241b8d116906e4a07518bd2308a9b3d17b403b29 | src/PgRecorder.hs | src/PgRecorder.hs | {-|
Module : PgRecorder
Description : PgRecorder's main module
This is a haddock comment describing your library
For more information on how to write Haddock comments check the user guide:
<https://www.haskell.org/haddock/doc/html/index.html>
-}
module PgRecorder
( listenSession
, dbNotificationHandler
... | {-|
Module : PgRecorder
Description : PgRecorder's main module
This is a haddock comment describing your library
For more information on how to write Haddock comments check the user guide:
<https://www.haskell.org/haddock/doc/html/index.html>
-}
module PgRecorder
( listenSession
, dbNotificationHandler
... | Use withAsync instead of forkIO to dispatch notification. | Use withAsync instead of forkIO to dispatch notification.
| Haskell | bsd-3-clause | diogob/pg-recorder |
785600c05158a9c26b21bb82674392e823cd8481 | src/Heist/Compiled.hs | src/Heist/Compiled.hs | {-|
Compiled splices are similar to the original Heist (interpreted) splices, but
without the high performance costs of traversing a DOM at runtime. Compiled
splices do all of their DOM processing at load time. They are compiled to
produce a runtime computation that generates a ByteString Builder. This
preserves th... | {-|
Compiled splices are similar to the original Heist (interpreted) splices, but
without the high performance costs of traversing a DOM at runtime. Compiled
splices do all of their DOM processing at load time. They are compiled to
produce a runtime computation that generates a ByteString Builder. This
preserves th... | Add consolidate to the export list | Add consolidate to the export list | Haskell | bsd-3-clause | silkapp/heist |
160e52b84cbae10ad6ca3581281d9eedd054390e | ScottyWebServer.hs | ScottyWebServer.hs | {-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import qualified Data.Aeson as Aeson
import Network.Beanstalk
import qualified Control.Exception as E
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 ... | {-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import qualified Data.Aeson as Aeson
import Network.Beanstalk
import qualified Control.Exception as E
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 ... | Change the URL of the API | Change the URL of the API
| Haskell | apache-2.0 | derekmcloughlin/BridgeBuddyServer |
0f460df43f901b6ea041c8047d9404e497f74ec1 | src/Gfx/EngineState.hs | src/Gfx/EngineState.hs | module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..), GLfloat)
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, backgroundColour :: Color4 GLfloat
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseSta... | module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..))
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseState = EngineState {
fillColours = [Color4 1 1... | Remove background colour from Gfx Engine | Remove background colour from Gfx Engine
Not set here anymore
| Haskell | bsd-3-clause | rumblesan/improviz,rumblesan/improviz |
ed7e1e054c5011a3e9bcefd93c27d2a0475714dc | codeforces/BinaryStringMinimizer.hs | codeforces/BinaryStringMinimizer.hs | -- http://codeforces.com/problemset/problem/1256/D
data Case = Case { moves :: Int
, string :: String }
getMoves :: String -> Int
getMoves string = read $ last $ words string :: Int
toCase :: (String, String) -> Case
toCase (one, two) = Case { moves = getMoves one, string = two }
toPairs :: [a... | -- http://codeforces.com/problemset/problem/1256/D
data Case = Case { moves :: Int
, string :: String }
getMoves :: String -> Int
getMoves string = read $ last $ words string :: Int
toCase :: (String, String) -> Case
toCase (one, two) = Case { moves = getMoves one, string = two }
toPairs :: [a... | Print strings without double quotes | Print strings without double quotes
| Haskell | mit | julianespinel/trainning,julianespinel/training,julianespinel/training,julianespinel/training,julianespinel/trainning,julianespinel/training |
e1d5ee6a02cd647cf915f3b327432a9d908d83f3 | day17/day17.hs | day17/day17.hs | import Data.List (sort)
main = do
containers <- map (read :: String -> Int) . lines <$> readFile "input.txt"
let ascending = sort containers
print . length . ascCombos 150 $ ascending
-- Ways to fill `size` from ascending list
ascCombos :: Int -> [Int] -> [[Int]]
ascCombos _ [] = [] -- Can't fill anything... | import Data.List (sort, sortBy, groupBy)
import Data.Ord (comparing)
import Data.Function (on)
main = do
containers <- map (read :: String -> Int) . lines <$> readFile "input.txt"
let ascending = sort containers
print . length . head . groupBy ((==) `on` length)
. sortBy (comparing length) . ascC... | Complete Day 17 Part 2 | Complete Day 17 Part 2
| Haskell | mit | devonhollowood/adventofcode,devonhollowood/adventofcode |
92e06b86c53ed182fc768f7ae99b99751e2e6281 | src/Hint/Export.hs | src/Hint/Export.hs | {-
Suggest using better export declarations
<TEST>
main = 1
module Foo where foo = 1 -- module Foo(module Foo) where
module Foo(foo) where foo = 1
module Foo(module Foo) where foo = 1 -- @Ignore module Foo(...) where
module Foo(module Foo, foo) where foo = 1 -- module Foo(..., foo) where
</TEST>
-}
module Hint.Ex... | {-
Suggest using better export declarations
<TEST>
main = 1
module Foo where foo = 1 -- module Foo(module Foo) where
module Foo(foo) where foo = 1
module Foo(module Foo) where foo = 1 -- @Ignore module Foo(...) where
module Foo(module Foo, foo) where foo = 1 -- module Foo(..., foo) where
</TEST>
-}
module Hint.Ex... | Improve the casing of one particular note | Improve the casing of one particular note
| Haskell | bsd-3-clause | ndmitchell/hlint,ndmitchell/hlint |
b3e25ee579ad44a35b4cbf243b05728c4f63c5d1 | src/Rules/Setup.hs | src/Rules/Setup.hs | module Rules.Setup (setupRules) where
import qualified System.Info
import Base
import CmdLineFlag
import Rules.Actions
import Rules.Generators.GhcAutoconfH
setupRules :: Rules ()
setupRules = do
-- We always rerun the configure script in this mode, because the flags
-- passed to it can affect the contents of... | module Rules.Setup (setupRules) where
import qualified System.Info
import Base
import CmdLineFlag
import Rules.Actions
import Rules.Generators.GhcAutoconfH
setupRules :: Rules ()
setupRules = do
[configFile, "settings", configH] &%> \[cfg, settings, cfgH] -> do
need [ settings <.> "in", cfgH <.> "in", "c... | Drop alwaysRerun from setup rules. | Drop alwaysRerun from setup rules.
| Haskell | bsd-3-clause | sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,izgzhen/hadrian,sdiehl/ghc,snowleopard/shaking-up-ghc,sdiehl/ghc,bgamari/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc,snowleopard/hadrian |
84e824da492ce320e2b4fa86829a1a6429726a99 | test/Homework/Week06Spec.hs | test/Homework/Week06Spec.hs | module Homework.Week06Spec (
main,
spec
) where
import Test.Hspec
import Homework.Week06.Assignment
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "week 6" $ do
it "needs some tests!" $ do
pending | module Homework.Week06Spec (
main,
spec
) where
import Test.Hspec
import Homework.Week06.Assignment
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "fib" $ do
it "returns fibonacci numbers" $ do
pending
fib 0 `shouldBe` 0
fib 1 `shouldBe` 1
fib 2 `shouldBe` 1
... | Add specs for week 6 | Add specs for week 6
| Haskell | mit | jxv/cis-194-winter-2016 |
0e452fdcb39c05d1f9cc5a0f42f2fd0a519bbace | src/Main.hs | src/Main.hs |
module Main where
import System.Exit (exitFailure, exitSuccess)
import HsImport
main :: IO ()
main = do
args <- hsImportArgs
maybeSpec <- hsImportSpec args
case maybeSpec of
Left error -> putStrLn ("hsimport: " ++ error) >> exitFailure
Right spec -> hsImport spec >>... |
module Main where
import System.Exit (exitFailure, exitSuccess)
import System.IO (hPutStrLn, stderr)
import HsImport
main :: IO ()
main = do
args <- hsImportArgs
maybeSpec <- hsImportSpec args
case maybeSpec of
Left error -> hPutStrLn stderr ("hsimport: " ++ error) >> exitFailure
Right... | Write errors to stderr instead of stdout | Write errors to stderr instead of stdout
| Haskell | bsd-3-clause | dan-t/hsimport,jystic/hsimport |
dda5b75825021b3e9535e828638feff0c020d72c | tests/shouldwork/CSignal/MAC.hs | tests/shouldwork/CSignal/MAC.hs | module MAC where
import CLaSH.Prelude
import CLaSH.Prelude.Explicit
type Clk100 = Clk "clk" 100
clk100 :: SClock Clk100
clk100 = sclock
topEntity :: (CSignal Clk100 Integer, CSignal Clk100 Integer)
-> (CSignal Clk100 Bool, CSignal Clk100 Integer)
topEntity = sync clk100 macT 0
macT s (x,y) = (s',Just o)
... | module MAC where
import CLaSH.Prelude
import CLaSH.Prelude.Explicit
type Clk100 = Clk "clk" 101
clk100 :: SClock Clk100
clk100 = sclock
topEntity :: (CSignal Clk100 Integer, CSignal Clk100 Integer)
-> CSignal Clk100 Integer
topEntity = cmealyB clk100 macT 0
macT s (x,y) = (s', o)
where
s' = s + (x ... | Update CSignal/Mac test to new prelude | Update CSignal/Mac test to new prelude
| Haskell | bsd-2-clause | christiaanb/clash-compiler,ggreif/clash-compiler,christiaanb/clash-compiler,ggreif/clash-compiler |
c120ce2a88ca421bd0b3166333801f69553d90d5 | src/Data/Linear.hs | src/Data/Linear.hs | {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Data.Linear where
const :: a ⊸ b -> a
const a _ = a
| {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Data.Linear where
liftUnit :: a ⊸ () ⊸ a
liftUnit a () = a
flip :: (a ⊸ b ⊸ c ) ⊸ b ⊸ a ⊸ c
flip f b a = f a b
| Add linear versions of flip and const | Add linear versions of flip and const
| Haskell | bsd-3-clause | m0ar/safe-streaming,m0ar/safe-streaming |
e811f44f57df07ebdfdc4ad7a4378229de276322 | Setup.hs | Setup.hs | module Main (main) where
import Distribution.Simple (defaultMainWithHooks, runTests, simpleUserHooks)
import System.Cmd (system)
main :: IO ()
main = defaultMainWithHooks $ simpleUserHooks { runTests = runTests' } where
runTests' _ _ _ _ = do
system "runhaskell -i./dist/build tests/Simple.hs"
return ()
| module Main (main) where
import Control.Monad (unless)
import Distribution.Simple (defaultMainWithHooks, runTests, simpleUserHooks)
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..))
import Distribution.Simple.Utils (die)
import System.Cmd (system)
import System.Directory (doesDirectoryExist)
main :: IO (... | Check if the library has been built before running tests. | Check if the library has been built before running tests.
| Haskell | bsd-3-clause | Mikehunan/network,iquiw/network,iquiw/network,Mikehunan/network,jspahrsummers/network |
2529d77de6966ac3ca008e3ba5e45b8fcb43e18d | src/Text/Karver/Types.hs | src/Text/Karver/Types.hs | -- |
-- Module: Data.Karver.Types
-- Copyright: Jeremy Hull 2013
-- License: BSD3
--
-- Maintainer: Jeremy Hull <sourdrums@gmail.com>
-- Stability: experimental
-- Portability: unknown
--
-- Base types used throughout Karver.
module Text.Karver.Types
( Tokens(..)
, Value(..)
) where
import Prelude hidin... | -- |
-- Module: Data.Karver.Types
-- Copyright: Jeremy Hull 2013
-- License: BSD3
--
-- Maintainer: Jeremy Hull <sourdrums@gmail.com>
-- Stability: experimental
-- Portability: unknown
--
-- Base types used throughout Karver.
module Text.Karver.Types
( Tokens(..)
, Value(..)
) where
import Data.Text (Te... | Remove the hiding of FilePath import | Remove the hiding of FilePath import
| Haskell | bsd-3-clause | sourrust/karver,ibotty/stencil |
2213ab02c2b42fb6d63ffb5718eb0d87f68699fa | 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 System.Environment
validate :: FilePath -> String -> String
validate file = unlines . f . parseTagsOptions opts
where
opts = options{opt... | {-
Example program for TagSoup.
Detects basic syntax errors like isolated ampersands and unquoted attribute values.
-}
module Main where
import Text.HTML.TagSoup
import System.Environment
validate :: String -> String
validate = unlines . f . parseTagsOptions opts
where
opts = options{optTagPosition=True,... | Remove the file argument from validate, was not being used | Remove the file argument from validate, was not being used | Haskell | bsd-3-clause | silkapp/tagsoup |
d1457970053b2c9adff37a72feb3bcee9f2279c6 | src/LLVM/Analysis.hs | src/LLVM/Analysis.hs | -- | This is the top-level LLVM IR module. It provides definitions of
-- the IR and some basic functions to inspect it. More advanced analysis
-- is provided by the modules in LLVM.Analysis.*. They are not exported
-- here due to name collisions and to avoid namespace pollution.
module LLVM.Analysis (
module Data.... | -- | This top-level module exports the LLVM IR definitions and some
-- basic functions to inspect the IR. The sub-modules under
-- LLVM.Analysis provide higher-level tools for analyzing the IR.
module LLVM.Analysis (
-- * Parsing LLVM Bitcode
-- $parsing
module Data.LLVM.Types
) where
import Data.LLVM.Types
... | Add high-level documentation on parsing bitcode | Add high-level documentation on parsing bitcode
| Haskell | bsd-3-clause | wangxiayang/llvm-analysis,wangxiayang/llvm-analysis,travitch/llvm-analysis,travitch/llvm-analysis |
aea88838946157dda3fba10c8188b82954bd93f1 | src/NGramCrackers/ListManipulation.hs | src/NGramCrackers/ListManipulation.hs | 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... | module NGramCrackers.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 ... | Change module declaration for use in Main | Change module declaration for use in Main
| Haskell | agpl-3.0 | R-Morgan/NGramCrackers |
d57a84c72849d830292b2b3475600ac03ca60a38 | src/Main.hs | src/Main.hs | import qualified Parser
runEvalWith input = do
let ast = Parser.parse input
putStrLn $ "Ast: " ++ (show ast)
main :: IO ()
main = do
putStrLn "; Generated by HDC"
program <- getContents
runEvalWith program
| import qualified Parser
import qualified Text.Show.Pretty as Pr
runEvalWith input = do
let syntax_tree = Parser.parse input
putStrLn $ "Syntax tree:\n" ++ (Pr.ppShow syntax_tree)
main :: IO ()
main = do
putStrLn "; Generated by HDC"
program <- getContents
runEvalWith program
| Use PrettyPrint. Needs to be included in cabalfile | Use PrettyPrint. Needs to be included in cabalfile
| Haskell | mit | aleksanb/hdc |
a87248bbf0ae228168510b1933eb173a7cb18cf7 | src/Type.hs | src/Type.hs |
module Type where
import Language.Haskell.Exts
import Util
data Idea = Idea {text :: String, loc :: SrcLoc, from :: String, to :: String}
deriving Eq
idea s loc from to = Idea s loc (prettyPrint from) (prettyPrint to)
instance Show Idea where
show x = unlines $
[showSrcLoc (loc x) ++ " " ... |
module Type where
import Language.Haskell.Exts
import Util
-- Key is Data.List.split, for example
data Idea = Idea {key :: String, text :: String, loc :: SrcLoc, from :: String, to :: String}
deriving Eq
idea s loc from to = Idea "" s loc (prettyPrint from) (prettyPrint to)
instance Show Idea where
... | Add a key to each type, to enable ignoring | Add a key to each type, to enable ignoring | Haskell | bsd-3-clause | eigengrau/hlint,ndmitchell/hlint,gibiansky/hlint,ndmitchell/hlint,bitemyapp/hlint,mpickering/hlint |
d12ffe86b2f1b10de1df1ee4c835f7599230e590 | main/keter.hs | main/keter.hs | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
import Prelude (error, (++), ($), IO, putStrLn)
import System.Environment (getArgs, getProgName)
import Keter.Main (keter)
import Paths_keter (version)
import Data.Version (showVersion)
import qualified Keter.Plugin.Postgres as Postgres
import Data.D... | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
import Prelude (error, (++), ($), IO, putStrLn)
import System.Environment (getArgs, getProgName)
import Keter.Main (keter)
import Paths_keter (version)
import Data.Version (showVersion)
import qualified Keter.Plugin.Postgres as Postgres
import Data.D... | Print usage when passed `--help` | Print usage when passed `--help`
| Haskell | mit | mwotton/keter,creichert/keter,ajnsit/keter,andrewthad/keter,telser/keter,creichert/keter,snoyberg/keter,bermanjosh/keter,snoyberg/keter,tolysz/keter,ajnsit/keter,telser/keter,bermanjosh/keter,andrewthad/keter,mwotton/keter,tolysz/keter |
ffb36331f09c9522931748ed5fe5cbd0c34cdcac | examples/Test.hs | examples/Test.hs | module Main where
import System.Console.Haskeline
import System.Console.Haskeline.Monads
mySettings :: MonadIO m => Settings m
mySettings = defaultSettings {historyFile = Just "myhist",
handleSigINT = True}
myComplete :: Monad m => CompletionFunc m
myComplete s = return (s,[])
main :: IO ()
... | module Main where
import System.Console.Haskeline
import System.Console.Haskeline.Monads
import qualified System.IO.UTF8 as UTF8
mySettings :: MonadIO m => Settings m
mySettings = defaultSettings {historyFile = Just "myhist",
handleSigINT = True}
myComplete :: Monad m => CompletionFunc m
myCo... | Make test program output UTF8 correctly. | Make test program output UTF8 correctly. | Haskell | bsd-3-clause | judah/haskeline,judah/haskeline,leroux/packages-haskeline,ghc/packages-haskeline,ghc/packages-haskeline |
c8b249c0849264945231d58db56c07c5afdbeeb5 | 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, 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... | Use defaults making the literate type just a Bool | Use defaults making the literate type just a Bool
| Haskell | mit | sourrust/hyakko |
d2a6a21612646af8f379df053b509369190999fd | haskell/BT/Types.hs | haskell/BT/Types.hs | {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
module BT.Types where
import Database.Redis as RD
import System.ZMQ3 as ZMQ
import Data.Pool
import Data.Typeable
import Control.Exception
import Data.Aeson
import Control.Applicative
import Control.Monad (mzero)
data PersistentConns = Persistent... | {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
module BT.Types where
import Database.Redis as RD
import System.ZMQ3 as ZMQ
import Data.Pool
import Data.Typeable
import Control.Exception
import Data.Aeson
import Control.Applicative
import Control.Monad (mzero)
data PersistentConns = Persistent... | Allow id to be anything as the standard claims | Allow id to be anything as the standard claims
| Haskell | mit | c00w/BitToll,c00w/BitToll,c00w/BitToll,c00w/BitToll |
4f80784d441ec93d1418d317cfc21af0044f5823 | src/Foreign/Inference/AnalysisMonad.hs | src/Foreign/Inference/AnalysisMonad.hs | {-# LANGUAGE GeneralizedNewtypeDeriving, NoMonomorphismRestriction #-}
module Foreign.Inference.AnalysisMonad (
AnalysisMonad,
runAnalysis,
analysisEnvironment,
analysisLocal,
analysisGet,
analysisPut
-- module Control.Monad.RWS.Strict
) where
import Control.Lens
import Control.Monad.RWS.Strict
import ... | {-# LANGUAGE GeneralizedNewtypeDeriving, NoMonomorphismRestriction #-}
module Foreign.Inference.AnalysisMonad (
AnalysisMonad,
runAnalysis,
analysisEnvironment,
analysisLocal,
analysisGet,
analysisPut
) where
import Control.Lens
import Control.Monad.RWS.Strict
import Foreign.Inference.Diagnostics
newty... | Remove a commented out line of code | Remove a commented out line of code
| Haskell | bsd-3-clause | travitch/foreign-inference,travitch/foreign-inference |
0faabfd0f95fa9262e732f35e19690ce33047272 | subs/pantry/test/Pantry/HPackSpec.hs | subs/pantry/test/Pantry/HPackSpec.hs | module Pantry.HPackSpec (spec) where
import Test.Hspec
import Pantry
import Pantry.HPack
import Path
isVersion :: Version -> Bool
isVersion _ = True
spec :: Spec
spec = describe "Parse HPack version" $ do
it "Shipped hpack version" $ do
version <- runPantryApp $ hpackVersion
version `shouldSatisfy` isVersi... | module Pantry.HPackSpec (spec) where
import Test.Hspec
import RIO
import Pantry
import Pantry.HPack
import Path
isVersion :: Version -> Bool
isVersion _ = True
customHpack :: (HasLogFunc env, HasPantryConfig env) => FilePath -> RIO env a -> RIO env a
customHpack fp f = do
env <- ask
let a = set (pantryConfigL . ... | Update test according to new function | Update test according to new function
| Haskell | bsd-3-clause | juhp/stack,juhp/stack |
51f05d5765548fbf8caaa163647c8b03980b0d12 | testsuite/tests/ghc-regress/ffi/should_run/ffi016.hs | testsuite/tests/ghc-regress/ffi/should_run/ffi016.hs | -- Tests ForeignPtrEnv finalizers
import Text.Printf
import Foreign.ForeignPtr
import Foreign
import GHC.TopHandler
import Control.Concurrent
import Data.List
import System.Mem
foreign export ccall fin :: Ptr Int -> Ptr Int -> IO ()
foreign import ccall "&fin" finptr :: FinalizerEnvPtr Int Int
fin :: Ptr Int -> Ptr ... | -- Tests Foreign.Concurrent finalizers
import Text.Printf
import Foreign.Concurrent as Conc
import Foreign
import GHC.TopHandler
import Control.Concurrent
import Data.List
import System.Mem
-- This finalizer calls back into Haskell, so we can't use
-- the ordinary newForeignPtr.
foreign export ccall fin :: Ptr Int ->... | Fix this test: it was using a C finalizer that called back into Haskell Which isn't allowed using the ordinary newForeignPtr any more, it has to be done with Foreign.Concurrent.newForeignPtr. | Fix this test: it was using a C finalizer that called back into Haskell
Which isn't allowed using the ordinary newForeignPtr any more, it has
to be done with Foreign.Concurrent.newForeignPtr.
| Haskell | bsd-3-clause | anton-dessiatov/ghc,anton-dessiatov/ghc,sgillespie/ghc,acowley/ghc,anton-dessiatov/ghc,vikraman/ghc,elieux/ghc,vikraman/ghc,nushio3/ghc,vTurbine/ghc,tibbe/ghc,urbanslug/ghc,siddhanathan/ghc,ghc-android/ghc,snoyberg/ghc,da-x/ghc,bitemyapp/ghc,mcschroeder/ghc,sdiehl/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,christiaanb/ghc,hferre... |
14a2321a0857cd8a620fbe94ee6d0341090a093f | src/haskell/Main.hs | src/haskell/Main.hs | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import BasicPrelude hiding (readFile)
import Data.Set (fromList, toList)
import Data.Text (pack)
import Text.XML
import Text.XML.Cursor
osisElement :: Text -> Cursor -> [Cursor]
osisElement localName = element $ Name localName (J... | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import BasicPrelude hiding (readFile, Word)
import Data.Set (fromList, toList)
import Data.Text (pack)
import Text.XML
import Text.XML.Cursor
data Reference = Reference
{ getResource :: Text
, getLocation :: Text
} deriving... | Read more structure from SBLGNT. | Read more structure from SBLGNT.
| Haskell | mit | scott-fleischman/greek-grammar,scott-fleischman/greek-grammar |
abb03accc5a28226b2fd112928dc58435c0d50dc | app/Main.hs | app/Main.hs | {-
Homophone - Discover related artists
Copyright (C) 2019 Michael Dippery <michael@monkey-robot.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at yo... | {-
Homophone - Discover related artists
Copyright (C) 2019 Michael Dippery <michael@monkey-robot.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at yo... | Print all related artists alphabetically | Print all related artists alphabetically
This is really ugly code, but hey, at least it works.
| Haskell | mit | mdippery/homophone |
8f0bd08d4e355aac3dabde2e4192e5cee54247a7 | file-modules/src/Main.hs | file-modules/src/Main.hs | module Main where
import Control.Concurrent.Async (mapConcurrently)
import Control.Monad (forM_)
import Data.List.Utils (uniq)
import Development.FileModules
import System.Environment (getArgs)
main :: IO ()
main = do
args <- getArgs
... | module Main where
import Control.Concurrent.Async (mapConcurrently)
import Control.Monad (forM_)
import Data.List.Utils (uniq)
import Development.FileModules
import System.Environment (getArgs)
import System.Exit (exitFa... | Add `file-modules` `--version` and `--help` | Add `file-modules` `--version` and `--help`
| Haskell | mit | yamadapc/stack-run-auto |
a77988a1292a3a447903c4f9bced6a18ecc34d55 | src/Display.hs | src/Display.hs | -- |Netrium is Copyright Anthony Waite, Dave Hetwett, Shaun Laurens 2009-2015, and files herein are licensed
-- |under the MIT license, the text of which can be found in license.txt
--
{-# OPTIONS_HADDOCK hide #-}
module Display (
module Data.Tree,
Display(..),
trimDepth,
module WriteDotGraph,
di... | -- |Netrium is Copyright Anthony Waite, Dave Hetwett, Shaun Laurens 2009-2015, and files herein are licensed
-- |under the MIT license, the text of which can be found in license.txt
--
{-# OPTIONS_HADDOCK hide #-}
module Display (
module Data.Tree,
Display(..),
trimDepth,
module WriteDotGraph,
di... | Replace deprecated System.Cmd with System.Process | Replace deprecated System.Cmd with System.Process
| Haskell | mit | netrium/Netrium |
a2a9ba91998941a736287549a288b9956cbe2b58 | src/Main.hs | src/Main.hs | module Main where
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Text as T
import Data.Text.IO (writeFile)
import Iptf.Hosts
import Iptf.Ip
import Iptf.Options
import Network.HTTP.Conduit (simpleHttp)
import Prelude hiding (writeFile)
... | module Main where
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Text as T
import Data.Text.IO (writeFile)
import Iptf.Hosts
import Iptf.Ip
import Iptf.Options
import Network.HTTP.Conduit (simpleHttp)
import Prelude hiding (writeFile)
... | Update run to work with Hosts file | Update run to work with Hosts file
| Haskell | mit | werbitt/ip-to-file |
8d8d93ea433acbef7ab799eea968a515ef61d753 | Handler/Home.hs | Handler/Home.hs | module Handler.Home where
import Import hiding (on, (==.))
import Database.Esqueleto
import qualified Database.Esqueleto as E
getProfileR :: Handler Html
getProfileR = do
userId <- requireAuthId
items <- runDB $ select $ from $ \(r `LeftOuterJoin` u) -> do
on (r ^. ReadableId ==. u ^. UserReadingRea... | module Handler.Home where
import Control.Lens hiding (from, on)
import Import hiding (on, (==.))
import Database.Esqueleto hiding ((^.))
import qualified Database.Esqueleto as E
getProfileR :: Handler Html
getProfileR = do
userId <- requireAuthId
items <- runDB $ select $ from $ \(r `LeftOuterJoin` u) -> do
... | Fix return value in profile join query | Fix return value in profile join query
| Haskell | mit | darthdeus/reedink,darthdeus/reedink |
b3ba029fa3847ac76d4cb609c356084e069783c3 | apiserver/BT/EndPoints.hs | apiserver/BT/EndPoints.hs | {-# LANGUAGE OverloadedStrings #-}
module BT.EndPoints(register, helloworld) where
import Data.ByteString.Lazy.Char8 (pack)
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as BL
import Database.Redis
import Network.Wai (Request)
import Numeric (showHex)
import System.Random (getStdRan... | {-# LANGUAGE OverloadedStrings #-}
module BT.EndPoints(register, helloworld) where
import Data.ByteString.Lazy.Char8 (pack)
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Database.Redis
import Network.Wai (Request)
import Numeric (sh... | Use much larger keys and make them read from /dev/urandom | Use much larger keys and make them read from /dev/urandom
| Haskell | mit | c00w/BitToll,c00w/BitToll,c00w/BitToll,c00w/BitToll |
7e09dd8d628a102776f6332f40692ec1a200a544 | BuildTest.hs | BuildTest.hs | module Main where
import qualified Hapistrano as Hap
import Control.Monad (void)
testConfig :: Hap.Config
testConfig = Hap.Config { Hap._deployPath = "/tmp/project"
, Hap._host = "localhost"
, Hap._repository = "/tmp/testrepo"
, Hap._revisi... | module Main where
import qualified Hapistrano as Hap
import Control.Monad (void)
testConfig :: Hap.Config
testConfig = Hap.Config { Hap._deployPath = "/tmp/project"
, Hap._host = "localhost"
, Hap._repository = "/tmp/testrepo"
, Hap._revisi... | Use void instead of explicit return of (). | Use void instead of explicit return of ().
| Haskell | mit | stackbuilders/hapistrano |
676f43ead1cf03a707d4ef8b2f657f5397bfdda7 | ptk/Main.hs | ptk/Main.hs | {- |
Module : Main
Description : Runs the puffy tool kit (ptk)
Copyright : 2014, Peter Harpending
License : BSD3
Maintainer : Peter Harpending <pharpend2@gmail.com>
Stability : experimental
Portability : Linux
-}
module Main where
import PuffyTools.Ptk
import System.Environme... | {- |
Module : Main
Description : Runs the puffy tool kit (ptk)
Copyright : 2014, Peter Harpending
License : BSD3
Maintainer : Peter Harpending <pharpend2@gmail.com>
Stability : experimental
Portability : Linux
-}
module Main where
-- import Control.Applicative
-- import Syste... | Move main.hs back to a dummy file. | Move main.hs back to a dummy file.
| Haskell | bsd-3-clause | pharpend/puffytools |
d5c43653473f94a606c8f6b1144d20e4a9fe0dd4 | 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
main = defaultMainWith defaultConfig (return ()) [
bgroup "fib" [
bench "fib 10" $ whnf fib 10
, bench "fib 30" $ whnf fib... | {-# LANGUAGE ScopedTypeVariables #-}
import Criterion.Main
import Control.Parallel
import qualified Data.IntMap as I
import Data.List (foldl')
import Criterion.Config
main = defaultMainWith defaultConfig (return ()) [
bgroup "fib" [
bench "fib 10" $ whnf fib 10
, bench "fib 20" $ whnf fib... | Make the tiny example less tiny. | Make the tiny example less tiny.
| Haskell | bsd-2-clause | bos/criterion,osa1/criterion,rrnewton/criterion,iu-parfunc/criterion,paulolieuthier/criterion,bgamari/criterion,rrnewton/criterion,paulolieuthier/criterion,rrnewton/criterion,bgamari/criterion,iu-parfunc/criterion,osa1/criterion,bos/criterion,iu-parfunc/criterion,paulolieuthier/criterion,bgamari/criterion,bos/criterion |
08938273a98de9baeaa0ff1128961a480157757e | src/NGramCrackers/ParagraphParsers.hs | src/NGramCrackers/ParagraphParsers.hs | module NGramCrackers.ParagraphParsers (
parseParagraph
, parseMultiPara
) where
import Text.ParserCombinators.Parsec
import Data.List (concat, unwords)
{- Elementary parser combinataors. -}
document = sepBy paragraph eop
paragraph = sepBy sentence eos
sentence = sepBy word seppr -- (oneOf " \n")
word = ... | module NGramCrackers.ParagraphParsers (
parseParagraph
, parseMultiPara
) where
import Data.List (concat, unwords)
import Data.Text
import Text.ParserCombinators.Parsec
{- Elementary parser combinataors. -}
document :: Parser [[[String]]]
document = endBy paragraph eop
paragraph :: Parser [[String]]
paragraph = ... | Add type signatures for parsers | Add type signatures for parsers
| Haskell | agpl-3.0 | R-Morgan/NGramCrackers |
1cb6a0fde390ad4bd7eb4848c114a8eeddf9d7ea | src/Widgets/PanelNavigator.hs | src/Widgets/PanelNavigator.hs | {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecursiveDo #-}
module Widgets.PanelNavigator
( panelNavigator
) where
import Control.Monad (void)
import Data.Default (def)
import CommonTypes
import Widgets.Generation
panelNavigator :: Reflex t =... | {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecursiveDo #-}
module Widgets.PanelNavigator
( panelNavigator
) where
import Control.Monad (void)
import Data.Default (def)
import CommonTypes
import Widgets.Generation
panelNavigator :: Reflex t =... | Add nav wrapper for html element of panel navigator | Add nav wrapper for html element of panel navigator
| Haskell | mit | achirkin/qua-view,achirkin/qua-view,achirkin/qua-view |
44d16d6db1ab530e8027e1194653b6adc5b39c46 | src/Genes.hs | src/Genes.hs | module Genes(DnaString, Basis(G,A,T,C), crossover, mutate) where
data Basis = G | A | T | C
deriving (Eq, Show)
type DnaString = [Basis]
crossover :: Int -> DnaString -> DnaString -> DnaString
crossover crossoverPoint dna1 dna2 = (take crossoverPoint dna1) ++ (drop crossoverPoint dna2)
mutate :: Int -> Basis -> D... | module Genes(DnaString, Basis(G,A,T,C), crossover, mutate) where
data Basis = G | A | T | C
deriving (Eq, Show)
type DnaString = [Basis]
crossover :: Int -> DnaString -> DnaString -> DnaString
crossover crossoverPoint dna1 dna2 = (take crossoverPoint dna1) ++ (drop crossoverPoint dna2)
mutate :: Int -> Basis -> D... | Refactor crossover to be more readable | Refactor crossover to be more readable
| Haskell | bsd-3-clause | satai/FrozenBeagle |
8a4c88ad44a712b9257df6f4f9b024d9a98e297c | test/main.hs | test/main.hs | {-# LANGUAGE MagicHash, UnboxedTuples #-}
import Control.Monad.Primitive
import Data.Primitive.Array
import GHC.IO
import GHC.Prim
-- Since we only have a single test case right now, I'm going to avoid the
-- issue of choosing a test framework for the moment. This also keeps the
-- package as a whole light on dependen... | {-# LANGUAGE MagicHash, UnboxedTuples #-}
import Control.Monad.Primitive
import Data.Primitive.Array
import GHC.IO
import GHC.Prim
-- Since we only have a single test case right now, I'm going to avoid the
-- issue of choosing a test framework for the moment. This also keeps the
-- package as a whole light on dependen... | Fix test suite for older GHCs | Fix test suite for older GHCs
| Haskell | bsd-3-clause | ekmett/primitive,dolio/primitive |
604c3556b6cb07690c28336cacdf70ed950c3e51 | 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 == "git-annex" ... | 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... | Disable LLVM flag when building arithmoi. | Disable LLVM flag when building arithmoi.
| Haskell | bsd-3-clause | spencerjanssen/cabal2nix,dmalikov/cabal2nix,Fuuzetsu/cabal2nix,jb55/cabal2nix,bennofs/cabal2nix,psibi/cabal2nix,gridaphobe/cabal2nix |
dcebb91f6eb39528d68f449d6b9fe2b3082e7040 | 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 == "git-annex" ... | module Cabal2Nix.Flags ( configureCabalFlags ) where
import Distribution.Package
import Distribution.PackageDescription
configureCabalFlags :: PackageIdentifier -> FlagAssignment
configureCabalFlags (PackageIdentifier (PackageName name) _)
| name == "accelerate-examples"= [disable "opencl"]
| name == "git-annex" ... | Enable all extensions in xmobar by default. | Enable all extensions in xmobar by default.
https://github.com/NixOS/nixpkgs/pull/2728
| Haskell | bsd-3-clause | psibi/cabal2nix,bennofs/cabal2nix,gridaphobe/cabal2nix,Fuuzetsu/cabal2nix,jb55/cabal2nix,dmalikov/cabal2nix,spencerjanssen/cabal2nix |
57603b1f1138f92f2363157617f003f19ff20def | Simulation/Lib/src/SimulationConstants.hs | Simulation/Lib/src/SimulationConstants.hs | module SimulationConstants ( dimensionCount
, zeroPhenotypeVec
, maxSteps
, optimumChangeGeneration
, accidentDeathProbability
, probabilityAlleleMutation
, o... | module SimulationConstants ( dimensionCount
, zeroPhenotypeVec
, maxSteps
, optimumChangeGeneration
, accidentDeathProbability
, probabilityAlleleMutation
, o... | Make constant environment to last a bit longer | Make constant environment to last a bit longer
| Haskell | bsd-3-clause | satai/FrozenBeagle |
9097e704219d9b9d12541e1b47cec16e20c39e2b | testsuite/ngcTests.hs | testsuite/ngcTests.hs | import Test.QuickCheck
import NGramCrackers.ListManipulation
{-| Test whether all bigrams are 2 words long
quickCheck (\s -> all ( == 2) (map length $ bigrams s))
quickCheck (\s -> all (==2) (map length $ getNSeqFromList 2 s))
quickCheck (\n s -> all (==n) (map length $ getNSeqFromList n s))
quickCheck (\n s ->... | import Test.QuickCheck
import NGramCrackers.ListManipulation
{-| Test whether all bigrams are 2 words long
quickCheck (\s -> all ( == 2) (map length $ bigrams s))
quickCheck (\s -> all (==2) (map length $ getNSeqFromList 2 s))
quickCheck (\n s -> all (==n) (map length $ getNSeqFromList n s))
quickCheck (\n s ->... | Add minimal test for getNSeqFromList function | Add minimal test for getNSeqFromList function
-- genIntsStrings generates a tuple with the necessary arguments
for the genNSeqProp function. The generator generates a more
constrained dataset that will pass. This change will require
retooling the getNSeqFromList function so that it provides
erro... | Haskell | agpl-3.0 | R-Morgan/NGramCrackers |
dab88636899b70305b43192b22c9725bde1ee3a5 | haskell/scrabble-score/Scrabble.hs | haskell/scrabble-score/Scrabble.hs | module Scrabble
( scoreLetter
, scoreWord
) where
import Data.Char (toLower)
scoreLetter :: Char -> Int
scoreLetter letter
| isIn "dg" = 2
| isIn "bcmp" = 3
| isIn "fhvwy" = 4
| isIn "k" = 5
| isIn "jx" = 8
| isIn "qz" = 10
| otherwise = 1
where isIn x = toLower letter... | module Scrabble
( scoreLetter
, scoreWord
) where
import Data.Char (toLower)
import Data.Map (findWithDefault, fromList)
scoreLetter :: Char -> Int
scoreLetter letter = findWithDefault 0 (toLower letter) scores where
scores = fromList $ concat
[ repeatZip 1 "aeilnorstu"
, repeatZip 2 "dg"
... | Use a Map instead of repeated checks | Use a Map instead of repeated checks
| Haskell | mit | tfausak/exercism-solutions,tfausak/exercism-solutions,tfausak/exercism-solutions |
3b9dcf4d29ce3a2f9edd0bc01d44b93427a5df17 | lib/UserRoles/UserRole.hs | lib/UserRoles/UserRole.hs | module UserRoles.UserRole
( findByProductId
, createUserRole
, findUserRoles
, toUserRoleID
, toUserRole
, UserRole(..)
) where
import Config (DBConfig, getPool)
import Data.Int (Int64)
import qualified Database.Persist.Postgresql as DB
import Models
-- rewrite this using a WithDBConn monad
createUserRole :: DBConfig... | module UserRoles.UserRole
( findByProductId
, createUserRole
, findUserRoles
, toUserRoleID
, toUserRole
, UserRole(..)
) where
import Config (DBConfig, getPool)
import Data.Int (Int64)
import qualified Database.Persist.Postgresql as DB
import Models
-- rewrite this using a WithDBConn monad
createUserRole :: DBConfig... | Order user roles by title | Order user roles by title
[gust/feature-creature#72]
| Haskell | mit | gust/feature-creature,gust/feature-creature |
a081b9df22c1e41f34a77d057fc6f24556fc5617 | hs-to-coq/src/lib/HsToCoq/Util/Messages.hs | hs-to-coq/src/lib/HsToCoq/Util/Messages.hs | module HsToCoq.Util.Messages (printAll, printAll', printAllIfPresent) where
import Control.Monad
import Control.Monad.IO.Class
printAll :: MonadIO m
=> (a -> String)
-> String
-> String -> String -> String
-> [a]
-> m ()
printAll disp header noneEnd oneEnd manyEnd xs = lif... | module HsToCoq.Util.Messages (printAll, printAll', printAllIfPresent) where
import Control.Monad
import Control.Monad.IO.Class
printAll :: MonadIO m
=> (a -> String)
-> String
-> String -> String -> String
-> [a]
-> m ()
printAll disp header noneEnd oneEnd manyEnd xs = lif... | Print all messages as Coq comments | [core-coq] Print all messages as Coq comments
| Haskell | mit | antalsz/hs-to-coq,antalsz/hs-to-coq |
a16a21049820513dd3f31e8d11db6ea265fea4d9 | TestRegressions.hs | TestRegressions.hs | import Data.Monoid
import Text.Printf
import System.Cmd
import System.Exit
instance Monoid ExitCode where
mempty = ExitSuccess
mappend ExitSuccess b = b
mappend a _ = a
main = mapM test [ ("TestTCD" , "Hinkley")
, ("TideConstituents", "2014")
, ("TideAmp... | import Data.Monoid
import Text.Printf
import System.Cmd
import System.Exit
instance Monoid ExitCode where
mempty = ExitSuccess
mappend ExitSuccess b = b
mappend a _ = a
tests =
[ ("TestTCD.out" , "TestTCD" , "Hinkley")
, ("TideConstituents.out", "TideConstituents", "2014")
... | Refactor regression testing to allow multiple tests of the same program | Refactor regression testing to allow multiple tests of the same program
| Haskell | mit | neilmayhew/Tides,neilmayhew/Tides |
4c551fa4d1fc01d4da41a08b2af2bcbe6b257f54 | tests/NullableTests.hs | tests/NullableTests.hs | module Main ( main ) where
import qualified Data.Map as M
import qualified Data.Set as S
import System.FilePath ( (<.>) )
import System.Environment ( getArgs, withArgs )
import Test.HUnit ( assertEqual )
import Data.LLVM
import Data.LLVM.CallGraph
import Data.LLVM.Analysis.PointsTo
import Data.LLVM.Analysis.PointsTo.... | module Main ( main ) where
import qualified Data.Map as M
import qualified Data.Set as S
import System.FilePath ( (<.>) )
import System.Environment ( getArgs, withArgs )
import Test.HUnit ( assertEqual )
import Data.LLVM
import Data.LLVM.CallGraph
import Data.LLVM.Analysis.PointsTo
import Data.LLVM.Analysis.PointsTo.... | Load the C standard library annotations for the test suite | Load the C standard library annotations for the test suite
| Haskell | bsd-3-clause | travitch/foreign-inference,travitch/foreign-inference |
c5fb516c8caf55903c2a32f21d7085c3be8ccd7b | test/Test.hs | test/Test.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Applicative
import Test.Hspec
import ... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Applicative
import Test.Hspec
import ... | Use non-monadic tests for pure code | Use non-monadic tests for pure code
| Haskell | mit | wereHamster/haskell-appc |
6be2485fb977a5f44f877003cccdfe5b265b991b | src/HasteMain.hs | src/HasteMain.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Haste.DOM (withElems, getValue, setProp)
import Haste.Events (onEvent, MouseEvent(Click))
import Haste.Foreign (ffi)
import Language.Emmental (emmentalWithIO)
getCh :: IO Char
getCh = ffi "(function() {var i=document.getElementById('prog-input'); var s=i.... | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Haste.DOM (withElems, getValue, setProp)
import Haste.Events (onEvent, MouseEvent(Click))
import Haste.Foreign (ffi)
import Language.Emmental (emmentalWithIO)
getCh :: IO Char
getCh = ffi "(function() {var i=document.getElementById('prog-input'); var s=i.... | Clear the output element before running the program. | Clear the output element before running the program.
| Haskell | unlicense | catseye/Emmental,catseye/Emmental |
604b7aabb0717cc9199e2d1f0005c14fafacee95 | SBVTestSuite/TestSuite/GenTest/GenTests.hs | SBVTestSuite/TestSuite/GenTest/GenTests.hs | -----------------------------------------------------------------------------
-- |
-- Module : TestSuite.GenTest.GenTests
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Test-suite for generating tests
------------------------------... | -----------------------------------------------------------------------------
-- |
-- Module : TestSuite.GenTest.GenTests
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Test-suite for generating tests
------------------------------... | Make the test-generation tests more robust | Make the test-generation tests more robust
| Haskell | bsd-3-clause | josefs/sbv |
9e422a22ea170258b5672f11abc0243a740d863c | Main.hs | Main.hs |
module Main where
import Data.Maybe
import System.Environment
import qualified Examples.Tar.Main as Tar
import qualified Examples.Self.Main as Self
import qualified Examples.Test.Basic1 as Basic1
import qualified Examples.Test.Directory as Directory
import qualified Examples.Test.Errors as Errors
import qualified Ex... |
module Main where
import Data.Maybe
import System.Environment
import Examples.Util(flags)
import qualified Examples.Tar.Main as Tar
import qualified Examples.Self.Main as Self
import qualified Examples.Test.Basic1 as Basic1
import qualified Examples.Test.Directory as Directory
import qualified Examples.Test.Errors a... | Add a better message when typing nothing | Add a better message when typing nothing
| Haskell | bsd-3-clause | ndmitchell/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,nh2/shake,ndmitchell/shake,nh2/shake,nh2/shake,ndmitchell/shake |
ff21659273af121822da2f5ab299c8c3e741c3dd | Examples/Test/Assume.hs | Examples/Test/Assume.hs |
module Examples.Test.Assume(main) where
import Development.Shake
import Examples.Util
import Control.Monad
import Development.Shake.FilePath
main = shaken test $ \args obj -> do
want $ map obj args
obj "*.out" *> \out -> do
cs <- mapM (readFile' . obj . (:".src")) $ takeBaseName out
writeFil... |
module Examples.Test.Assume(main) where
import Development.Shake
import Examples.Util
import Control.Monad
import Development.Shake.FilePath
main = shaken test $ \args obj -> do
want $ map obj args
obj "*.out" *> \out -> do
cs <- mapM (readFile' . obj . (:".src")) $ takeBaseName out
writeFil... | Change a forM to forM_ | Change a forM to forM_
| Haskell | bsd-3-clause | nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake |
1042a2c3c34670496dffee4f5f89aeade2e2f284 | libraries/base/Foreign/Marshal/Unsafe.hs | libraries/base/Foreign/Marshal/Unsafe.hs | {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Unsafe
-- Copyright : (c) The FFI task force 2003
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintai... | {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Unsafe
-- Copyright : (c) The FFI task force 2003
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintai... | Implement unsafeLocalState by unsafeDupablePerformIO, not unsafePerformIO. The latter is more efficient, and will work correctly for clients that are using unsafeLocalState for its documented uses. | Implement unsafeLocalState by unsafeDupablePerformIO, not
unsafePerformIO. The latter is more efficient, and will work
correctly for clients that are using unsafeLocalState for its
documented uses.
| Haskell | bsd-3-clause | AlexanderPankiv/ghc,mfine/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,mfine/ghc,spacekitteh/smcghc,bitemyapp/ghc,vikraman/ghc,TomMD/ghc,sdiehl/ghc,ghc-android/ghc,jstolarek/ghc,sdiehl/ghc,wxwxwwxxx/ghc,green-haskell/ghc,mfine/ghc,mettekou/ghc,ghc-android/ghc,tjakway/ghcjvm,mcschroeder/ghc,nkaretnikov/ghc,bitemyapp/ghc,sno... |
d6afa2b090bb9c5a60852f0552860bab4d9f5f22 | src/Gfx/Textures.hs | src/Gfx/Textures.hs | module Gfx.Textures where
import qualified Data.Map.Strict as M
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as BSU
import Graphics.Rendering.OpenGL as GL
import Foreign.Ptr
import Codec.BMP
data TextureLibrary = TextureLibrary
{ textures :: M.Map String Textu... | module Gfx.Textures where
import qualified Data.Map.Strict as M
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as BSU
import Codec.BMP
import Foreign.Ptr
import Graphics.Rendering.OpenGL as GL
type TextureLibrary = M.Map String Text... | Make TextureLibrary just a Map | Make TextureLibrary just a Map
| Haskell | bsd-3-clause | rumblesan/improviz,rumblesan/improviz |
61872fce7763db75deee274f0383eeba1723b706 | tests/shouldwork/Signal/BlockRamTest.hs | tests/shouldwork/Signal/BlockRamTest.hs | {-# LANGUAGE FlexibleInstances #-}
module BlockRamTest where
import CLaSH.Prelude
instance Default (Vec 4 Bit) where def = vcopyI H
topEntity :: Signal (Unsigned 7)
-> Signal (Unsigned 7)
-> Signal (Bool)
-> Signal (Vec 4 Bit)
-> Signal (Vec 4 Bit)
topEntity = blockRam (snat :... | {-# LANGUAGE FlexibleInstances #-}
module BlockRamTest where
import CLaSH.Prelude
topEntity :: Signal (Unsigned 7)
-> Signal (Unsigned 7)
-> Signal (Bool)
-> Signal (Vec 4 Bit)
-> Signal (Vec 4 Bit)
topEntity = blockRam (snat :: SNat 128)
| Update test now that Vec has a Default instance | Update test now that Vec has a Default instance
| Haskell | bsd-2-clause | christiaanb/clash-compiler,ggreif/clash-compiler,christiaanb/clash-compiler,ggreif/clash-compiler |
fa408d1ea7bd0fe37e9de25f3e6d9f64d87e17db | src/Examples/Comparison.hs | src/Examples/Comparison.hs | {-# LANGUAGE TupleSections #-}
module Examples.Comparison where
import Circuit
import Circuit.Builder
import Control.Monad
export :: [(String, [IO (String, Acirc)])]
export = [("comparison", [return ("comparison", comparison 9 22)])]
-- returns less-than-or-equals
-- first input comes in unary form for instance 0 -... | {-# LANGUAGE TupleSections #-}
module Examples.Comparison where
import Circuit
import Circuit.Builder
import Circuit.Utils
import Control.Monad
export :: [(String, [IO (String, Acirc)])]
export = [("comparison", [return ("comparison", comparison 20)])]
-- returns less-than-or-equals
-- first input comes in unary fo... | Simplify comparison, make tester for it | Simplify comparison, make tester for it
| Haskell | mit | spaceships/circuit-synthesis,spaceships/circuit-synthesis,spaceships/circuit-synthesis |
b4e6aa8b5dc237244a0096733571654b2c9bf5b4 | Transaction.hs | Transaction.hs | module Transaction (withFileTransaction) where
import System.Directory (createDirectory, removeDirectory)
import Control.Concurrent (threadDelay)
import System.IO.Error (isAlreadyExistsError)
tryLock file = catch (createDirectory file) (\e -> if isAlreadyExistsError e then putStrLn "Waiting" >> threadDelay 1000 >> try... | module Transaction (withFileTransaction) where
import System.Directory (createDirectory, removeDirectory)
import Control.Concurrent (threadDelay)
import System.IO.Error (isAlreadyExistsError)
import Control.Exception (finally)
tryLock file = catch (createDirectory file) (\e -> if isAlreadyExistsError e then putStrLn "... | Remove lockfile even when errors happen | Remove lockfile even when errors happen
| Haskell | bsd-3-clause | MasseR/Shopping-list |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.