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 |
|---|---|---|---|---|---|---|---|---|---|
ab32c258a9c0be8a1403d9fc33ddf3bf7be4418f | src/Text/Karver/Types.hs | src/Text/Karver/Types.hs | module Text.Karver.Types where
import Data.Text (Text)
import Data.HashMap.Strict
import Data.Vector
type ObjectName = Text
type Key = Text
data Tokens = LiteralTok Text
| IdentityTok Text
| ObjectTok ObjectName Key
| ListTok Text Int
| ConditionTok T... | module Text.Karver.Types where
import Data.Text (Text)
import Data.HashMap.Strict
import Data.Vector
type ObjectName = Text
type Key = Text
type ListName = Text
type Index = Int
data Tokens = LiteralTok Text
| IdentityTok Text
| ObjectTok ObjectName Key
| List... | Make ListTok more clear via type alias | Make ListTok more clear via type alias
| Haskell | bsd-3-clause | sourrust/karver,ibotty/stencil |
70a7ba1ff6f9e48519ed99fcd0d1b33d74eaa0b5 | src/Language/Haskell/Ghcid/Types.hs | src/Language/Haskell/Ghcid/Types.hs | {-# LANGUAGE DeriveDataTypeable #-}
-- | The types we use
-- Copyright Neil Mitchell 2014.
module Language.Haskell.Ghcid.Types where
import Data.Typeable
import Control.Exception.Base (Exception)
-- | A GHCi session. Created with 'startGhci'.
newtype Ghci = Ghci (String -> IO [String])
-- | GHCi shut down
data GhciE... | {-# LANGUAGE DeriveDataTypeable #-}
-- | The types we use
-- Copyright Neil Mitchell 2014.
module Language.Haskell.Ghcid.Types where
import Data.Typeable
import Control.Exception.Base (Exception)
-- | A GHCi session. Created with 'startGhci'.
newtype Ghci = Ghci (String -> IO [String])
-- | GHCi shut down
data GhciE... | Fix some weird unicode stuff | Fix some weird unicode stuff
| Haskell | bsd-3-clause | ndmitchell/ghcid |
e8389ac78a5e3809f641b8b8cc42e03bea2d0795 | compiler/Build/Print.hs | compiler/Build/Print.hs | module Build.Print where
import qualified Data.Map as Map
import qualified Data.List as List
import qualified SourceSyntax.Module as M
import qualified SourceSyntax.PrettyPrint as Pretty
import qualified Type.Alias as Alias
import qualified Text.PrettyPrint as P
metaTypes :: Map.Map String M.ModuleInterface -> M.Meta... | module Build.Print where
import qualified Data.Map as Map
import qualified Data.List as List
import qualified SourceSyntax.Module as M
import qualified SourceSyntax.PrettyPrint as Pretty
import qualified Type.Alias as Alias
import qualified Text.PrettyPrint as P
metaTypes :: Map.Map String M.ModuleInterface -> M.Meta... | Update to match new Module type | Update to match new Module type
| Haskell | bsd-3-clause | laszlopandy/elm-compiler,JoeyEremondi/elm-pattern-effects,deadfoxygrandpa/Elm,mgold/Elm,pairyo/elm-compiler,Axure/elm-compiler,5outh/Elm |
a6386a0fdf9b73abaf4ce91085a4e196fb36849d | haskell/p-80.hs | haskell/p-80.hs | {-# LANGUAGE UnicodeSyntax #-}
import Prelude.Unicode
type Nodes = [Char]
type Edges = [(Char, Char)]
data Graph = Graph Nodes Edges deriving (Show, Eq)
type Adj = [(Char, Nodes)]
graph2Adj ∷ Graph → Adj
graph2Adj (Graph nodes edges) = map (\ x → buildAdj x edges) nodes
where
sn ∷ Char → (Char, Char) ... |
type Nodes a = [a]
type Edges a = [(a, a)]
data Graph a = Graph (Nodes a) (Edges a) deriving (Show, Eq)
type Adj a = [(a, Nodes a)]
g = Graph ['b','c','d','f','g','h','k']
[('b','c'),('b','f'),('c','f'),('f','k'),('g','h')] :: Graph Char
graph2Adj :: (Eq a) => Graph a -> Adj a
graph2Adj (Graph nodes edges) = ... | Modify problem 80 to polymorphic type | Modify problem 80 to polymorphic type
| Haskell | bsd-3-clause | m00nlight/99-problems |
2feaeffc3a956175094956c4774ea77e6c739d0e | HOPS/Config.hs | HOPS/Config.hs | -- |
-- Copyright : Anders Claesson 2015
-- Maintainer : Anders Claesson <anders.claesson@gmail.com>
-- License : BSD-3
--
-- Constants determined at runtime such as the home directory.
module HOPS.Config
( Config (..)
, getConfig
) where
import System.FilePath ((</>))
import System.Directory
-- |... | -- |
-- Copyright : Anders Claesson 2015
-- Maintainer : Anders Claesson <anders.claesson@gmail.com>
-- License : BSD-3
--
-- Constants determined at runtime such as the home directory.
module HOPS.Config
( Config (..)
, getConfig
) where
import System.FilePath ((</>))
import System.Directory
-- |... | Use .oeis-data instead of .hops to store stripped | Use .oeis-data instead of .hops to store stripped
The reason for this is for 'hops' and 'sloane' to use a common
directory and thereby not download striped.gz more times than
necessary.
| Haskell | bsd-3-clause | akc/gfscript |
4d4bbe3e4ff243f338e8ebbedaa89fef2f05bb9d | libraries/base/GHC/Exts.hs | libraries/base/GHC/Exts.hs | -----------------------------------------------------------------------------
-- |
-- Module : GHC.Exts
-- Copyright : (c) The University of Glasgow 2002
-- License : see libraries/base/LICENSE
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC Extensi... | -----------------------------------------------------------------------------
-- |
-- Module : GHC.Exts
-- Copyright : (c) The University of Glasgow 2002
-- License : see libraries/base/LICENSE
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC Extensi... | Remove Splittable class (a vestige of linear implicit parameters) | Remove Splittable class (a vestige of linear implicit parameters) | Haskell | bsd-3-clause | nushio3/ghc,frantisekfarka/ghc-dsi,acowley/ghc,snoyberg/ghc,da-x/ghc,sdiehl/ghc,nathyong/microghc-ghc,ryantm/ghc,lukexi/ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,TomMD/ghc,nkaretnikov/ghc,ghc-android/ghc,acowley/ghc,da-x/ghc,nkaretnikov/ghc,nushio3/ghc,green-haskell/ghc,urbanslug... |
2ba6cc3fb5eb94e0e02c5815d6abeb7531513d5d | src/Control/Lens/Unsafe.hs | src/Control/Lens/Unsafe.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE KindSignatures #-}
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704
{-# LANGUAGE Unsafe #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Control.Lens.Unsafe
-- Copyright : (C) 2012 Edward Kmett
-- License ... | {-# LANGUAGE CPP #-}
{-# LANGUAGE KindSignatures #-}
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704
{-# LANGUAGE Unsafe #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Control.Lens.Unsafe
-- Copyright : (C) 2012 Edward Kmett
-- License ... | Fix haddock link EvilBazaar -> BazaarT | Fix haddock link EvilBazaar -> BazaarT
| Haskell | bsd-3-clause | rpglover64/lens,Icelandjack/lens,timjb/lens,omefire/lens,hvr/lens,danidiaz/lens,ddssff/lens,cchalmers/lens,Fuuzetsu/lens,cdepillabout/lens,Gabriel439/lens,hvr/lens |
a24c9623dff8b8b529937931c024114bf0f5bcc4 | lib/src/View.hs | lib/src/View.hs | {-|
Module : View
Description : Local definition of view
Copyright : (c) Eric Mertens, 2016
License : ISC
Maintainer : emertens@gmail.com
-}
module View (view) where
import Data.Functor.Const
view l x = getConst (l Const x)
| {-|
Module : View
Description : Local definition of view
Copyright : (c) Eric Mertens, 2016
License : ISC
Maintainer : emertens@gmail.com
-}
module View (view) where
import Data.Functor.Const
-- | Local definition of lens package's view.
view :: ((a -> Const a a) -> s -> Const a s) -> s -> a
view l x = g... | Add type signature for view | Add type signature for view
| Haskell | isc | glguy/irc-core,dolio/irc-core,dolio/irc-core,glguy/irc-core,dolio/irc-core,glguy/irc-core |
c6449cf1f3f089ac6fbd8579f0c8514f14ef7db0 | src/PaneInteractionServer.hs | src/PaneInteractionServer.hs | module PaneInteractionServer
( interactions
) where
import Control.Monad (unless)
import Network
import Data.List (span)
import System.IO
import Parser
import Base
import Nettle.OpenFlow
import System.Time
interactions :: Word16
-> Chan (Speaker, String)
-> Chan (Speaker, String)
... | module PaneInteractionServer
( interactions
) where
import Control.Monad (unless)
import Network
import Data.List (span)
import System.IO
import Parser
import Base
import Nettle.OpenFlow
import System.Time
interactions :: Word16
-> Chan (Speaker, String)
-> Chan (Speaker, String)
... | Improve handling of user login | Improve handling of user login
| Haskell | bsd-3-clause | brownsys/pane,brownsys/pane,brownsys/pane |
6d2a7cb0593ea00a711359e34f1bf2c974f53ccb | src/PostgRESTWS/HasqlBroadcast.hs | src/PostgRESTWS/HasqlBroadcast.hs | module PostgRESTWS.HasqlBroadcast
( newHasqlBroadcaster
-- re-export
, acquire
, relayMessages
, relayMessagesForever
) where
import Protolude
import Hasql.Connection
import PostgRESTWS.Database
import PostgRESTWS.Broadcast
newHasqlBroadcaster :: Connection -> IO Multiplexer
newHasqlBroadcaster con = ne... | {-|
Module : PostgRESTWS.HasqlBroadcast
Description : Uses Broadcast module adding database as a source producer.
This module provides a function to produce a 'Multiplexer' from a Hasql 'Connection'.
The producer issues a LISTEN command upon Open commands and UNLISTEN upon Close.
-}
module PostgRESTWS.HasqlBroad... | Add haddock comments to give example of database multiplexer. | Add haddock comments to give example of database multiplexer.
| Haskell | mit | diogob/postgrest-ws,diogob/postgrest-ws,diogob/postgrest-ws |
8f97a6dfdc3bbdedfdaa482aa44461c0edc5177e | src/AppTypes.hs | src/AppTypes.hs | module AppTypes where
import Data.Time.Clock.POSIX (getPOSIXTime)
import Language.LanguageAst ( Block(..) )
data AppState = AppState {
time :: Double,
validAst :: Block,
timeAtStart :: Double
}
makeAppState :: IO AppState
makeAppState = do
timeNow <- realToFrac <$> getPOSIXTime
return AppState {
time ... | module AppTypes where
import Language.LanguageAst ( Block(..) )
data AppState = AppState { validAst :: Block }
makeAppState :: AppState
makeAppState = AppState { validAst = Block [] }
| Remove time from app state | Remove time from app state
set in display function now
| Haskell | bsd-3-clause | rumblesan/improviz,rumblesan/improviz |
841b642acd68503a988189391264bf0d49f5be24 | examples/qsort/QSortVect.hs | examples/qsort/QSortVect.hs | {-# LANGUAGE PArr #-}
{-# OPTIONS -fvectorise #-}
{-# OPTIONS -fno-spec-constr-count #-}
module QSortVect (qsortVect) where
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Double
import qualified Data.Array.Parallel.Prelude.Int as I
import qualified Prelude
qsortVect:: PArray Double -> PArray D... | {-# LANGUAGE PArr #-}
{-# OPTIONS -fvectorise #-}
{-# OPTIONS -fno-spec-constr-count #-}
module QSortVect (qsortVect) where
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Double
import qualified Data.Array.Parallel.Prelude.Int as I
import qualified Prelude
qsortVect:: PArray Double -> PArray D... | Make qsort actually work in parallel | Make qsort actually work in parallel | Haskell | bsd-3-clause | mainland/dph,mainland/dph,mainland/dph |
194ee01bfae72e3cf3067f90b95e7325465859f5 | src/Main.hs | src/Main.hs | main = do
logs <- readFile "serverlogs.log"
putStrLn $ head $ lines logs
| import Control.Applicative ((<$>))
import Log.LogAnalysis
main = do
logs <- parse <$> readFile "serverlogs.log"
putStrLn $ head $ show <$> logs
| Use "parse" to extract log structure | 5: Use "parse" to extract log structure
| Haskell | mit | blast-hardcheese/talk-haskell-logparse |
5ef80f56555f03e19e6b53b5a2d33bb0bc93dcb9 | src/Main.hs | src/Main.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Main (main) where
import qualified Bot
import Control.Exception
import System.Console.CmdArgs
data Dikunt = Dikunt
{ server :: String
, nickname :: String
, password :: String
, channel :: String
, port :: Integer
} deriving (Data, Typeable, Sh... | {-# LANGUAGE DeriveDataTypeable #-}
module Main (main) where
import qualified Bot
import Control.Exception
import System.Console.CmdArgs
data Dikunt = Dikunt
{ server :: String
, nickname :: String
, password :: String
, channel :: String
, port :: Integer
} deriving (Data, Typeable, Sh... | Use -h and -v instead of -? and -V | Use -h and -v instead of -? and -V
| Haskell | bsd-3-clause | bus000/Dikunt |
00f14feafdf36742a91e9b3f9d2b921cf08d2f34 | src/Test/API.hs | src/Test/API.hs | -- | Test the high level library API
module Test.API(apiTests) where
import Test.Tasty
import Test.Tasty.HUnit
import System.FilePath
import System.IO.Extra
import System.Time.Extra
import Language.Haskell.Ghcid
import Language.Haskell.Ghcid.Util
apiTests :: TestTree
apiTests = testGroup "API test"
[testCase "No... | -- | Test the high level library API
module Test.API(apiTests) where
import Test.Tasty
import Test.Tasty.HUnit
import System.FilePath
import System.IO.Extra
import System.Time.Extra
import Language.Haskell.Ghcid
import Language.Haskell.Ghcid.Util
apiTests :: TestTree
apiTests = testGroup "API test"
[testCase "No... | Add -ignore-dot-ghci to tests, otherwise some fail with erroring .ghci | Add -ignore-dot-ghci to tests, otherwise some fail with erroring .ghci
| Haskell | bsd-3-clause | ndmitchell/ghcid |
3028a4ac81dcfc0f219239646785706ac5c33671 | examples/GoFast.hs | examples/GoFast.hs | -- | Press the spacebar repeatedly, really really fast.
--
-- 1. Go to <http://mixermike622.deviantart.com/art/GO-FAST-287788805>
-- 2. Run this program
-- 3. ???
-- 4. Profit
import Control.Monad (forever)
import Test.Robot
main = runRobot . forever $ do
sleep 0.1
tap _Space
| -- | Press the spacebar repeatedly, really really fast.
--
-- 1. Go to <http://mixermike622.deviantart.com/art/GO-FAST-287788805>
-- 2. Run this program
-- 3. ???
-- 4. Profit
import Control.Monad (forever)
import Test.Robot
main = runRobot . forever $ do
sleep 0.1 -- Don't reduce this number, or you'll actually... | Add note about breaking GO FAST! | Add note about breaking GO FAST!
| Haskell | apache-2.0 | lfairy/robot |
d8b56597fe8b5e34abd1499eb9f5252447bba563 | testsuite/tests/polykinds/T5798.hs | testsuite/tests/polykinds/T5798.hs | {-# LANGUAGE PolyKinds #-}
module T5798 where
data Proxy t = ProxyC
test :: Proxy '[Int, Bool]
test = ProxyC
| {-# LANGUAGE PolyKinds, DataKinds #-}
module T5798 where
data Proxy t = ProxyC
test :: Proxy '[Int, Bool]
test = ProxyC
| Add DataKinds flag to test | Add DataKinds flag to test
| Haskell | bsd-3-clause | forked-upstream-packages-for-ghcjs/ghc,TomMD/ghc,hferreiro/replay,christiaanb/ghc,sdiehl/ghc,tjakway/ghcjvm,sdiehl/ghc,nushio3/ghc,spacekitteh/smcghc,mcschroeder/ghc,mcschroeder/ghc,acowley/ghc,gcampax/ghc,forked-upstream-packages-for-ghcjs/ghc,elieux/ghc,vikraman/ghc,snoyberg/ghc,fmthoma/ghc,jstolarek/ghc,lukexi/ghc,c... |
29b0207df2ab76cbaa1606c2aa32b6631cb2a9dd | src/MusicBrainz/Types.hs | src/MusicBrainz/Types.hs | -- Types.hs
-- by alemedeiros <alexandre.n.medeiros _at_ gmail.com>
--
-- Musicbrainz interface module for musicdb
--
-- Datatypes definition submodule
-- |Contains all the internal Datatypes definitions and its classes instances
module MusicBrainz.Types where
-- |Artist datatype
-- TODO Datatype description
-- TODO... | -- Types.hs
-- by alemedeiros <alexandre.n.medeiros _at_ gmail.com>
--
-- Musicbrainz interface module for musicdb
--
-- Datatypes definition submodule
-- |Contains all the internal Datatypes definitions and its classes instances
module MusicBrainz.Types where
-- |Artist datatype
-- TODO Datatype description
-- TODO... | Implement pretty print for ReleaseGroup | Implement pretty print for ReleaseGroup
| Haskell | bsd-3-clause | alemedeiros/musicdb |
02024781a181855529f61b0132f8144fe8c98e72 | Data/Html/Download.hs | Data/Html/Download.hs | -- Original version by Alistair Bayley
-- Taken from Haskell-Cafe mailing list
-- "Simple HTTP lib for Windows?", 18 Jan 2007
-- Does not seem very reliable, does not work for various websites (including Google)
module Data.Html.Download(openURL) where
import System.IO
import Network
import Data.List
-- | http:// p... | -- Original version by Alistair Bayley
-- Much help from Daniel McAllansmith
-- Taken from Haskell-Cafe mailing list
-- "Simple HTTP lib for Windows?", 18 Jan 2007
-- Does not seem very reliable, does not work for various websites (including Google)
module Data.Html.Download(openURL) where
import System.IO
import Ne... | Change the downloading code so its more reliable, using a Connection message | Change the downloading code so its more reliable, using a Connection message | Haskell | bsd-3-clause | silkapp/tagsoup |
61dedb4f1ff8cb22af65012b4eae5b688892066c | src/jsplink.hs | src/jsplink.hs | -- | jsplink - link together a set of modules to form a JS blob.
module Main where
import System.Environment (getArgs)
import CodeGen.Javascript
main = do
as <- getArgs
if null as
then putStrLn "Usage: jsplink Mod1.jsmod [Mod2.jsmod, ...]"
else mapM_ catMod as
where
catMod m =
readModule m >>... | -- | jsplink - link together a set of modules to form a JS blob.
module Main where
import System.Environment (getArgs)
import CodeGen.Javascript
import CodeGen.Javascript.AST
import Bag
import qualified Data.Map as M
import qualified Data.Set as S
main = do
as <- getArgs
if null as
then putStrLn "Usage: jspli... | Resolve and sort dependencies locally during link time. | Resolve and sort dependencies locally during link time.
jsplink now emits functions depth first, starting with Main.main. This has
the consequence of eliminating any unused functions, as well as sorting the
functions in dependency order.
jsplink only deals with a single .jsmod file for now though.
| Haskell | bsd-3-clause | kranich/haste-compiler,santolucito/haste-compiler,akru/haste-compiler,beni55/haste-compiler,nyson/haste-compiler,jtojnar/haste-compiler,santolucito/haste-compiler,beni55/haste-compiler,jtojnar/haste-compiler,szatkus/haste-compiler,crodjer/haste-compiler,szatkus/haste-compiler,joelburget/haste-compiler,akru/haste-compil... |
59120c2822ce497e0c298924e598d832bc090177 | Handler/Search.hs | Handler/Search.hs | {-# LANGUAGE TemplateHaskell
, NamedFieldPuns
#-}
module Handler.Search
( getSearchR
) where
import Import
import Data.List as L
import Data.Text as T
import Database.Esqueleto as S
import Widget
getSearchString :: Handler (Maybe Text)
getSearchString = do
YesodRequest {reqGetParams} <-... | {-# LANGUAGE TemplateHaskell
, NamedFieldPuns
#-}
module Handler.Search
( getSearchR
) where
import Import
import Data.List as L
import Data.Text as T
import Database.Esqueleto as S
import Widget
getSearchString :: Handler (Maybe Text)
getSearchString = do
mq <- lookupGetParam searchQue... | Use lookupGetParam instead of list lookup | Use lookupGetParam instead of list lookup
| Haskell | bsd-3-clause | pxqr/bitidx |
4e5e7d8e3c534a8982181b3f9cb665bcda4abb37 | src/Language/Scala/Tuple.hs | src/Language/Scala/Tuple.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StaticPointers #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Language.Scala.T... | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StaticPointers #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn... | Update sparkle to build with distributed-closure-0.4.0. | Update sparkle to build with distributed-closure-0.4.0.
| Haskell | bsd-3-clause | tweag/sparkle,tweag/sparkle |
ff9f1b6b19f029230578ea6fa426f0de7f65fca8 | Data/SBV/BitVectors/GenTest.hs | Data/SBV/BitVectors/GenTest.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.BitVectors.GenTest
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
-- Portability : portable
--
-- Test generation from symbolic prog... | -----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.BitVectors.GenTest
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
-- Portability : portable
--
-- Test generation from symbolic prog... | Make genTest use () return value, it's more usable that way. | Make genTest use () return value, it's more usable that way. | Haskell | bsd-3-clause | josefs/sbv |
07d2dd8df08e01c54d8d8ddc838b10d69b2b6232 | tests/Instances/Options.hs | tests/Instances/Options.hs | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module: Instances.Options
Copyright: (C) 2014-2017 Ryan Scott
License: BSD-style (see the file LICENSE)
Maintainer: Ryan Scott
Stability: Provisional
Portability: GHC
'Arbitr... | {-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module: Instances.Options
Copyright: (C) 2014-2017 Ryan Scott
License: BSD-style (see the file LICENSE)
Maintainer: Ryan Scott
Stability: Provisional
Portability: GHC
'Arbitrary' instance for 'Options' and related datatypes.
-}
module Instances.Options () where
... | Fix the test suite build | Fix the test suite build
| Haskell | bsd-3-clause | RyanGlScott/text-show |
377743b0083df7f062c26e6513dd9563ea0c119c | src/EmbedData.hs | src/EmbedData.hs | {-# LANGUAGE TemplateHaskell #-}
module EmbedData
( hlintYaml,
defaultYaml,
reportTemplate,
)
where
import Data.ByteString.UTF8
import Data.FileEmbed
hlintYaml :: (FilePath, Maybe String)
hlintYaml = ("data/hlint.yaml", Just $ toString $(embedFile "data/hlint.yaml"))
defaultYaml :: String
defaultYaml = ... | {-# LANGUAGE TemplateHaskell #-}
module EmbedData
( hlintYaml,
defaultYaml,
reportTemplate,
)
where
import Data.ByteString.UTF8
import Data.FileEmbed
-- Use NOINLINE below to avoid dirtying too much when these files change
{-# NOINLINE hlintYaml #-}
hlintYaml :: (FilePath, Maybe String)
hlintYaml = ("da... | Add NOINLINE to change fewer things when the data files change | Add NOINLINE to change fewer things when the data files change
| Haskell | bsd-3-clause | ndmitchell/hlint,ndmitchell/hlint |
1db5dde1bcb8fef6f32c9e3e61e42f7194517896 | Development/Shake/Derived.hs | Development/Shake/Derived.hs |
module Development.Shake.Derived where
import Control.Monad
import Control.Monad.IO.Class
import System.Cmd
import System.Exit
import Development.Shake.Core
import Development.Shake.File
import Development.Shake.FilePath
system_ :: [String] -> Action ()
system_ (x:xs) = do
let cmd = unwords $ toNative x : xs
... |
module Development.Shake.Derived where
import Control.Monad
import Control.Monad.IO.Class
import System.Cmd
import System.Exit
import Development.Shake.Core
import Development.Shake.File
import Development.Shake.FilePath
system_ :: [String] -> Action ()
system_ (x:xs) = do
let cmd = unwords $ toNative x : xs
... | Add writeFile_ to the list of derived functions | Add writeFile_ to the list of derived functions
| Haskell | bsd-3-clause | nh2/shake,ndmitchell/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake |
a588b2a01a9ec1e380e32644aa670d6fa614c087 | test/RunSpec.hs | test/RunSpec.hs | module RunSpec (main, spec) where
import Test.Hspec.ShouldBe
import System.Exit
import Run
main :: IO ()
main = hspecX spec
spec :: Specs
spec = do
describe "doctest" $ do
it "reverses a list" $ do
doctest ["test/integration/failing/Foo.hs"] `shouldThrow` (== ExitFailure 1)... | module RunSpec (main, spec) where
import Test.Hspec.ShouldBe
import System.Exit
import Run
main :: IO ()
main = hspecX spec
spec :: Specs
spec = do
describe "doctest" $ do
it "exits with ExitFailure, if at least one test case fails" $ do
doctest ["test/integration/failing/F... | Fix description for a test | Fix description for a test
| Haskell | mit | ekmett/doctest,ekmett/doctest,snoyberg/doctest-haskell,snoyberg/doctest-haskell,sol/doctest,sol/doctest |
b51e6d97b5f930963687dca5eb64983324baa8b1 | src/Settings/Packages.hs | src/Settings/Packages.hs | module Settings.Packages (
module Settings.Default,
packages, getPackages, knownPackages
) where
import Package
import Switches
import Expression
import Oracles.Setting
import Settings.User
import Settings.Default
-- Combining default list of packages with user modifications
packages :: Packages
packages ... | module Settings.Packages (
module Settings.Default,
packages, getPackages, knownPackages, findKnownPackage
) where
import Package
import Switches
import Expression
import Oracles.Setting
import Settings.User
import Settings.Default
import Data.List
-- Combining default list of packages with user modificat... | Add findKnownPackage for finding packages by name. | Add findKnownPackage for finding packages by name.
| Haskell | bsd-3-clause | izgzhen/hadrian,quchen/shaking-up-ghc,snowleopard/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,snowleopard/hadrian,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,bgamari/shaking-up-ghc |
ad12d1d695e33d5c9d2e1a62836d4faed00c6b02 | src/Text/Karver/Types.hs | src/Text/Karver/Types.hs | module Text.Karver.Types where
import Data.Text (Text)
type Key = Text
data Tokens = Literal Text
| Identity Text
| Object Text Key
deriving (Show, Eq)
| module Text.Karver.Types where
import Data.Text (Text)
import Data.HashMap.Strict
type Key = Text
data Tokens = Literal Text
| Identity Text
| Object Text Key
deriving (Show, Eq)
data Value = String Text
| Map (HashMap Text Text)
deriving (Show)
| Add Value type to accommodate object identities | Add Value type to accommodate object identities
| Haskell | bsd-3-clause | ibotty/stencil,sourrust/karver |
bd15b8f1456302f919ed3d091c93f738e0509b9e | library/HTMLEntities/Parser.hs | library/HTMLEntities/Parser.hs | -- |
-- Attoparsec parsers.
module HTMLEntities.Parser where
import HTMLEntities.Prelude
import Data.Attoparsec.Text
import qualified Data.Text as Text
import qualified HTMLEntities.NameTable as NameTable
-- |
-- A parser of a single entity.
--
-- Parses numeric encoding:
--
-- >>> mapM_ Data.Text.IO.putStrLn $ Da... | -- |
-- Attoparsec parsers.
module HTMLEntities.Parser where
import HTMLEntities.Prelude
import Data.Attoparsec.Text
import qualified Data.Text as Text
import qualified HTMLEntities.NameTable as NameTable
-- |
-- A parser of a single entity.
--
-- Parses numeric encoding:
--
-- >>> mapM_ Data.Text.IO.putStrLn $ Da... | Remove liftMaybe function for GHC8 compatibility | Remove liftMaybe function for GHC8 compatibility
Looks like some change on GHC8 changed ImpredicativeTypes
behavior and it doesn't accept liftMaybe function without cluttering
it with type annotations.
| Haskell | mit | nikita-volkov/html-entities |
92ec351173d49c0dff5c6efc035ef20d8d757b19 | src/Graphics/Text/Width.hs | src/Graphics/Text/Width.hs | -- Copyright 2009 Corey O'Connor
{-# OPTIONS_GHC -D_XOPEN_SOURCE #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module Graphics.Text.Width ( wcwidth
, wcswidth
, safeWcwidth
, safeWcswidth
)
where
foreign imp... | -- Copyright 2009 Corey O'Connor
{-# OPTIONS_GHC -D_XOPEN_SOURCE #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module Graphics.Text.Width ( wcwidth
, wcswidth
, safeWcwidth
, safeWcswidth
)
where
import Fore... | Fix wcwidth import and match safeWcswidth to its documented behavior | Fix wcwidth import and match safeWcswidth to its documented behavior
Previously vty_mk_wcwidth was being imported with the wrong type causing
the -1 return value to be mapped to the wrong Int value.
Additionally safeWcswidth was using the unsafe character width function
and only ensuring that the final result was non... | Haskell | bsd-3-clause | jtdaugherty/vty,jtdaugherty/vty,jtdaugherty/vty |
a603eb0c74b2d1ad415aac192c0b5535edd64ff2 | src/System/Console/Byline.hs | src/System/Console/Byline.hs | {-
This file is part of the package byline. It is subject to the license
terms in the LICENSE file found in the top-level directory of this
distribution and at git://pmade.com/byline/LICENSE. No part of the
byline package, including this file, may be copied, modified,
propagated, or distributed except according to the... | {-
This file is part of the package byline. It is subject to the license
terms in the LICENSE file found in the top-level directory of this
distribution and at git://pmade.com/byline/LICENSE. No part of the
byline package, including this file, may be copied, modified,
propagated, or distributed except according to the... | Add a few more exports | Add a few more exports
| Haskell | bsd-2-clause | pjones/byline |
b87218ea0c2d3999eed79548945e3db2a08029e3 | MCCtl/Config/Parser.hs | MCCtl/Config/Parser.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Parse instances from a YAML file.
module MCCtl.Config.Parser where
import Control.Applicative
import qualified Data.ByteString as BS
import Data.Yaml
import MCCtl.Config
-- | Parse an instance YAML file.
parseInstance :: BS.ByteString -> Maybe Instance
parseInstance bs = do
ca... | {-# LANGUAGE OverloadedStrings #-}
-- | Parse instances from a YAML file.
module MCCtl.Config.Parser where
import Control.Applicative
import qualified Data.ByteString as BS
import Data.Yaml
import MCCtl.Config
-- | Parse an instance YAML file.
parseInstance :: BS.ByteString -> Maybe Instance
parseInstance bs = do
ca... | Use dashes-as-spaces instead of camelCase in instance configs. | Use dashes-as-spaces instead of camelCase in instance configs.
| Haskell | bsd-3-clause | valderman/mcctl |
ccfd5356f1f69230c9d68c5e264c912bcff32ad0 | src/Data/Cruncher/Request.hs | src/Data/Cruncher/Request.hs | {-# LANGUAGE OverloadedStrings, Trustworthy #-}
-- |
-- Maintainer : Ricky Elrod <ricky@elrod.me>
-- Stability : probably somewhat stable
--
-- Handles incoming requests (usually from our Yesod frontend, but could be
-- from anywhere).
module Data.Cruncher.Request (Request (..)) where
import Control.Applicative
im... | {-# LANGUAGE OverloadedStrings, Trustworthy #-}
-- |
-- Maintainer : Ricky Elrod <ricky@elrod.me>
-- Stability : probably somewhat stable
--
-- Handles incoming requests (usually from our Yesod frontend, but could be
-- from anywhere).
module Data.Cruncher.Request (Request (..)) where
import Control.Applicative
im... | Make compilationOnly optional, default to False | Make compilationOnly optional, default to False
| Haskell | bsd-3-clause | eval-so/cruncher |
87adce0d38a35398ee200484d02d2975a6b4126e | src/Allegro/C.hsc | src/Allegro/C.hsc | {-# LANGUAGE ForeignFunctionInterface #-}
module Allegro.C (al_init) where
import Foreign
import Foreign.C.Types
#include <allegro5/allegro.h>
al_init :: IO Bool
al_init = al_install_system #{const ALLEGRO_VERSION_INT} fp_atexit
foreign import ccall "al_install_system"
al_install_system :: CInt -> FunPtr (Ptr ()... | {-# LANGUAGE ForeignFunctionInterface #-}
module Allegro.C (al_init) where
import Foreign
import Foreign.C.Types
#include <allegro5/allegro.h>
al_init :: IO Bool
al_init = al_install_system #{const ALLEGRO_VERSION_INT} fp_atexit
foreign import ccall unsafe "al_install_system"
al_install_system :: CInt -> FunPtr ... | Declare imports as unsafe (they are not calling back) | Declare imports as unsafe (they are not calling back)
| Haskell | bsd-3-clause | yav/allegro |
8b1aa83dc7c1c8a5454e1d716ea48e5a51f87df9 | src/Text/Karver.hs | src/Text/Karver.hs | module Text.Karver where
import Text.Karver.Types
import Text.Karver.Parse
import Control.Applicative
import Data.Attoparsec.Text
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as H
import Data.Text (Text)
import qualified Data.Text as T
renderTemplate :: HashMap Text Value -> Text -> Text... | module Text.Karver where
import Text.Karver.Types
import Text.Karver.Parse
import Control.Applicative
import Data.Attoparsec.Text
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as H
import Data.Text (Text)
import qualified Data.Text as T
renderTemplate :: HashMap Text Value -> Text -> Text... | Fix alignment for fall back case | Fix alignment for fall back case
| Haskell | bsd-3-clause | sourrust/karver,ibotty/stencil |
29a81bcc9fc929e838b486fb488dbd1440affdfc | src/Hans/Threads.hs | src/Hans/Threads.hs | module Hans.Threads where
import Control.Concurrent (forkIO,ThreadId)
import Control.Exception (catch,SomeException,fromException,AsyncException(..))
forkNamed :: String -> IO () -> IO ThreadId
forkNamed str body = forkIO (body `catch` showExn)
where
showExn :: SomeException -> IO ()
showExn e =
case fromE... | module Hans.Threads where
import Control.Concurrent (forkFinally,ThreadId)
import Control.Exception (fromException,AsyncException(..))
forkNamed :: String -> IO () -> IO ThreadId
forkNamed str body = forkFinally body showExn
where
showExn Right{} =
return ()
showExn (Left e) =
case fromException e of... | Change `forkNamed` to use `forkFinally` instead | Change `forkNamed` to use `forkFinally` instead
| Haskell | bsd-3-clause | GaloisInc/HaNS,GaloisInc/HaNS,cartazio/HaNS,cartazio/HaNS |
1724c42abbbcb2056e67bd681fc626a5dabfb615 | src/Reflex/FunctorMaybe.hs | src/Reflex/FunctorMaybe.hs | -- | This module defines the FunctorMaybe class, which extends Functors with the
-- ability to delete values.
module Reflex.FunctorMaybe
( FunctorMaybe (..)
) where
import Data.Maybe
--TODO: See if there's a better class in the standard libraries already
-- | A class for values that combines filtering and mappin... | -- | This module defines the FunctorMaybe class, which extends Functors with the
-- ability to delete values.
module Reflex.FunctorMaybe
( FunctorMaybe (..)
) where
import Data.Maybe
--TODO: See if there's a better class in the standard libraries already
-- | A class for values that combines filtering and mappin... | Use (=<<) instead of flip (>>=) | Use (=<<) instead of flip (>>=)
| Haskell | bsd-3-clause | Saulzar/reflex,reflex-frp/reflex,reflex-frp/reflex,Saulzar/reflex |
f6bbb294926c8ad7a713aa544775e8941729d653 | benchmarks/Main.hs | benchmarks/Main.hs | import Text.HTML.Scalpel
import Criterion.Main (bgroup, bench, defaultMain, nf)
import qualified Data.Text as T
import qualified Data.Text.IO as T
main :: IO ()
main = do
nested100 <- T.readFile "benchmarks/data/nested-100.html"
nested1000 <- T.readFile "benchmarks/data/nested-1000.html"
nested2000 <- T... | import Text.HTML.Scalpel
import Control.Monad (replicateM_)
import Criterion.Main (bgroup, bench, defaultMain, nf)
import qualified Data.Text as T
import qualified Data.Text.IO as T
main :: IO ()
main = do
nested100 <- T.readFile "benchmarks/data/nested-100.html"
nested1000 <- T.readFile "benchmarks/data/ne... | Add benchmarks for number of selects | Add benchmarks for number of selects
| Haskell | apache-2.0 | fimad/scalpel |
4f311600677819a3c741d0d29784c5c64505cc78 | tests/Instances/Data/Dynamic.hs | tests/Instances/Data/Dynamic.hs | {-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module: Instances.Data.Dynamic
Copyright: (C) 2014-2015 Ryan Scott
License: BSD-style (see the file LICENSE)
Maintainer: Ryan Scott
Stability: Experimental
Portability: GHC
'Arbitrary' instance for 'Dynamic'.
-}
module Instances.Data.Dynamic () where
import Dat... | {-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module: Instances.Data.Dynamic
Copyright: (C) 2014-2015 Ryan Scott
License: BSD-style (see the file LICENSE)
Maintainer: Ryan Scott
Stability: Experimental
Portability: GHC
'Arbitrary' instance for 'Dynamic'.
-}
module Instances.Data.Dynamic () where
import Dat... | Make sure <$> is in scope | Make sure <$> is in scope
| Haskell | bsd-3-clause | RyanGlScott/text-show |
e93f7a4181308147b3d2c9211eb6d63e51cea188 | src/Rules/Clean.hs | src/Rules/Clean.hs | module Rules.Clean (cleanRules) where
import Base
import Package
import Settings
import Settings.Path
import Stage
import UserSettings
import Util
cleanRules :: Rules ()
cleanRules = do
"clean" ~> do
forM_ [Stage0 ..] $ removeDirectory . (buildRootPath -/-) . stageString
removeDirectory generatedP... | module Rules.Clean (cleanRules) where
import Base
import Settings.Path
import Stage
import UserSettings
import Util
cleanRules :: Rules ()
cleanRules = do
"clean" ~> do
forM_ [Stage0 ..] $ removeDirectory . (buildRootPath -/-) . stageString
removeDirectory generatedPath
removeDirectory pro... | Drop redundant clean up after ghc-cabal | Drop redundant clean up after ghc-cabal
See #113
| Haskell | bsd-3-clause | sdiehl/ghc,sdiehl/ghc,snowleopard/shaking-up-ghc,sdiehl/ghc,sdiehl/ghc,bgamari/shaking-up-ghc,snowleopard/hadrian,sdiehl/ghc,sdiehl/ghc,izgzhen/hadrian,sdiehl/ghc |
138763a850f5332b5924767e9b4e23eebb4d20ff | Handler/Game.hs | Handler/Game.hs | {-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Handler.Game where
import Data.Aeson (encode)
import GameManagement
import Text.Blaze.Html (ToMarkup, toMarkup)
import qualified Text... | {-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Handler.Game where
import Data.Aeson (encode)
import GameManagement
import Text.Blaze.Html (ToMarkup, toMarkup)
import qualified Text... | Return 404 for non existent games | Return 404 for non existent games
| Haskell | apache-2.0 | jml/haverer-api |
ca3668623db313eee4005080021b4e01ee191b80 | Handler/Home.hs | Handler/Home.hs | {-# LANGUAGE TupleSections, OverloadedStrings #-}
module Handler.Home where
import Import
-- This is a handler function for the GET request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majority of the code you will write in Yesod lives in these handl... | {-# LANGUAGE TupleSections, OverloadedStrings #-}
module Handler.Home where
import Import
-- This is a handler function for the GET request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majority of the code you will write in Yesod lives in these handl... | Update the title of nomura laboratory's homepage | Update the title of nomura laboratory's homepage
| Haskell | bsd-2-clause | SuetakeY/nomnichi_yesod,nomlab/nomnichi-haskell,SuetakeY/nomnichi_yesod,SuetakeY/nomnichi_yesod,nomlab/nomnichi-haskell,okada-takuya/nomnichi-haskell,kobayashi1027/nomnichi-haskell,nomlab/nomnichi-haskell,ichikawa85/nomnichi_haskell,ichikawa85/nomnichi_haskell,kobayashi1027/nomnichi-haskell,okada-takuya/nomnichi-haskel... |
06f2ac654e29335e522b02fb53369d774039bad6 | CabalHelper/Compiletime/Log.hs | CabalHelper/Compiletime/Log.hs | {-# LANGUAGE ScopedTypeVariables #-}
module CabalHelper.Compiletime.Log where
import Control.Monad
import Control.Monad.IO.Class
import Control.Exception as E
import Data.String
import System.IO
import Prelude
import CabalHelper.Compiletime.Types
vLog :: MonadIO m => Options -> String -> m ()
vLog Options { verbose... | {-# LANGUAGE ScopedTypeVariables #-}
module CabalHelper.Compiletime.Log where
import Control.Monad
import Control.Monad.IO.Class
import Control.Exception as E
import Data.String
import System.IO
import Prelude
import CabalHelper.Compiletime.Types
vLog :: MonadIO m => Options -> String -> m ()
vLog Options { verbose... | Fix displayExceoption not being available on older GHCs | Fix displayExceoption not being available on older GHCs
| Haskell | apache-2.0 | DanielG/cabal-helper |
ef939d6da3d83caa132ec153a972af928becac5e | src/General/Ids.hs | src/General/Ids.hs | {-# LANGUAGE RecordWildCards #-}
module General.Ids(
Ids, Id,
empty, insert, lookup
) where
import Data.IORef.Extra
import Data.Primitive.Array
import General.Intern(Id(..))
import Prelude hiding (lookup)
import GHC.Exts
data Ids a = Ids (IORef (S a))
data S a = S
{capacity :: {-# UNPACK #-} !Int
... | {-# LANGUAGE RecordWildCards #-}
module General.Ids(
Ids, Id,
empty, insert, lookup
) where
import Data.IORef.Extra
import Data.Primitive.Array
import General.Intern(Id(..))
import Prelude hiding (lookup)
import GHC.Exts
data Ids a = Ids (IORef (S a))
data S a = S
{capacity :: {-# UNPACK #-} !Int
... | Increase the base size more quickly | Increase the base size more quickly
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
2480767a4b1a924ba52ee818e051b595afe508b6 | src/PTS/Algebra.hs | src/PTS/Algebra.hs | module PTS.Algebra
( Algebra
, fold
, allvars
, allvarsAlgebra
) where
import Data.Set (Set)
import qualified Data.Set as Set
import PTS.AST
-- algebras
type Algebra alpha
= TermStructure alpha -> alpha
fold :: Algebra alpha -> Term -> alpha
fold algebra term = algebra (fmap (fold algeb... | module PTS.Algebra
( PreAlgebra
, Algebra
, fold
, allvars
, allvarsAlgebra
) where
import Data.Set (Set)
import qualified Data.Set as Set
import PTS.AST
-- algebras
type PreAlgebra alpha beta
= TermStructure alpha -> beta
type Algebra alpha
= PreAlgebra alpha alpha
fold :: Alge... | Add a notion for (F a -> b). | Add a notion for (F a -> b).
| Haskell | bsd-3-clause | Blaisorblade/pts,Toxaris/pts |
0bde9c13cd854c1297296a77be53ec7940045f71 | src/Rules/Clean.hs | src/Rules/Clean.hs | module Rules.Clean (cleanRules) where
import Base
import Package
import Rules.Generate
import Settings.Packages
import Settings.Paths
import Settings.User
import Stage
cleanRules :: Rules ()
cleanRules = do
"clean" ~> do
putBuild $ "| Remove files in " ++ buildRootPath ++ "..."
liftIO $ removeFile... | module Rules.Clean (cleanRules) where
import Base
import Package
import Rules.Generate
import Settings.Packages
import Settings.Paths
import Settings.User
import Stage
cleanRules :: Rules ()
cleanRules = do
"clean" ~> do
putBuild $ "| Remove files in " ++ buildRootPath ++ "..."
liftIO $ removeFile... | Remove Shake database on clean. | Remove Shake database on clean.
See #131. [skip ci]
| Haskell | bsd-3-clause | sdiehl/ghc,izgzhen/hadrian,sdiehl/ghc,snowleopard/hadrian,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,sdiehl/ghc,snowleopard/shaking-up-ghc,sdiehl/ghc,bgamari/shaking-up-ghc |
989098fb329cfaeb8940098a070c859928f03cfa | persistent-test/PrimaryTest.hs | persistent-test/PrimaryTest.hs | {-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
module PrimaryTest where
import Init
-- mpsGeneric = False is due to a bug or at least lack of a feature in mkKeyTypeDec TH... | {-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
module PrimaryTest where
import Init
-- mpsGeneric = False is due to a bug or at least lack of a feature in mkKeyTypeDec TH... | Add a test using the RawSql instance for a non-composite primary key | Add a test using the RawSql instance for a non-composite primary key
| Haskell | mit | yesodweb/persistent,nakaji-dayo/persistent,psibi/persistent,superduper/persistent,superduper/persistent,mitchellwrosen/persistent,nakaji-dayo/persistent,pseudonom/persistent,plow-technologies/persistent,paul-rouse/persistent,jasonzoladz/persistent,meteficha/persistent,greydot/persistent,gbwey/persistent,jasonzoladz/per... |
8201b06213ec48c5f343d09f6b83a30ab46ea07d | src/Language/Futhark/Futlib/Prelude.hs | src/Language/Futhark/Futlib/Prelude.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
-- | The Futhark prelude embedded into the Futhark compiler. This
-- means we do not have to parse and type-check it whenever we compile
-- a Futhark program.
module Language.Futhark.Futlib.Prelude (preludeBasis) where
im... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
-- | The Futhark prelude embedded into the Futhark compiler. This
-- means we do not have to parse and type-check it whenever we compile
-- a Futhark program.
module Language.Futhark.Futlib.Prelude (preludeBasis) where
im... | Fix explicit prelude import on Windows. | Fix explicit prelude import on Windows.
Maybe. It's hard to get Haskell running on Windows, apparently.
| Haskell | isc | HIPERFIT/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark |
16bee47e42dd7174b0ee227b706618a23f295e22 | hhttpserver.hs | hhttpserver.hs | import Network.Socket hiding (send, sendTo, recv, recvFrom)
import Network.Socket.ByteString
import qualified Data.ByteString.Char8 as C
import qualified Data.ByteString.Lazy as B
import Control.Concurrent
import Control.Exception
-- This is most likely really insecure with non-existant error handling
port = 8080
inc... | import Network.Socket hiding (send, sendTo, recv, recvFrom)
import Network.Socket.ByteString
import qualified Data.ByteString.Char8 as C
import qualified Data.ByteString as B
import Control.Concurrent
import Control.Exception
-- This is most likely really insecure with non-existant error handling
port = 8080
incoming... | Work better with binary files? | Work better with binary files?
| Haskell | mit | michalc/hhttpserver,michalc/hhttpserver |
f38292a6c552e548075a975b9eea33be93007f96 | Examples/Util.hs | Examples/Util.hs |
module Examples.Util where
import Development.Shake
import Development.Shake.FilePath
import Control.Concurrent(threadDelay)
import Control.Monad
import System.Directory
import System.Environment
shaken
:: (([String] -> IO ()) -> (String -> String) -> IO ())
-> ((String -> String) -> Rules ())
-> IO ()... |
module Examples.Util where
import Development.Shake
import Development.Shake.FilePath
import Control.Concurrent(threadDelay)
import Control.Monad
import System.Directory
import System.Environment
shaken
:: (([String] -> IO ()) -> (String -> String) -> IO ())
-> ((String -> String) -> Rules ())
-> IO ()... | Change the no test to at least do some testing | Change the no test to at least do some testing
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,nh2/shake,ndmitchell/shake,nh2/shake,nh2/shake,nh2/shake,nh2/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
631c88a4b659bccc0bd110e8ba43ee3acb0aca9b | src/Data/Lazy.purs.hs | src/Data/Lazy.purs.hs | module Data.Lazy where
foreign import data Lazy :: * -> *
foreign import defer
"function defer(thunk) {\
\ if (this instanceof defer) {
\ this.thunk = thunk;\
\ return this;\
\ } else {
\ return new defer(thunk);
\ }
\}\
\defer.prototype.force = function () {\
\ var val... | module Data.Lazy where
foreign import data Lazy :: * -> *
foreign import defer
"function defer(thunk) {\
\ if (this instanceof defer) {\
\ this.thunk = thunk;\
\ return this;\
\ } else {\
\ return new defer(thunk);\
\ }\
\}\
\defer.prototype.force = function () {\
\ var... | Fix inline JS line endings | Fix inline JS line endings
| Haskell | bsd-3-clause | purescript/purescript-lazy |
90767a9592dc69fa89ad8f044174447f27b4c80b | src/Bucket/Types.hs | src/Bucket/Types.hs | module Bucket.Types where
import Meta
import qualified Data.Map as M
import System.FilePath
data Bucket = Bucket {
bucketPath :: FilePath,
bucketItemsMap :: (M.Map FilePath BucketItem)
} deriving (Eq, Show)
data BucketItem = BucketItem {
itemPath :: FilePath,
itemMeta :: Meta
} deriving (Eq, Show... | module Bucket.Types where
import Meta
import qualified Data.Map as M
import System.FilePath
data Bucket = Bucket {
bucketPath :: FilePath,
bucketItemsMap :: (M.Map FilePath BucketItem)
} deriving (Eq, Show)
addItem :: Bucket -> BucketItem -> Bucket
addItem bucket item = bucket { bucketItemsMap = M.insert... | Move code block to clarify structure. | Move code block to clarify structure.
| Haskell | bsd-3-clause | rickardlindberg/orgapp |
eb3725bf655ed7c7afd6346a964334cd9af20c85 | src/Main.hs | src/Main.hs | {-# LANGUAGE ScopedTypeVariables #-}
module Main where
import System.IO
import IRC.IRC
import Control.Exception (bracket)
import Control.Monad (foldM)
import System.Environment (getArgs)
import Processor (startProcessing)
import IRC.Display (printCC)
import qualified Config (Config(..), findGroup, readFile')
import q... | {-# LANGUAGE ScopedTypeVariables #-}
module Main where
import System.IO
import IRC.IRC
import Control.Exception (bracket)
import Control.Monad (foldM)
import Data.List (isPrefixOf)
import System.Environment (getArgs)
import Processor (startProcessing)
import IRC.Display (printCC)
import qualified Config (Config(..), ... | Fix channel list being parsed as username and OAuth | Fix channel list being parsed as username and OAuth
| Haskell | mit | Acizza/twirc |
35d16df43a6a1715227db2e3ceb907874253bbb3 | doc/tutorial/docode.hs | doc/tutorial/docode.hs | module Main where
import Control.Monad
import System.Process
interactIO :: (String -> IO String) -> IO ()
interactIO act = do
txt <- getContents
mapM_ (act >=> putStr) (lines txt)
-- TODO: this does no error handling whatsoever
processCommand :: String -> IO String
processCommand line =
case words line of
... | module Main where
import Control.Monad
import System.Process
interactIO :: (String -> IO String) -> IO ()
interactIO act = do
txt <- getContents
mapM_ (act >=> putStr) (lines txt)
-- TODO: this does no error handling whatsoever
processCommand :: String -> IO String
processCommand line =
case words line of
... | Include shell line when preprocessing $cmd. | Include shell line when preprocessing $cmd.
| Haskell | bsd-3-clause | GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script |
ae6fea38ed15a8126f90ef0e78761ca6e1ef7b55 | src/Input/Type.hs | src/Input/Type.hs |
module Input.Type(
Database(..),
Item(..), Items(..),
isIPackage, isIModule,
URL, Documentation,
Id(..)
) where
import Numeric
import Data.Tuple.Extra
import Language.Haskell.Exts
newtype Database = Database FilePath
---------------------------------------------------------------------
-- DA... |
module Input.Type(
Database(..),
Item(..), Items(..),
isIPackage, isIModule,
URL, Documentation,
Id(..)
) where
import Numeric
import Data.Tuple.Extra
import Language.Haskell.Exts
newtype Database = Database FilePath
---------------------------------------------------------------------
-- DA... | Add from keywords to the Items type | Add from keywords to the Items type
| Haskell | bsd-3-clause | ndmitchell/hoogle,wolftune/hoogle,ndmitchell/hogle-dead,BartAdv/hoogle,wolftune/hoogle,BartAdv/hoogle,ndmitchell/hoogle,wolftune/hoogle,wolftune/hoogle,BartAdv/hoogle,BartAdv/hoogle,ndmitchell/hogle-dead,ndmitchell/hoogle |
ab7331928c5ab606ea1707cf87486c42069ab72c | NationStates/RateLimit.hs | NationStates/RateLimit.hs | -- | Simple rate limiting combinator.
module NationStates.RateLimit (
RateLimit(),
newRateLimit,
rateLimit,
) where
import Control.Concurrent
import Control.Exception
import System.Clock
data RateLimit = RateLimit {
rateLock :: !(MVar TimeSpec),
rateDelay :: !TimeSpec
}
-- | Create a ... | -- | Simple rate limiting combinator.
module NationStates.RateLimit (
RateLimit(),
newRateLimit,
rateLimit,
) where
import Control.Concurrent
import Control.Exception
import System.Clock
data RateLimit = RateLimit {
rateLock :: !(MVar TimeSpec),
rateDelay :: !TimeSpec
}
-- | Create a ... | Revert "Use `putMVar` instead of `tryPutMVar` in rate limiter" | Revert "Use `putMVar` instead of `tryPutMVar` in rate limiter"
This reverts commit 1a79831b00edc6ebcc2bbc3a51035780392bfd77.
| Haskell | apache-2.0 | lfairy/nationstates |
a6cf8ece5e6f0d88863b02b0e0449b7829a08d41 | src/DataAnalysis/Application/Prelude.hs | src/DataAnalysis/Application/Prelude.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module DataAnalysis.Application.Prelude
(runAnalysisApp)
where
import Data.Conduit (Conduit)
import Data.Text (Text)
import Data.Time
import Yesod
import Yesod... | {-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module DataAnalysis.Application.Prelude
(runAnalysisApp)
where
import Data.Conduit (Conduit)
import Data.Text (Text)
import Data.Time
import Yesod
import Yesod... | Fix http-conduit/client reference for FPHC | Fix http-conduit/client reference for FPHC
| Haskell | mit | teuffy/min-var-ci,teuffy/min-var-ci |
9b0a2649b60cb9014e3667154e8536f301f1560b | XMonad/Actions/SinkAll.hs | XMonad/Actions/SinkAll.hs | -----------------------------------------------------------------------------
-- |
-- Module : Xmonad.Actions.SinkAll
-- License : BSD3-style (see LICENSE)
-- Stability : unstable
-- Portability : unportable
--
-- Provides a simple binding that pushes all floating windows on the current
-- workspace back... | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.SinkAll
-- License : BSD3-style (see LICENSE)
-- Stability : unstable
-- Portability : unportable
--
-- Provides a simple binding that pushes all floating windows on the current
-- workspace back... | Correct caps in module header. | Correct caps in module header. | Haskell | bsd-3-clause | CaptainPatate/xmonad-contrib,0/xmonad-contrib,mathstuf/xmonad-contrib,f1u77y/xmonad-contrib,0/xmonad-contrib,xmonad/xmonad-contrib,ohlus/xmonad-contrib,CaptainPatate/xmonad-contrib,pjones/xmonad-test,ohlus/xmonad-contrib,ohlus/xmonad-contrib,mathstuf/xmonad-contrib,mathstuf/xmonad-contrib,0/xmonad-contrib,CaptainPatate... |
85c91504558f5414fa04828318013b190caeed65 | src/Hyakko/Types.hs | src/Hyakko/Types.hs | {-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-}
module Hyakko.Types where
import Control.Applicative ((<$>), (<*>), empty)
import Data.Aeson
import Data.ByteString.Lazy (ByteString)
import Data.HashMap.Strict (HashMap)
import Data.Text (Text)
import System.Console.CmdArgs
-- The `Sections` type is just an ali... | {-# 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... | Change Language members to Text | Change Language members to Text
| Haskell | mit | sourrust/hyakko |
0748457bb974fc089854d71b073d968b6dfa01b6 | lib/Data/Capnp/Core/Schema.hs | lib/Data/Capnp/Core/Schema.hs | {-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Data.Capnp.Core.Schema
(
-- re-export the generated code:
module Da... | {-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Data.Capnp.Core.Schema
(
-- re-export the generated code:
module Da... | Remove a bunch of unused imports. | Remove a bunch of unused imports.
| Haskell | mit | zenhack/haskell-capnp |
53389ffbf8b1b5ab0d3d9803d7d58c5914d57714 | compiler/Generate/JavaScript/Helpers.hs | compiler/Generate/JavaScript/Helpers.hs | {-# OPTIONS_GHC -W #-}
module Generate.JavaScript.Helpers where
import qualified SourceSyntax.Helpers as Help
import Language.ECMAScript3.Syntax
split :: String -> [String]
split = go []
where
go vars str =
case break (=='.') str of
(x,_:rest) | Help.isOp x -> vars ++ [x ++ '.' : rest]
... | {-# OPTIONS_GHC -W #-}
module Generate.JavaScript.Helpers where
import qualified SourceSyntax.Helpers as Help
import Language.ECMAScript3.Syntax
split :: String -> [String]
split = go []
where
go vars str =
case break (=='.') str of
(x,_:rest) | Help.isOp x -> vars ++ [x ++ '.' : rest]
... | Make instanceof check safer, check if it's an object before using instance of | Make instanceof check safer, check if it's an object before using instance of
| Haskell | bsd-3-clause | Axure/elm-compiler,mgold/Elm,deadfoxygrandpa/Elm,JoeyEremondi/elm-pattern-effects,laszlopandy/elm-compiler,pairyo/elm-compiler,5outh/Elm |
89510cc1e1b59f5252c96e76b9637293ffa2d881 | src/Paths.hs | src/Paths.hs | -- | Fake cabal module for local building
module Paths_shake where
import Data.Version.Extra
import System.IO.Unsafe
import System.Directory
import Control.Exception
-- We want getDataFileName to be relative to the current directory even if
-- we issue a change directory command. Therefore, first call caches, futur... | -- | Fake cabal module for local building
module Paths_shake where
import Data.Version.Extra
import System.IO.Unsafe
import System.Directory
import Control.Exception
-- We want getDataFileName to be relative to the current directory even if
-- we issue a change directory command. Therefore, first call caches, futur... | Add a missing NOINLINE, spotted by HLint | Add a missing NOINLINE, spotted by HLint
| Haskell | bsd-3-clause | ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake,ndmitchell/shake |
19f460c19f2f61919127c6c313bc6f5356a79d9e | Spec.hs | Spec.hs | import Test.Hspec
import Test.QuickCheck
import Control.Exception (evaluate)
import Lists
main :: IO ()
main = hspec $ do
describe "Lists.last" $ do
it "returns the last element of a list" $ do
Lists.last [1 .. 45] `shouldBe` (45 :: Int)
it "throws an exception if used with an empty list" $ do
e... | import Test.Hspec
import Test.QuickCheck
import Control.Exception (evaluate)
import Lists
main :: IO ()
main = hspec $ do
describe "Lists.last" $ do
it "returns the last element of a list" $ do
Lists.last [1 .. 45] `shouldBe` (45 :: Int)
it "throws an exception if used with an empty list" $ do
e... | Add spec for elementAt index out of bounds. | Add spec for elementAt index out of bounds.
| Haskell | mit | alisdair/H99P |
efb8c941405feb638750a5c68283e7d0f8eceab4 | tests/WikiTest.hs | tests/WikiTest.hs | {-# LANGUAGE OverloadedStrings #-}
module WikiTest
( wikiSpecs
) where
import TestImport
import Model.Language
wikiSpecs :: Spec
wikiSpecs =
ydescribe "wiki" $ do
yit "creates a new page" $ [marked|
loginAs TestUser
newWiki snowdrift LangEn "wiki-test" "wiki test: new pa... | {-# LANGUAGE OverloadedStrings #-}
module WikiTest
( wikiSpecs
) where
import TestImport
import Model.Language
wikiSpecs :: Spec
wikiSpecs =
ydescribe "wiki" $ do
yit "Unestablished user can't create" $ [marked|
loginAs Sue
get $ NewWikiR snowdrift LangEn "wiki-no-dice"
... | Add wiki tests with unestablished user | Add wiki tests with unestablished user
| Haskell | agpl-3.0 | chreekat/snowdrift,akegalj/snowdrift,snowdriftcoop/snowdrift,chreekat/snowdrift,akegalj/snowdrift |
ca7a20861f491d639252454dbdbd06ca74097841 | Main.hs | Main.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
import Control.Lens
import Network.Wreq
import Data.Text as T (Text)
import Data.Aeson
import GHC.Generics
import Data.Function (on)
import Data.List (maximumBy)
data RhymebrainResult = RhymebrainResult { score :: Int, word :: T.Text }... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
import Control.Lens
import Network.Wreq
import Data.Text as T (Text)
import Data.Aeson
import GHC.Generics
import Data.Function (on)
import Data.List (maximumBy)
data RhymebrainResult = RhymebrainResult { score :: Int, word :: T.Text }... | Print out the highest-scoring words | Print out the highest-scoring words
| Haskell | mit | gabebw/girls-just-want-to-have-punctors |
c61d87f010f045343b248159ef995a022a2c4eab | src/AST/Literal.hs | src/AST/Literal.hs | {-# OPTIONS_GHC -Wall #-}
module AST.Literal where
import qualified Data.Map as Map
import qualified Text.PrettyPrint as P
import qualified Reporting.PrettyPrint as P
data Literal
= IntNum Int
| FloatNum Double
| Chr Char
| Str String
| Boolean Bool
deriving (Eq, Ord, Show)
instance P.Pret... | {-# OPTIONS_GHC -Wall #-}
module AST.Literal where
import qualified Data.Map as Map
import qualified Text.PrettyPrint as P
import qualified Reporting.PrettyPrint as P
data Literal
= IntNum Int
| FloatNum Double
| Chr Char
| Str String
| Boolean Bool
deriving (Eq, Ord, Show)
instance P.Pret... | Make pretty printing code nicer | Make pretty printing code nicer
| Haskell | bsd-3-clause | pairyo/elm-compiler,mgold/Elm,JoeyEremondi/elm-pattern-effects,laszlopandy/elm-compiler,Axure/elm-compiler,5outh/Elm |
aeb76bd1ec9a48f2291347611de4a47c032fb6f0 | bench/Main.hs | bench/Main.hs | module Main (main) where
import Criterion.Main
import Control.Monad.ST
import Control.Monad.Primitive (PrimMonad)
import Control.Monad.Random (MonadRandom)
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Data.Vector.Unboxed (Vector, Unbox)
import qualified Data.Vector.Unboxed as V
import P... | module Main (main) where
import Criterion.Main
import Control.Monad.ST
import Control.Monad.Primitive (PrimMonad)
import Control.Monad.Random (MonadRandom)
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Data.Vector.Unboxed (Vector, Unbox)
import qualified Data.Vector.Unboxed as V
import P... | Add benchmarks for random noise generation, and tweak others. | Add benchmarks for random noise generation, and tweak others.
| Haskell | bsd-3-clause | sacundim/tau-sigma |
3921ac232e06cd2f489b4ba87430b17f775c324c | compiler/SourceSyntax/Literal.hs | compiler/SourceSyntax/Literal.hs | {-# LANGUAGE DeriveDataTypeable #-}
module SourceSyntax.Literal where
import Data.Data
import SourceSyntax.PrettyPrint
import qualified Text.PrettyPrint as PP
data Literal = IntNum Int
| FloatNum Float
| Chr Char
| Str String
| Boolean Bool
deriving (... | {-# LANGUAGE DeriveDataTypeable #-}
module SourceSyntax.Literal where
import Data.Data
import SourceSyntax.PrettyPrint
import qualified Text.PrettyPrint as PP
data Literal = IntNum Int
| FloatNum Double
| Chr Char
| Str String
| Boolean Bool
deriving ... | Switch to using Double to represent floats internal | Switch to using Double to represent floats internal
| Haskell | bsd-3-clause | pairyo/elm-compiler,5outh/Elm,laszlopandy/elm-compiler,JoeyEremondi/elm-pattern-effects,deadfoxygrandpa/Elm,mgold/Elm,Axure/elm-compiler |
2351157df13de2455013d52fbc168c136dc0ed06 | test/OtherTests.hs | test/OtherTests.hs | module OtherTests (otherTests) where
import TestHelpers
import Foreign.Storable (peek, poke)
import Foreign.Marshal (alloca)
otherTests :: Rank -> [(String,TestRunnerTest)]
otherTests _ = [ testCase "Peeking/poking Status" statusPeekPoke
, testCase "wtime/wtick" wtimeWtickTest ]
statusPeekPoke :: IO... | module OtherTests (otherTests) where
import TestHelpers
import Foreign.Storable (peek, poke)
import Foreign.Marshal (alloca)
otherTests :: Rank -> [(String,TestRunnerTest)]
otherTests _ = [ testCase "Peeking/poking Status" statusPeekPoke
, testCase "wtime/wtick" wtimeWtickTest
, testC... | Test for getProcessorName, commRank, commSize | Test for getProcessorName, commRank, commSize
| Haskell | bsd-3-clause | bjpop/haskell-mpi,bjpop/haskell-mpi,bjpop/haskell-mpi |
eb106f1db84dfd066c860883bd6ec48c80172c80 | src/Wikirick/Application.hs | src/Wikirick/Application.hs | module Wikirick.Application where
import Control.Lens
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Auth
import Snap.Snaplet.Session
import Wikirick.JSONConnection
data App = App
{ _heist :: Snaplet (Heist App)
, _sess :: Snaplet SessionManager
, _auth :: Snaplet (AuthManager App)
, _json... | module Wikirick.Application where
import Control.Lens
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Auth
import Snap.Snaplet.Session
import Wikirick.Article
import Wikirick.JSONConnection
import qualified Wikirick.URLMapper as U
data App = App
{ _heist :: Snaplet (Heist App)
, _sess :: Snaple... | Add wikirick's sub snaplets to the app | Add wikirick's sub snaplets to the app
| Haskell | bsd-3-clause | keitax/wikirick |
c43529a93ef77c4f478eaabfed0ce7350a9d1d5f | Distribution/Server/Packages/ChangeLog.hs | Distribution/Server/Packages/ChangeLog.hs | {-# LANGUAGE NamedFieldPuns #-}
module Distribution.Server.Packages.ChangeLog (
findChangeLog
) where
import Data.TarIndex (TarIndex, TarEntryOffset)
import qualified Data.TarIndex as TarIndex
import Distribution.Server.Packages.Types (PkgInfo)
import Distribution.Package (packageId)
import Distribution.Text (di... | {-# LANGUAGE NamedFieldPuns #-}
module Distribution.Server.Packages.ChangeLog (
findChangeLog
) where
import Data.TarIndex (TarIndex, TarEntryOffset)
import qualified Data.TarIndex as TarIndex
import Distribution.Server.Packages.Types (PkgInfo)
import Distribution.Package (packageId)
import Distribution.Text (di... | Add more allowed file names for changelogs | Add more allowed file names for changelogs
Based on byorgey's pull req #149
| Haskell | bsd-3-clause | dzackgarza/hackage-server,snoyberg/hackage-server,chrisdotcode/hackage-server,edsko/hackage-server,agrafix/hackage-server,tkvogt/hackage-server,edsko/hackage-server,grayjay/hackage-server,snoyberg/hackage-server,erantapaa/hackage-server,dzackgarza/hackage-server,tkvogt/hackage-server,grayjay/hackage-server,agrafix/hack... |
6de5b99c4dc36483d838102268d438e740ce0d93 | src/System/Taffybar/FSMonitor.hs | src/System/Taffybar/FSMonitor.hs | -----------------------------------------------------------------------------
-- |
-- Module : System.Taffybar.FSMonitor
-- Maintainer : José A. Romero L. <escherdragon@gmail.com>
--
-- Simple text widget that monitors the current usage of selected disk
-- partitions by regularly parsing the output of the df command in... | -----------------------------------------------------------------------------
-- |
-- Module : System.Taffybar.FSMonitor
-- Maintainer : José A. Romero L. <escherdragon@gmail.com>
--
-- Simple text widget that monitors the current usage of selected disk
-- partitions by regularly parsing the output of the df command in... | Make a local function top-level | Make a local function top-level
It only accessed local state because it was ignoring its parameter.
| Haskell | bsd-3-clause | teleshoes/taffybar,Undeterminant/taffybar |
d059c362d9634b048b678f83529da3d23e385080 | compiler/Type/Constrain/Literal.hs | compiler/Type/Constrain/Literal.hs | module Type.Constrain.Literal where
import Data.Map ((!))
import qualified Data.Map as Map
import SourceSyntax.Literal
import Type.Type
import Type.Fragment
import Type.Environment as Env
constrain :: Environment -> Literal -> Type -> IO TypeConstraint
constrain env literal tipe =
let prim name = Env.get env Env... | module Type.Constrain.Literal where
import Data.Map ((!))
import qualified Data.Map as Map
import SourceSyntax.Literal
import Type.Type
import Type.Fragment
import Type.Environment as Env
constrain :: Environment -> Literal -> Type -> IO TypeConstraint
constrain env literal tipe =
let prim name = Env.get env Env... | Fix the type of String literals | Fix the type of String literals
| Haskell | bsd-3-clause | 5outh/Elm,Axure/elm-compiler,deadfoxygrandpa/Elm,mgold/Elm,laszlopandy/elm-compiler,pairyo/elm-compiler,JoeyEremondi/elm-pattern-effects |
0e91c2f384ef39575b101bbce4b470b8c3d0a309 | src/GI/ProjectInfo.hs | src/GI/ProjectInfo.hs | -- | Project information to include in generated bindings, should be
-- kept in sync with haskell-gi.cabal
module GI.ProjectInfo
( homepage
, authors
, license
, maintainers
) where
homepage :: String
homepage = "https://github.com/haskell-gi/haskell-gi"
authors :: String
authors = "Will Thompson,... | -- | Project information to include in generated bindings, should be
-- kept in sync with haskell-gi.cabal
module GI.ProjectInfo
( homepage
, authors
, license
, maintainers
) where
homepage :: String
homepage = "https://github.com/haskell-gi/haskell-gi"
authors :: String
authors = "Will Thompson,... | Fix license of generated code | Fix license of generated code
| Haskell | lgpl-2.1 | hamishmack/haskell-gi,hamishmack/haskell-gi,ford-prefect/haskell-gi,ford-prefect/haskell-gi |
881b374b6c2589e2d24a0881eb3f4eb5ce1b431a | ch04-naive-bayes/src/EmailDemo.hs | ch04-naive-bayes/src/EmailDemo.hs | module EmailDemo (runEmailDemos) where
import Ch04NaiveBayes.Email
import Control.Monad
import Paths_ch04_naive_bayes
import System.Directory
import System.FilePath
import qualified System.IO.Strict as IOS
getDataFileNames :: FilePath -> IO [FilePath]
getDataFileNames... | module EmailDemo (runEmailDemos) where
import Ch04NaiveBayes.Email
import Control.Monad
import Data.List
import Paths_ch04_naive_bayes
import System.Directory
import System.FilePath
import qualified System.IO.Strict as IOS
getDataFileNames :: FilePath -> IO ... | Build up docList and fullText | Build up docList and fullText
| Haskell | mit | rcook/mlutil |
164188d6e3fbd261628cf6cc3c6ffb8871aeab9a | NationStates/RateLimit.hs | NationStates/RateLimit.hs | -- | Simple rate limiting combinator.
module NationStates.RateLimit (
RateLimit(),
newRateLimit,
rateLimit,
) where
import Control.Concurrent
import System.Clock
data RateLimit = RateLimit {
rateLock :: !(MVar TimeSpec),
rateDelay :: !TimeSpec
}
-- | Create a new rate limiter with the... | -- | Simple rate limiting combinator.
module NationStates.RateLimit (
RateLimit(),
newRateLimit,
rateLimit,
) where
import Control.Concurrent
import System.Clock
data RateLimit = RateLimit {
rateLock :: !(MVar TimeSpec),
rateDelay :: !TimeSpec
}
-- | Create a new rate limiter with the... | Update the timer *after* the request completes | Update the timer *after* the request completes
Let's see if this fixes the rate limit issue.
| Haskell | apache-2.0 | lfairy/nationstates |
c3ff350e51ac29c8d071a95f095ceaa1af9d13a1 | tests/test-utils.hs | tests/test-utils.hs | import System.Exit (exitFailure)
import Data.List (elemIndices, sort, nub)
import Test.Check
import Test.Check.Utils
import Test.Check.Invariants
import Test.Types (Nat)
main :: IO ()
main =
case elemIndices False tests of
[] -> putStrLn "Tests passed!"
is -> do putStrLn ("Failed tests:" ++ show is)
... | import System.Exit (exitFailure)
import Data.List (elemIndices, sort, nub)
import Test.Check
import Test.Check.Utils
import Test.Check.Invariants
import Test.Types (Nat)
main :: IO ()
main =
case elemIndices False tests of
[] -> putStrLn "Tests passed!"
is -> do putStrLn ("Failed tests:" ++ show is)
... | Remove TODO already dealt with | Remove TODO already dealt with
| Haskell | bsd-3-clause | rudymatela/llcheck,rudymatela/leancheck |
b9af40233ca9778b2f14ca7d7b194d7dd2483556 | vty.hs | vty.hs | module Main where
import Control.Monad ( forM_ )
import Widgets
import Graphics.Vty
titleAttr :: Attr
titleAttr = def_attr
`with_back_color` blue
`with_fore_color` bright_white
bodyAttr :: Attr
bodyAttr = def_attr
`with_back_color` black
`with_fore_color` bright_green
... | module Main where
import Control.Applicative ( (<$>) )
import Control.Monad ( forM_ )
import Widgets
import Graphics.Vty
titleAttr :: Attr
titleAttr = def_attr
`with_back_color` blue
`with_fore_color` bright_white
bodyAttr :: Attr
bodyAttr = def_attr
`with_back_color` black
... | Use applicative style in widget test loop | Use applicative style in widget test loop
Ignore-this: 8b9e6fbd52ccbe2c3fe307b3e35d8cb7
darcs-hash:20090927210224-e018d-733ff1a483e7042dd4c1b44e35447440d57039d5.gz
| Haskell | bsd-3-clause | KommuSoft/vty-ui,ktvoelker/vty-ui |
30026878c827ad0034b47af22f5e80fd2d4bbd9d | Main.hs | Main.hs |
module Main(main) where
import System.Environment
import Example.Example
import System.Exit
type Test = (String,IO ())
allTests = tests ++ regress
tests = [("hitcount",("Haskell Hit Count",haskellHitCount))]
regress = [("regress",("Regression Tests",haskellHitCount))]
main = do
args <- getArgs
todo <- ... |
module Main(main) where
import System.Environment
import Example.Example
import System.Exit
type Test = (String,IO ())
allTests = tests ++ regress
tests = [("hitcount",("Haskell Hit Count",haskellHitCount))
,("google",("Google Tech News",googleTechNews))
,("spj",("Simon Peyton Jones' papers",spjPa... | Add back some more examples | Add back some more examples | Haskell | bsd-3-clause | silkapp/tagsoup |
c22aa70c1fa230e647ab8b3a41dbc6b0cc24285b | Databrary/Web/JSHint.hs | Databrary/Web/JSHint.hs | {-# LANGUAGE OverloadedStrings #-}
module Databrary.Web.JSHint
( checkJSHint
) where
import Control.Applicative ((<$>))
import Control.Monad (mzero, when)
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as BSC
import qualified Data.Foldable as Fold
import System.FilePath (takeExtensio... | {-# LANGUAGE OverloadedStrings #-}
module Databrary.Web.JSHint
( checkJSHint
) where
import Control.Applicative ((<$>))
import Control.Monad (mzero, when)
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as BSC
import qualified Data.Foldable as Fold
import System.FilePath (takeExtensio... | Fix last for new/never-hinted files | Fix last for new/never-hinted files
| Haskell | agpl-3.0 | databrary/databrary,databrary/databrary,databrary/databrary,databrary/databrary |
0503c5b2a99a186e6aaed2741e48120bbd6e6b04 | src/Stack/Options/SDistParser.hs | src/Stack/Options/SDistParser.hs | {-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.SDistParser where
import Options.Applicative
import Options.Applicative.Builder.Extra
import Stack.Prelude
import Stack.SDist
import Stack.Options.HpcReportParser (pvpBoundsOption)
-- | Parser for arguments to `s... | {-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.SDistParser where
import Options.Applicative
import Options.Applicative.Builder.Extra
import Stack.Prelude
import Stack.SDist
import Stack.Options.HpcReportParser (pvpBoundsOption)
-- | Parser for arguments to `s... | Fix behavior of --no-signature to turn signing off | Fix behavior of --no-signature to turn signing off
The --no-signature switch should enable signing rather than disable it;
consequently, the default for 'stack upload' should be to sign the package.
| Haskell | bsd-3-clause | juhp/stack,juhp/stack |
a50d17b3c2c8bfa6aa79975bdffb5a749aee910b | hspec-contrib/test/Test/Hspec/Contrib/HUnitSpec.hs | hspec-contrib/test/Test/Hspec/Contrib/HUnitSpec.hs | {-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.Hspec.Contrib.HUnitSpec (spec) where
import Helper
import Test.Hspec.Core.Spec
import Test.Hspec.Contrib.HUnit
import Test.HUnit
shouldYield :: Test -> [Tree () String] -> Expectation
a `shouldYield` b = map (bimapTree (const (... | {-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.Hspec.Contrib.HUnitSpec (spec) where
import Helper
import Test.Hspec.Core.Spec
import Test.Hspec.Contrib.HUnit
import Test.HUnit
shouldYield :: Test -> [Tree () String] -> Expectation
a `shouldYield` b = bimapForest (const ()) ... | Use bimapForest instead of bimapTree | refactoring: Use bimapForest instead of bimapTree
| Haskell | mit | hspec/hspec |
4af458573d20afec66a1ad70351c8a51bdf1264c | Build.hs | Build.hs | -- This file compiles all library and runtime code
-- into elm-runtime.js. Run it with following command:
--
-- runHaskell Build.hs
--
-- Note: This does NOT compile the compiler! Run `cabal install`
-- from the compiler/ directory to do that.
import System.Cmd
import System.Directory
import System.Exit
import Sy... | -- This file compiles all library and runtime code
-- into elm-runtime.js. Run it with following command:
--
-- runHaskell Build.hs
--
-- Note: This does NOT compile the compiler! Run `cabal install`
-- from the compiler/ directory to do that.
import System.Cmd
import System.Directory
import System.Exit
import Sy... | Add success message that makes it clearer that the compiler is built separately. | Add success message that makes it clearer that the compiler is built separately.
| Haskell | bsd-3-clause | JoeyEremondi/elm-pattern-effects,deadfoxygrandpa/Elm,laszlopandy/elm-compiler,pairyo/elm-compiler,mgold/Elm,5outh/Elm,Axure/elm-compiler |
37a8e717011ab500e8668f58fcd9da5e2c193e3f | src/Text/Greek/Mounce/Quote.hs | src/Text/Greek/Mounce/Quote.hs | module Text.Greek.Mounce.Quote where
import Control.Exception (throwIO)
import Data.Data
import Language.Haskell.TH
import Language.Haskell.TH.Quote
import Text.Parsec.Pos (newPos)
import Text.ParserCombinators.Parsec
import Text.Greek.Mounce.Parse
location' :: Q SourcePos
location' = aux <$> location
where
aux... | module Text.Greek.Mounce.Quote where
import Control.Exception (throwIO)
import Data.Data
import Language.Haskell.TH
import Language.Haskell.TH.Quote
import Text.Parsec.Pos (newPos)
import Text.ParserCombinators.Parsec
import Text.Greek.Mounce.Parse
location' :: Q SourcePos
location' = aux <$> location
where
aux... | Use Q monad fail for failure instead of throwing an exception. | Use Q monad fail for failure instead of throwing an exception.
I copied the throwing code from an example online but I was never happy with that approach. Calling fail (instead of throwing) generates less noise in the output when there's a parser error.
| Haskell | mit | scott-fleischman/greek-grammar,scott-fleischman/greek-grammar |
7c3bca9ff37a8169ac42f4fb6bf96536b6f07163 | src/Language/JavaScript/Parser.hs | src/Language/JavaScript/Parser.hs | module Language.JavaScript.Parser
(
PA.parse
, PA.readJs
, PA.parseFile
, PA.showStripped
, PA.showStrippedMaybe
-- * AST elements
, JSNode (..)
, JSAnnot (..)
, JSBinOp (..)
, JSUnaryOp (..)
, JSLParen (..)
, JSRParen (..)
... | module Language.JavaScript.Parser
(
PA.parse
, PA.readJs
, PA.parseFile
, PA.showStripped
, PA.showStrippedMaybe
-- * AST elements
, JSNode (..)
, JSAnnot (..)
, JSBinOp (..)
, JSBlock (..)
, JSUnaryOp (..)
, JSSemi (..)
... | Update exports so the installed package is usable. | Update exports so the installed package is usable.
| Haskell | bsd-3-clause | alanz/language-javascript,alanz/language-javascript |
76b97c50165f9d37652ca56b661a9bc5a2143eac | euler002/euler002.hs | euler002/euler002.hs | maxCount :: Int
maxCount = 4000000
fibs :: (Integral a) => [a]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
euler002 :: Int
euler002 = sum (filter odd (takeWhile (<maxCount) fibs))
main :: IO ()
main = do putStrLn (show euler002)
| maxCount :: Int
maxCount = 4000000
fibs :: (Integral a) => [a]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
euler002 :: Int
euler002 = sum $ filter even $ takeWhile (<maxCount) fibs
main :: IO ()
main = do putStrLn (show euler002)
| Use function application instead of parentheses | Use function application instead of parentheses
| Haskell | mit | marknsikora/euler |
604fc2566116d249be7bc98f557c59c8176e99d4 | src/Main.hs | src/Main.hs | import System.Environment
import Parser
import Eval
import Expr
main :: IO ()
main = getArgs >>= handleArgs . getFirst
where getFirst args = if null args then "" else head args
handleArgs args = case args of
"--ast" -> putAst
_ -> putExpr
-- Pars... | import System.Environment
import Parser
import Eval
import Expr
main :: IO ()
main = getArgs >>= handleArgs . getFirst
where getFirst args = if null args then "" else head args
handleArgs args = case args of
"--ast" -> putAst
_ -> putExpr
-- Pars... | Modify `printList` to be more readable | Modify `printList` to be more readable
| Haskell | mit | apollo-lang/apollo |
f6024d99f30b3e2cfcf2f662feb12b4712d01da9 | src/AST/Helpers.hs | src/AST/Helpers.hs | {-# OPTIONS_GHC -Wall #-}
module AST.Helpers where
import qualified Data.Char as Char
splitDots :: String -> [String]
splitDots = go []
where
go vars str =
case break (=='.') str of
(x,_:rest) | isOp x -> vars ++ [x ++ '.' : rest]
| otherwise -> go (vars ++ [x]) rest
... | {-# OPTIONS_GHC -Wall #-}
module AST.Helpers where
import qualified Data.Char as Char
splitDots :: String -> [String]
splitDots variable =
go [] variable
where
go vars str =
case break (=='.') str of
(x,_:rest) | isOp x -> vars ++ [x ++ '.' : rest]
| otherwise -> go (v... | Improve style, remove unused brkt function | Improve style, remove unused brkt function
| Haskell | bsd-3-clause | 5outh/Elm,Axure/elm-compiler,mgold/Elm,pairyo/elm-compiler,JoeyEremondi/elm-pattern-effects,laszlopandy/elm-compiler |
612cd0e955439c1b47b939e15f682baeabdbd971 | Data/Vinyl/Unicode.hs | Data/Vinyl/Unicode.hs | {-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ConstraintKinds #-}
module Data.Vinyl.Unicode where
import Data.Vinyl.Relation
import Data.Vinyl.Proofs
type x ∈ xs = IElem x xs
type xs ⊆ ys = Implicit (Subset xs ys)
type r1 ≅ r2 = r1 :~: r2
| {-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ConstraintKinds #-}
module Data.Vinyl.Unicode where
import Data.Vinyl.Relation
import Data.Vinyl.Proofs
type x ∈ xs = IElem x xs
type xs ⊆ ys = ISubset xs ys
type r1 ≅ r2 = r1 :~: r2
| Use (ISubset xs ys) instead of (Implicit (Subset xs ys)) | Use (ISubset xs ys) instead of (Implicit (Subset xs ys))
| Haskell | mit | plow-technologies/Vinyl,VinylRecords/Vinyl |
23dc99dbc62737b042a00ef05ca5ff0e31bd9865 | src/Text/Greek/Grammar.hs | src/Text/Greek/Grammar.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Text.Greek.Grammar where
import Control.Lens (makeLenses)
import Data.Text (Text)
data Source = Source
{ _author :: Text
, _title :: Text
, _year :: Int
}
makeLenses ''Source
data Part =
Section Text
... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Text.Greek.Grammar where
import Control.Lens (makeLenses)
import Data.Text (Text)
data Source = Source
{ _author :: Text
, _title :: Text
, _year :: Int
}
makeLenses ''Source
data Part =
Section Text
... | Add a couple extra grammar sources. | Add a couple extra grammar sources.
| Haskell | mit | scott-fleischman/greek-grammar,scott-fleischman/greek-grammar |
004210e31f069c043dd4fabd7021100ec7ea8a2c | tests/examples/TemplateHaskell.hs | tests/examples/TemplateHaskell.hs | {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
foo = $footemplate
makeSplices ''Foo
old = $(old)
bar = $$bartemplate
bar = [e| quasi |]
bar = [| quasi |]
baz = [quoter| quasi |]
[t| Map.Map T.Text $tc |]
{-# ANN module $([| 1 :: Int |]) #-}
foo = [t| HT.HashTable $(varT s) Int
... | {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
foo = $footemplate
makeSplices ''Foo
old = $(old)
bar = $$bartemplate
bar = [e| quasi |]
bar = [| quasi |]
baz = [quoter| quasi |]
[t| Map.Map T.Text $tc |]
{-# ANN module $([| 1 :: Int |]) #-}
foo = [t| HT.HashTable $(varT s) Int
... | Update test to show error with [e|| becoming [|| | Update test to show error with [e|| becoming [||
| Haskell | bsd-3-clause | alanz/ghc-exactprint,mpickering/ghc-exactprint |
015a8e5250413e43e1ae5182c72c3551d39a569f | src/Sodium/Nucleus/Vector/Sanity.hs | src/Sodium/Nucleus/Vector/Sanity.hs | {-# LANGUAGE FlexibleContexts #-}
module Sodium.Nucleus.Vector.Sanity where
import Sodium.Prelude
import Sodium.Nucleus.Vector.Program
sanity_nameUniqueness :: Program -> Bool
sanity_nameUniqueness program
= (\xs -> xs == nub xs) . execWriter
-- TODO: take function names into account (itraverse?)
$ (progr... | {-# LANGUAGE FlexibleContexts #-}
module Sodium.Nucleus.Vector.Sanity where
import Sodium.Prelude
import Sodium.Nucleus.Vector.Program
sanity_nameUniqueness :: Program -> Bool
sanity_nameUniqueness program
= liftA2 (==) nub id . execWriter
$ itraverse fnsnu (view programFuncs program)
type W m = (Applicative... | Check function names for name uniqueness | Check function names for name uniqueness
| Haskell | bsd-3-clause | rscprof/kalium |
27aa611d6fff37a70efb8195fcc64088f32802f7 | src/Handler/Command.hs | src/Handler/Command.hs | module Handler.Command
( postCommandsR
, putCommandR
, getCommandR
)
where
import Import hiding (Request)
data Request = Request
{ reqRunning :: Bool
, reqDescription :: Maybe Text
}
instance FromJSON Request where
parseJSON = withObject "Command.Request" $ \o -> Request
<... | module Handler.Command
( postCommandsR
, putCommandR
, getCommandR
)
where
import Import hiding (Request)
data Request = Request
{ reqRunning :: Bool
, reqDescription :: Maybe Text
}
instance FromJSON Request where
parseJSON = withObject "Command.Request" $ \o -> Request
<... | Return multiple representations from /command | Return multiple representations from /command
- POST -> Text or JSON
- GET -> JSON or HTML
| Haskell | mit | pbrisbin/tee-io,mrb/tee-io,mrb/tee-io,pbrisbin/tee-io,wfleming/tee-io |
41012a15425246ad5d4e09cf32bcfd0a9e2e1158 | src/Web/Offset/HTTP.hs | src/Web/Offset/HTTP.hs | {-# LANGUAGE OverloadedStrings #-}
module Web.Offset.HTTP where
import Control.Lens
import Data.Monoid
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.Lazy as TL
import q... | {-# LANGUAGE OverloadedStrings #-}
module Web.Offset.HTTP where
import Control.Lens
import Data.Monoid
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.Lazy as TL
import q... | Upgrade wreq, checkStatus to checkResponse | Upgrade wreq, checkStatus to checkResponse
| Haskell | bsd-3-clause | dbp/offset,dbp/offset,positiondev/offset,positiondev/offset,dbp/snaplet-wordpress,dbp/snaplet-wordpress,dbp/offset,dbp/snaplet-wordpress,dbp/offset,dbp/snaplet-wordpress,positiondev/offset |
e33282b149be786b099cd2263c32756d61e19b9c | test/testserver/Main.hs | test/testserver/Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent
import Snap.Iteratee
import Snap.Types
import Snap.Http.Server
import Snap.Util.FileServe
{-
/pong
/fileserve
/echo
pipelined POST requests
slowloris attack / timeout test
-}
pongHandle... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Main where
import Control.Concurrent
import Snap.Iteratee hiding (Enumerator)
import Snap.Types
import Snap.Http.Server
import Snap.Util.FileServe
{-
/pong
/fileserve
/echo
pipelined POST request... | Add code to echo response body to the testserver | Add code to echo response body to the testserver
| Haskell | bsd-3-clause | beni55/snap-server,sopvop/snap-server,23Skidoo/snap-server,23Skidoo/snap-server,snapframework/snap-server,sopvop/snap-server,23Skidoo/snap-server,janrain/snap-server,janrain/snap-server,k-bx/snap-server,sol/snap-server,beni55/snap-server,snapframework/snap-server,k-bx/snap-server,beni55/snap-server,snapframework/snap-s... |
a351e510e73814c5c639bdc1997bb0fd089a8b2f | src/Shape.hs | src/Shape.hs | module Shape
( Polygon(..)
, Rect(..)
) where
import qualified Data.Vector as V
-- Point (x, y)
newtype Point =
Point (Int, Int)
newtype Edge =
Edge (Point, Point)
data EdgeBucket = EdgeBucket
{ edge :: Edge
, slope :: (Int -> Int)
}
type Edges = V.Vector Edge
class Polygon p where
vertices :: p... | module Shape
( Polygon(..)
, Rect(..)
, Edge
) where
import qualified Data.Vector as V
-- Point (x, y)
newtype Point =
Point (Int, Int)
newtype Edge =
Edge (Point, Point)
data ScanEdge = ScanEdge
{ low :: Int
, high :: Int
, x :: Double
, deltaX :: Double
, deltaY :: Double
}
scanEdge :: Ed... | Create scan edge type for scan lining polies. | Create scan edge type for scan lining polies.
| Haskell | mit | turnage/valora |
bad27b12c288af9c9ac38e28dea354413b78415f | test/Main.hs | test/Main.hs | module Main where
import Hasql.TH.Prelude
import Hedgehog
import Hedgehog.Main
import qualified Main.Gen as Gen
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified Hasql.TH.Syntax.Ast as Ast
import qualified Hasql.TH.Syntax.Parsing as Parsing
import qualified Hasql.TH.Syntax.... | module Main where
import Hasql.TH.Prelude
import Hedgehog
import Hedgehog.Main
import qualified Main.Gen as Gen
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified Hasql.TH.Syntax.Ast as Ast
import qualified Hasql.TH.Syntax.Parsing as Parsing
import qualified Hasql.TH.Syntax.... | Reduce the amount of simulations to 100 000 | Reduce the amount of simulations to 100 000
| Haskell | mit | nikita-volkov/hasql-th |
97878d9883ad6f489fb2d0883bd6de522abfd0d9 | webkit/GHCJS/DOM/EventTargetClosures.hs | webkit/GHCJS/DOM/EventTargetClosures.hs | {-# LANGUAGE CPP #-}
module GHCJS.DOM.EventTargetClosures
(eventTargetAddEventListener) where
import GHCJS.DOM.Types
eventTargetAddEventListener ::
(GObjectClass self, IsEvent event) =>
self -> String -> Bool -> (self -> event -> IO ()) -> IO Bool
eventTarget... | module GHCJS.DOM.Events (
module Graphics.UI.Gtk.WebKit.DOM.EventTargetClosures
) where
import Graphics.UI.Gtk.WebKit.DOM.EventTargetClosures | Fix missing ConstraintKinds on EventTargetClosure.hs error | Fix missing ConstraintKinds on EventTargetClosure.hs error
| Haskell | mit | manyoo/ghcjs-dom,plow-technologies/ghcjs-dom,manyoo/ghcjs-dom,plow-technologies/ghcjs-dom |
f53f218ce6a349ffad8934fa69d47315eaebb9b7 | parser-typechecker/unison/Version.hs | parser-typechecker/unison/Version.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Version where
import Language.Haskell.TH (runIO)
import Language.Haskell.TH.Syntax (Exp(LitE), Lit(StringL))
import Shellmet
import Data.Text
gitDescribe :: String
gitDescribe = $( fmap (LitE . StringL . unpack) . runIO $
"git" $| ["describ... | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Version where
import Language.Haskell.TH (runIO)
import Language.Haskell.TH.Syntax (Exp(LitE), Lit(StringL))
import Shellmet
import Data.Text
gitDescribe :: String
gitDescribe = $( fmap (LitE . StringL . unpack) . runIO $ do
-- Outputs date... | Include date in version command | Include date in version command
| Haskell | mit | unisonweb/platform,unisonweb/platform,unisonweb/platform |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.