code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Napm.Types( Domain(..) , PasswordLength(..) , Passphrase(..) , ContextMap ) where import Control.Applicative import Data.Map (Map) import Data.Text (Text) import qualified Data.Text as T import Test.QuickCheck -- ...
fractalcat/napm
lib/Napm/Types.hs
Haskell
mit
1,750
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title>Passive Scan Rules - Beta | ZAP Extension</title> <maps> <homeID>top</homeID...
veggiespam/zap-extensions
addOns/pscanrulesBeta/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesBeta/resources/help_ru_RU/helpset_ru_RU.hs
Haskell
apache-2.0
998
#!/usr/bin/env runhaskell {-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} {-# OPTIONS -Wall #-} import Data.Dynamic import Data.Tensor.TypeLevel import qualified Data.Text.IO as T import Language.Paraiso.Annotation (Annotation) import Language.Paraiso.Generator (generateIO...
drmaruyama/Paraiso
examples-old/LinearWave/Convergence.hs
Haskell
bsd-3-clause
2,761
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {- | Module : Verifier.SAW.Prelude Copyright : Galois, Inc. 2012-2015 License : BSD3 Maintainer : jhendrix@galois.com Stability : experimental Portability : non-portable (language extensions) -} module Verifier.SAW....
GaloisInc/saw-script
saw-core/src/Verifier/SAW/Prelude.hs
Haskell
bsd-3-clause
4,624
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[HsLit]{Abstract syntax: source-language literals} -} {-# LANGUAGE CPP, DeriveDataTypeable #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUA...
sgillespie/ghc
compiler/hsSyn/HsLit.hs
Haskell
bsd-3-clause
8,103
-- | Spawn subprocesses and interact with them using "Pipes" -- -- The interface in this module deliberately resembles the interface -- in "System.Process". However, one consequence of this is that you -- will not want to have unqualified names from this module and from -- "System.Process" in scope at the same time. -...
massysett/pipes-cliff
pipes-cliff/lib/Pipes/Cliff.hs
Haskell
bsd-3-clause
7,997
module Reinforce.Agents ( runLearner , clockEpisodes , clockSteps ) where import Control.Monad import Control.Monad.IO.Class import Control.MonadEnv import qualified Control.MonadEnv as Env (reset) runLearner :: MonadEnv m o a r => MonadIO m => Maybe Integer -> Maybe Integer -> (Maybe Integer -> o -...
stites/reinforce
reinforce-algorithms/src/Reinforce/Agents.hs
Haskell
bsd-3-clause
1,073
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Lens.Internal -- Copyright : (C) 2012-16 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -...
ddssff/lens
src/Control/Lens/Internal.hs
Haskell
bsd-3-clause
1,676
{-# LANGUAGE OverloadedStrings #-} module Yesod.Form.I18n.English where import Yesod.Form.Types (FormMessage (..)) import Data.Monoid (mappend) import Data.Text (Text) englishFormMessage :: FormMessage -> Text englishFormMessage (MsgInvalidInteger t) = "Invalid integer: " `Data.Monoid.mappend` t englishFormMessage (M...
s9gf4ult/yesod
yesod-form/Yesod/Form/I18n/English.hs
Haskell
mit
1,469
module RefacGenCache where import TypeCheck import PrettyPrint import PosSyntax import AbstractIO import Data.Maybe import TypedIds import UniqueNames hiding (srcLoc) import PNT import TiPNT import Data.List import RefacUtils hiding (getParams) import PFE0 (findFile, allFiles, allModules) import MUtils (( # )) import ...
kmate/HaRe
old/refactorer/RefacGenCache.hs
Haskell
bsd-3-clause
1,783
{-# NOINLINE f #-} f :: Int -> Int f = {-# SCC f #-} g {-# NOINLINE g #-} g :: Int -> Int g x = {-# SCC g #-} x + 1 main = {-# SCC main #-} return $! f 3
urbanslug/ghc
testsuite/tests/profiling/should_run/scc004.hs
Haskell
bsd-3-clause
157
-- #hide, prune, ignore-exports -- |Module description module A where
siddhanathan/ghc
testsuite/tests/haddock/should_compile_noflag_haddock/haddockC016.hs
Haskell
bsd-3-clause
71
------------------------------------------------------------ -- Card ! Made by Mega Chan ! ------------------------------------------------------------ card_valid :: String -> Bool card_valid str = if ((card_value str) `mod` 10 == 0) then True else False card_value :: String -> Int card_value str = (add_even (map mu...
MegaShow/college-programming
Homework/Haskell Function Programming/card.hs
Haskell
mit
5,136
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Robot ( Bearing ( East , North , South , West ) , bearing , coordinates , mkRobot , m...
exercism/xhaskell
exercises/practice/robot-simulator/test/Tests.hs
Haskell
mit
3,120
{-# LANGUAGE NoImplicitPrelude #-} module Typeclasses where import Prelude (not, Bool(..)) data Animal = Dog | Cat class EqClass t where equal :: t -> t -> Bool neq :: t -> t -> Bool neq a b = not (equal a b) instance EqClass Animal where equal Dog Dog = True equal Cat Cat = True equal _ _ = False ...
riwsky/wiwinwlh
src/dictionaries.hs
Haskell
mit
661
module Euler.E54 where import Data.List (sort, nub) import Data.Maybe import Euler.Lib (rotations) data Rank = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King | Ace deriving (Eq, Ord, Show, Enum) data Suit = Hearts | Spades | Diamonds | Clubs deriving (Eq, Ord, Show) data Card =...
D4r1/project-euler
Euler/E54.hs
Haskell
mit
5,208
{-# LANGUAGE MagicHash, UnboxedTuples, Rank2Types, BangPatterns, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-full-laziness -fno-warn-name-shadowing #-} module Data.TrieVector.ArrayArray ( A.run , A.sizeof , A.thaw , A.unsafeThaw , A.write , ptrEq , update , modify , noCopyModify...
AndrasKovacs/trie-vector
Data/TrieVector/ArrayArray.hs
Haskell
mit
5,418
{-# LANGUAGE TupleSections #-} module Data.Tuple.Extra where import Data.Tuple (uncurry) import Data.Functor uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d uncurry3 f (x,y,z) = f x y z uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e uncurry4 f (w,x,y,z) = f w x y z uncurry5 :: (a -> b -> c -> d -> e -> f...
circuithub/circuithub-prelude
Data/Tuple/Extra.hs
Haskell
mit
1,223
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module YesodCoreTest.CleanPath (cleanPathTest, Widget) where import Test.Hspec import Yesod.Core hiding (Request) import Network.Wai import Network.Wai.Test import ...
piyush-kurur/yesod
yesod-core/test/YesodCoreTest/CleanPath.hs
Haskell
mit
4,465
module Main where import qualified Labyrinth.Helpers import qualified Labyrinth.Models import qualified Labyrinth.Game import qualified Labyrinth.Factory import qualified Labyrinth.Board import qualified Labyrinth.Parser import qualified Data.List import qualified System.Random import qualified System.Environment cre...
amoerie/labyrinth
Main.hs
Haskell
mit
1,335
module Y2016.M12.D26.Exercise where import Data.Array import Data.Map (Map) -- below imports available via 1HaskellADay git repository import Data.SAIPE.USCounties import Graph.KMeans import Graph.ScoreCard import Graph.ScoreCard.Clusters import Y2016.M12.D15.Exercise import Y2016.M12.D21.Exercise {-- Good mornin...
geophf/1HaskellADay
exercises/HAD/Y2016/M12/D26/Exercise.hs
Haskell
mit
3,973
module Main where import Test.Tasty (defaultMain,testGroup,TestTree) import AlgorithmsAtHandHaskell.Swallow.Test import AlgorithmsAtHandHaskell.Coconut.Test main :: IO () main = defaultMain tests tests :: TestTree tests = testGroup "All Tests" [ swallowSuite , coconutSuite ]
antonlogvinenko/algorithms-at-hand
algorithms-at-hand-haskell/test/Test.hs
Haskell
mit
316
{-# LANGUAGE NoMonomorphismRestriction #-} import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine h = hexagon 1 # fc lightgreen sOrigin = showOrigin' (with & oScale .~ 0.04) diagram :: Diagram B diagram = h # snugBL # sOrigin main = mainWith $ frame 0.1 diagram
jeffreyrosenbluth/NYC-meetup
meetup/SnugBL.hs
Haskell
mit
292
module Chapter05.Sing where fstString :: [Char] -> [Char] fstString x = x ++ " in the rain" sndString :: [Char] -> [Char] sndString x = x ++ " over the rainbow" sing :: Ord a => a -> a -> [Char] sing x y = if (x > y) then fstString "Signin" else sndString "Somewhere"
brodyberg/LearnHaskell
HaskellProgramming.hsproj/Chapter05/Sing.hs
Haskell
mit
300
module Heuristics where import Data.Array import Data.List import NPuzzle manhattan :: NPuzzle.Grid -> NPuzzle.Grid -> Int manhattan end start = sum $ map go (indices start) where manhattan' (gx, gy) (cx, cy) = abs (gx - cx) + abs (gy - cy) go i = manhattan' (end!i) (start!i)
Shakadak/n-puzzle
Heuristics.hs
Haskell
mit
298
module FileTools ( find, ls, cat ) where import System.Directory import System.IO.Error import qualified Data.ByteString.Lazy.Char8 as B cat :: FilePath -> IO B.ByteString cat file = catchIOError (B.readFile file) (\e -> return $ B.pack []) ls :: String -> IO [FilePath] ls dir = getDirectoryContents dir >>= return ...
ryuichiueda/UspMagazineHaskell
Study1_Q3/FileTools.hs
Haskell
mit
653
module GitStatus where import GitWorkflow type GitStatus = (Char, Char, String, Maybe String) pathStatuses :: IO (Either String [GitStatus]) pathStatuses = do r <- runGitProcess ["status", "-s"] case r of Left err -> return (Left err) Right ss -> return $Right $map readStatus $lines ss where readStatu...
yamamotoj/alfred-git-workflow
src/GitStatus.hs
Haskell
mit
711
module Lib where import Data.List as List import Data.List.Split import Data.Map.Strict as Map data BinSize = Small | Large deriving Show data ShelfDifficulty = Normal | Level3 | Level4 deriving Show data Bin = Bin { warehouse :: String, room :: String, bay :: String, ...
NashFP/pick-and-grin
mark_wutka+hakan+kate+haskell/src/Lib.hs
Haskell
mit
1,261
{-# LANGUAGE OverloadedStrings #-} {-| Module : Utils.NuxmvCode Description : Utilities for producing nuXmv code Copyright : (c) Tessa Belder 2015-2016 This module contains useful functions for producing nuXmv code. -} module Utils.NuxmvCode where import Data.List (intersperse) import Utils.Concatable as C ...
julienschmaltz/madl
src/Utils/NuxmvCode.hs
Haskell
mit
7,873
module Network.Mosquitto ( -- * Data structure Mosquitto , Event(..) -- * Mosquitto , initializeMosquittoLib , cleanupMosquittoLib , newMosquitto , destroyMosquitto , setWill , clearWill , connect , disconnect , getNextEvents , subscribe , publish -- * H...
uwitty/mosquitto
src/Network/Mosquitto.hs
Haskell
mit
9,202
-- Get the difference between the sum of squares and the square of sum for the numbers between 1 and 100 main = print getProblem6Value getProblem6Value :: Integer getProblem6Value = getSquareOfSumMinusSumOfSquares [1..100] getSquareOfSumMinusSumOfSquares :: [Integer] -> Integer getSquareOfSumMinusSumOfSquares nums =...
jchitel/ProjectEuler.hs
Problems/Problem0006.hs
Haskell
mit
529
module Data.NameSupply ( NameSupply (..), mkNameSupply, getFreshName , NS, runNS , newName, findName, withName ) where import Common import Control.Monad.Reader import Control.Monad.State import qualified Data.Map as M import qualified Data.Set as S newtype NameSupply = NameSupply { getNames :: [Name] } mkNameSuppl...
meimisaki/Rin
src/Data/NameSupply.hs
Haskell
mit
1,119
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-} module EC.ES where import qualified Control.Monad.Primitive as Prim --import qualified System.Random.MWC as MWC import System.Random.MWC import Control.Monad.ST import Control.Monad import Control.Monad.State newtype S s a = S { runS :: S...
banacorn/evolutionary-computation
EC/es.hs
Haskell
mit
705
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module HepMC.Parse ( module X , tuple, vector, eol , hmcvers, hmcend , xyzt ) where import Control.Applicative as X (many, (<|>)) import Control.Applicative (liftA2) import C...
cspollard/HHepMC
src/HepMC/Parse.hs
Haskell
apache-2.0
1,380
{-# language CPP #-} -- No documentation found for Chapter "ViewStateFlagBits" module OpenXR.Core10.Enums.ViewStateFlagBits ( ViewStateFlags , ViewStateFlagBits( VIEW_STATE_ORIENTATION_VALID_BIT , VIEW_STATE_...
expipiplus1/vulkan
openxr/src/OpenXR/Core10/Enums/ViewStateFlagBits.hs
Haskell
bsd-3-clause
3,054
-- -- @file -- -- @brief Normalizes RegexTypes -- -- Normalizes a RegexType by applying commutativity of intersection. -- -- @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -- {-# LANGUAGE LambdaCase #-} module Elektra.Normalize (normalize) where import Control.Monad (foldM) import Data.Maybe ...
e1528532/libelektra
src/libs/typesystem/specelektra/Elektra/Normalize.hs
Haskell
bsd-3-clause
2,296
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-} module Youtube.Channel ( getChannelId ) where import Network.Wreq import Control.Lens import GHC.Generics import Data.Aeson import Data.Maybe import Prelude hiding (id) import qualified Data.Text as T data ChannelItem = ChannelItem { id :: String } derivi...
kelvinlouis/spotell
src/Youtube/Channel.hs
Haskell
bsd-3-clause
1,082
module Utils ( isqrt , numFactors , dataFile ) where import Paths_project_euler isqrt :: Integral i => i -> i isqrt = floor . sqrt . fromIntegral numFactors :: Int -> Int numFactors x = let top = isqrt x nonSquareFactors = [i | i <- [1 .. top], i < top, x `mod` i == 0] addSquareFactor y = ...
anup-2s/project-euler
src/Utils.hs
Haskell
bsd-3-clause
572
{-# LANGUAGE Arrows #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TypeOperators #-} module Spanout.Gameplay (game) where import Prelude hiding (id, (.)) import Spanout.Common import Spanout.Graphics import Spanout.Level import qualified Spanout.Wire as Wire import Control.Applicative import Control.Arrow import Cont...
vtan/spanout
src/Spanout/Gameplay.hs
Haskell
bsd-3-clause
6,047
{-# OPTIONS_GHC -fno-warn-orphans -fsimpl-tick-factor=500 #-} module Macro.PkgCereal where import Macro.Types import Data.Serialize as Cereal import Data.ByteString.Lazy as BS serialise :: [GenericPackageDescription] -> BS.ByteString serialise pkgs = Cereal.encodeLazy pkgs deserialise :: BS.ByteString -> [GenericPac...
arianvp/binary-serialise-cbor
bench/Macro/PkgCereal.hs
Haskell
bsd-3-clause
1,759
module Data.SequentialIndex.Open ( SequentialIndex , mantissa , exponent , sequentialIndex , tryFromBools , toClosed , fromClosed , root , leftChild , rightChild , parent , prefixBits , toByteString , fromByteString ) where import Control.Monad import Data.Bits import Data.Maybe import ...
aristidb/sequential-index
Data/SequentialIndex/Open.hs
Haskell
bsd-3-clause
2,111
module Data.Vhd.Bitmap ( Bitmap (..) , bitmapGet , bitmapSet , bitmapSetRange , bitmapClear ) where import Data.Bits import Data.Word import Foreign.Ptr import Foreign.Storable data Bitmap = Bitmap (Ptr Word8) bitmapGet :: Bitmap -> Int -> IO Bool bitmapGet (Bitmap ptr) n = test `fmap` peekByteOff ptr offset ...
jonathanknowles/hs-vhd
Data/Vhd/Bitmap.hs
Haskell
bsd-3-clause
1,000
module Main where import Test.Framework (defaultMain, testGroup) import qualified Tests.Database.Cassandra.CQL.Protocol as Protocol import qualified Tests.Database.Cassandra.CQL.Protocol.Properties as Properties main :: IO () main = defaultMain tests where tests = [ testGroup "Tests.Database.Cassandra.C...
romanb/cassandra-cql-protocol
test/TestSuite.hs
Haskell
bsd-3-clause
446
-- | Checks for a `Square` being attacked by one of the players. -- -- https://chessprogramming.wikispaces.com/Square+Attacked+By module Chess.Board.Attacks ( isAttacked , attackedFromBB , inCheck , inCheckWithNoFriendly ) where import Data.Monoid import Chess.Board.Board import Che...
phaul/chess
Chess/Board/Attacks.hs
Haskell
bsd-3-clause
3,121
module Control.ConstraintClasses.KeyZip ( -- * Constraint KeyZip CKeyZip (..) ) where import Control.ConstraintClasses.Domain import Control.ConstraintClasses.Key import Control.ConstraintClasses.KeyFunctor import Control.ConstraintClasses.Zip import Data.Key -- base import Data.Functor.Product import Data...
guaraqe/constraint-classes
src/Control/ConstraintClasses/KeyZip.hs
Haskell
bsd-3-clause
1,293
module Drones where import qualified Test.HUnit as H import NPNTool.PetriNet import NPNTool.PTConstr import NPNTool.NPNConstr (arcExpr, liftPTC, liftElemNet, addElemNet, NPNConstrM) import qualified NPNTool.NPNConstr as NPC import NPNTool.Graphviz import NPNTool.Bisimilarity import NPNTool.Liveness import NPNTool.Alph...
co-dan/NPNTool
tests/Drones.hs
Haskell
bsd-3-clause
3,560
-- | The code that powers the searchbox. module Guide.Search ( SearchResult(..), search, ) where import Imports -- Text import qualified Data.Text.All as T -- Sets import qualified Data.Set as S import Guide.Types import Guide.State import Guide.Markdown -- | A search result. data SearchResult -- | Category...
aelve/hslibs
src/Guide/Search.hs
Haskell
bsd-3-clause
2,257
{- (c) The University of Glasgow, 2006 \section[HscTypes]{Types for the per-module compiler} -} {-# LANGUAGE CPP, ScopedTypeVariables #-} -- | Types for the per-module compiler module HscTypes ( -- * compilation state HscEnv(..), hscEPS, FinderCache, FindResult(..), Target(..), Target...
vikraman/ghc
compiler/main/HscTypes.hs
Haskell
bsd-3-clause
119,276
module Module2.Task4 where doItYourself = f . g . h f = logBase 2 g = (^ 3) h = max 42
dstarcev/stepic-haskell
src/Module2/Task4.hs
Haskell
bsd-3-clause
91
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} module Database.Relational.Schema.OracleDataDictionary.ConsColumns where import Data.Int (Int32) import Database.Record.TH (derivingShow) import Database.Relational.Query.TH (defineTableTypesAndRecordDefault) $(defineTableTypesAndRecordDefault ...
amutake/haskell-relational-record-driver-oracle
src/Database/Relational/Schema/OracleDataDictionary/ConsColumns.hs
Haskell
bsd-3-clause
1,052
module Import.NoFoundation ( module Import ) where import ClassyPrelude.Yesod as Import import Control.Concurrent.STM.TBMQueue as Import import Lens as Import import Model as Import import RPC as Import import Settings...
konn/leport
leport-web/Import/NoFoundation.hs
Haskell
bsd-3-clause
611
module OIS ( module OIS.OISEvents , module OIS.OISFactoryCreator , module OIS.OISInputManager , module OIS.OISInterface , module OIS.OISJoyStick , module OIS.OISKeyboard , module OIS.OISMouse , module OIS.OISMultiTouch , module OIS....
ghorn/hois
OIS.hs
Haskell
bsd-3-clause
620
{-# LANGUAGE PackageImports #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANG...
kcsongor/generic-lens
generic-lens/src/Data/Generics/Product/Any.hs
Haskell
bsd-3-clause
2,226
----------------------------------------------------------------------------- -- | -- Copyright : (C) 2015 Dimitri Sabadie -- License : BSD3 -- -- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com> -- Stability : experimental -- Portability : portable -----------------------------------------------------...
apriori/luminance
src/Graphics/Luminance/Tuple.hs
Haskell
bsd-3-clause
988
{-# LANGUAGE CPP, OverloadedStrings #-} -- | Serve static files, subject to a policy that can filter or -- modify incoming URIs. The flow is: -- -- incoming request URI ==> policies ==> exists? ==> respond -- -- If any of the polices fail, or the file doesn't -- exist, then the middleware gives up and calls the...
Shimuuar/wai-middleware-static
Network/Wai/Middleware/Static.hs
Haskell
bsd-3-clause
14,041
module JFP.Threads where import Control.Concurrent import Control.Concurrent.STM import Control.Monad -- | Makes asynchronous message handler for handling hard tasks. Messages sent -- while handling previous message are dropped except last one. Last message is -- always handled. makeSequencer :: (a -> IO ()) -> I...
s9gf4ult/jfprrd
src/JFP/Threads.hs
Haskell
bsd-3-clause
640
{-# LANGUAGE QuasiQuotes #-} module Text.Parakeet ( parakeet , templateTeX , templateHTML , OutputFormat (..) , module Parakeet.Types.Options ) where import Control.Monad.Parakeet (runParakeet, SomeException) import Data.Text.Lazy (unpack) import Text.QuasiEmbedFile (rfile) import Parakeet.Parser.Parser (parse) im...
foreverbell/parakeet
src/Text/Parakeet.hs
Haskell
mit
846
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns#-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUA...
tolysz/yesod
yesod-core/test/RouteSpec.hs
Haskell
mit
12,733
-- -- -- ------------------ -- Exercise 11.32. ------------------ -- -- -- module E'11'32 where -- Notes: -- -- - Use/See templates for proofs by structural induction. -- - Note: Re/-member/-think/-view the definitions of "++", "." and "foldr". -- --------------- -- 1. Proposition: -- --------------- -- -- f...
pascal-knodel/haskell-craft
_/links/E'11'32.hs
Haskell
mit
3,008
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module %PACKAGE%.%MODEL% ( module Export )where import %PACKAGE%.%MODE...
lambdacms/lambdacms
scaffold-extension/PACKAGE/MODEL.hs
Haskell
mit
649
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} module Database.Persist.Postgresql.Internal ( P(..) , PgInterval(..) , getGetter ) where import qualified Database.PostgreSQL.Simple as PG import qualified Database.PostgreSQL.Simple.FromField as PGFF import qualified Database.PostgreSQL...
paul-rouse/persistent
persistent-postgresql/Database/Persist/Postgresql/Internal.hs
Haskell
mit
11,983
import Data.Time.Calendar import Data.Time.Calendar.WeekDate ans = length [(y,m,d) | y <- [1901..2000], m <- [1..12], let (_, _, d) = toWeekDate $ fromGregorian y m 1, d == 7]
stefan-j/ProjectEuler
q19.hs
Haskell
mit
271
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Snap.Internal.Http.Server.Socket.Tests (tests) where ------------------------------------------------------------------------------ import Control.Applicative ((<$>)) import qu...
23Skidoo/snap-server
test/Snap/Internal/Http/Server/Socket/Tests.hs
Haskell
bsd-3-clause
6,678
module BootImport where data Foo = Foo Int
mpickering/ghc-exactprint
tests/examples/ghc710/BootImport.hs
Haskell
bsd-3-clause
44
module Propellor.Property.HostingProvider.CloudAtCost where import Propellor import qualified Propellor.Property.Hostname as Hostname import qualified Propellor.Property.File as File import qualified Propellor.Property.User as User -- Clean up a system as installed by cloudatcost.com decruft :: Property NoInfo decruf...
avengerpenguin/propellor
src/Propellor/Property/HostingProvider/CloudAtCost.hs
Haskell
bsd-2-clause
814
{- | The public face of Template Haskell For other documentation, refer to: <http://www.haskell.org/haskellwiki/Template_Haskell> -} module Language.Haskell.TH( -- * The monad and its operations Q, runQ, -- ** Administration: errors, locations and IO reportError, -...
vikraman/ghc
libraries/template-haskell/Language/Haskell/TH.hs
Haskell
bsd-3-clause
6,267
module Test14 where f = let x = 45 in (x, 45)
kmate/HaRe
old/testing/refacRedunDec/Test14AST.hs
Haskell
bsd-3-clause
47
{-# OPTIONS -fglasgow-exts #-} -- This code defines a default method with a highly dubious type, -- because 'v' is not mentioned, and there are no fundeps -- -- However, arguably the instance declaration should be accepted, -- beause it's equivalent to -- instance Baz Int Int where { foo x = x } -- which *does* typec...
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/uncat/tc199.hs
Haskell
mit
1,013
module Foo where {-@ type Range Lo Hi = {v:Int | Lo <= v && v < Hi} @-} {-@ bow :: Range 0 100 @-} bow :: Int bow = 12
mightymoose/liquidhaskell
tests/pos/tyExpr.hs
Haskell
bsd-3-clause
121
module OverD where -- Tests that we verify consistency of type families between -- transitive imports. import OverB import OverC
ezyang/ghc
testsuite/tests/indexed-types/should_fail/OverD.hs
Haskell
bsd-3-clause
129
{-# LANGUAGE TemplateHaskell, FlexibleInstances, ScopedTypeVariables, GADTs, RankNTypes, FlexibleContexts, TypeSynonymInstances, MultiParamTypeClasses, DeriveDataTypeable, PatternGuards, OverlappingInstances, UndecidableInstances, CPP #-} module T1735_Help.Xml (Element(..), Xml, ...
ezyang/ghc
testsuite/tests/typecheck/should_run/T1735_Help/Xml.hs
Haskell
bsd-3-clause
4,655
{-# LANGUAGE TemplateHaskell #-} module AFM where class Functor f where fmap :: (a -> b) -> f a -> f b fmap id x == x fmap f . fmap g == fmap (f . g) class Functor f => Applicative f where pure :: a -> f a (<*>) :: f (a -> b) -> f a -> f b -- LiftA fmap f x == liftA f x liftA id x == x liftA3 (.) f ...
mortum5/programming
haskell/usefull/AMP.hs
Haskell
mit
800
module Main () where import Data.List (elemIndex) type Header = String type Row a = [a] data Table a = Table { headers :: [Header] , rows :: [Row a] } create :: Table a -> Row a -> Table a create (Table headers rows) newRow = Table headers $ [newRow] ++ rows type Predicate...
bmuk/PipeDBHs
Main.hs
Haskell
mit
687
{-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------------------- -- | -- Module : Network.MQTT.Broker.RetainedMessages -- Copyright : (c) Lars Petersen 2016 -- License : MIT -- -- Maintainer : info@lars-petersen.net -- Stability : experimental ------...
lpeterse/haskell-mqtt
src/Network/MQTT/Broker/RetainedMessages.hs
Haskell
mit
4,172
module Main where import Parser import Control.Monad.Trans import System.Console.Haskeline process line = do let res = parseTopLevel line case res of Left err -> print err Right ex -> mapM_ print ex main = runInputT defaultSettings loop where loop = do minput <- getInputLine "ready> " ...
waterlink/hgo
ParserRepl.hs
Haskell
mit
432
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Control.Monad.Zipkin ( Identifier, parseIdentifier , TraceInfo(..), fromHeaders, toHeaders, newTraceInfo , TraceT, getTraceInfo, forkTraceInfo, runTraceT ) where import Control.Monad.State.Strict import System.Random.Mersenne.Pure64 import Data.Zipkin.Types ...
srijs/haskell-zipkin
src/Control/Monad/Zipkin.hs
Haskell
mit
851
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE RankNTypes #-} module Web.Stripe.Test.Subscription where import Data.Either import Data.Maybe import Test.Hspec import Web.Stripe.Test.Prelude import Web...
dmjio/stripe
stripe-tests/tests/Web/Stripe/Test/Subscription.hs
Haskell
mit
6,399
{-# LANGUAGE OverloadedStrings #-} -- we infect all the other modules with instances from -- this module, so they don't appear orphaned. {-# OPTIONS_GHC -fno-warn-orphans #-} module Network.Datadog.Internal ( prependMaybe , prependBool , datadogHttp , decodeDatadog , baseRequest , defaultMonitorOptions , DatadogCreden...
iand675/datadog
src/Network/Datadog/Internal.hs
Haskell
mit
16,829
-- | Module for providing various functionals used in calculations involving -- quantum mathematics. This includes the fidelity and trace norm. module Hoqus.Fidelity where import Numeric.LinearAlgebra.Data import Numeric.LinearAlgebra import Hoqus.MtxFun -- | Function 'fidelity' calculates the fidelity between two q...
jmiszczak/hoqus
Hoqus/Fidelity.hs
Haskell
mit
1,022
module Pretty where -- see: http://stackoverflow.com/questions/5929377/format-list-output-in-haskell import Data.List ( transpose, intercalate ) -- a type for fill functions type Filler = Int -> String -> String -- a type for describing table columns data ColDesc t = ColDesc { colTitleFill :: Filler ...
nyorem/skemmtun
src/Pretty.hs
Haskell
mit
1,773
module TestSafePrelude where import Test.HUnit import SafePrelude testSafeHeadForEmptyList :: Test testSafeHeadForEmptyList = TestCase $ assertEqual "Should return Nothing for empty list" Nothing (safeHead ([]::[Int])) testSafeHeadForNonEmptyList :: Test testSafeHe...
Muzietto/transformerz
haskell/hunit/TestSafePrelude.hs
Haskell
mit
572
-- ref: https://en.wikibooks.org/wiki/Haskell/Arrow_tutorial {-# LANGUAGE Arrows #-} module Main where import Control.Arrow import Control.Monad import qualified Control.Category as Cat import Data.List import Data.Maybe import System.Random -- Arrows which can save state newtype Circuit a b = Circuit { unCircuit :: ...
Airtnp/Freshman_Simple_Haskell_Lib
Intro/WIW/Circuit_and_Arrow.hs
Haskell
mit
2,639
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative import Control.Arrow import qualified Data.Attoparsec.Text.Lazy as A import Data.List import Data.Maybe import Data.Monoid import qualified Data.String as S import qualified Data.Text.Lazy as T main :: IO () main = print ("Hi!" :: String...
andregrigon/Lambda
executable/Main.hs
Haskell
mit
5,389
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSynonymInstances #-} module PostgREST.DbStructure ( getDbStructure , accessibleTables ) where import qualified Hasql.Decoders as...
NotBrianZach/postgrest
src/PostgREST/DbStructure.hs
Haskell
mit
31,146
module GHCJS.DOM.SVGViewElement ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/SVGViewElement.hs
Haskell
mit
44
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-budgets-budget-spend.html module Stratosphere.ResourceProperties.BudgetsBudgetSpend where import Stratospher...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/BudgetsBudgetSpend.hs
Haskell
mit
1,728
module Pos.Infra.Binary () where import Pos.Infra.Binary.DHTModel ()
input-output-hk/pos-haskell-prototype
infra/src/Pos/Infra/Binary.hs
Haskell
mit
80
module Text.Spoonerize ( spoonerize ) where import System.Random import Data.Array.IO import Control.Monad import Data.List (sort) import Data.Char (isLower, toLower, toUpper) type Sequence = Int type Word = String type IsSpoonerizable = Bool data WordInfo = WordInfo Sequence Word IsSpoonerizable ...
jsl/spoonerize
Text/Spoonerize.hs
Haskell
mit
4,556
{-# LANGUAGE GADTs,RankNTypes,DeriveFunctor #-} module Faceted.FIORef ( FIORef, newFIORef, readFIORef, writeFIORef, ) where import Faceted.Internal import Data.IORef -- | Variables of type 'FIORef a' are faceted 'IORef's data FIORef a = FIORef (IORef (Faceted a)) -- | Allocate a new 'FIORef' newFIORef ::...
haskell-faceted/haskell-faceted
Faceted/FIORef.hs
Haskell
apache-2.0
986
#!/usr/bin/env stack {- stack --install-ghc runghc --package Command --package text --package hflags -} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} import Control.Monad import Data.Version import HFlags import System.Command import Text.ParserCombinators.ReadP defineFlag "versi...
zchn/ethereum-analyzer
scripts/release_to_hackage.hs
Haskell
apache-2.0
1,919
{-# LANGUAGE OverloadedStrings #-} -- | NSIS (Nullsoft Scriptable Install System, <http://nsis.sourceforge.net/>) is a tool that allows programmers -- to create installers for Windows. -- This library provides an alternative syntax for NSIS scripts, as an embedded Haskell language, removing much -- of the hard w...
idleberg/NSIS
Development/NSIS.hs
Haskell
apache-2.0
4,801
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} import Data.Monoid (mappend) import Hakyll type RenderingFunction = FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String) myFeedConfiguration :: FeedConfigurat...
NCrashed/blog
src/site.hs
Haskell
apache-2.0
3,002
-- 1 -- 2, 1 -- 6, 2, 1 -- 24, 9, 2, 1 -- 120, 44, 13, ?, 1 type Board = [(Int, Int)] -- patternAvoidingPermutations board n = ??? -- Not smart, since it doesn't use the results from (k-1) to help compute k. -- Also, not tail recursive. nonAttackingRookCount 0 _ = 1 nonAttackingRookCount _ [] = 0 nonAtta...
peterokagey/haskellOEIS
src/Sandbox/Richard/table.hs
Haskell
apache-2.0
467
{-# LANGUAGE TemplateHaskell #-} module TH.HSCs where import Language.Haskell.TH import TH.API import TH.APIs import TH.HSC $(do runIO $ putStrLn "HSC generation" apis <- generateAPIs "apis" generateHSCs apis runIO $ putStrLn "..Done" return [] )
fabianbergmark/APIs
src/TH/HSCs.hs
Haskell
bsd-2-clause
277
{-# LANGUAGE DeriveDataTypeable #-} module Application.DiagramDrawer.ProgType where import System.Console.CmdArgs data Diagdrawer = Test deriving (Show,Data,Typeable) test :: Diagdrawer test = Test mode = modes [test]
wavewave/diagdrawer
lib/Application/DiagramDrawer/ProgType.hs
Haskell
bsd-2-clause
241
{-| Module : Idris.Elab.Interface Description : Code to elaborate interfaces. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards #-} {-# OPTIONS_GHC -fwarn-missing-signatures #-} module Idris.Elab.Interface(elabInterface) where import Idris.AbsSyntax import Idris.AST...
enolan/Idris-dev
src/Idris/Elab/Interface.hs
Haskell
bsd-3-clause
15,877
-- | This module reexport everything which is needed for message -- definition in generated code. There is no need import this module -- in user code. module Data.Protobuf.Imports ( -- * Data types Word32 , Word64 , Int32 , Int64 , Bool , Double , Float , String , Maybe(..) , Seq , ByteS...
Shimuuar/protobuf
protobuf-lib/Data/Protobuf/Imports.hs
Haskell
bsd-3-clause
2,306
module Hackage.Twitter.Bot.Types where import Data.Time () import Data.Time.Clock data FullPost = FullPost { fullPostAuthor :: String, fullPostDescription :: String, fullPostTime :: UTCTime, fullPostTitle :: String, fullPostLink :: String} deriving (Show) data PartialPost = PartialPost {aut...
KevinCotrone/hackage-twitter-bot
src/Hackage/Twitter/Bot/Types.hs
Haskell
bsd-3-clause
396
module Main(main) where import System.Environment (getArgs, getProgName) import Web.Zenfolio.API import qualified Web.Zenfolio.Categories as Categories dumpCategories :: ZM () dumpCategories = do categories <- Categories.getCategories liftIO $ putStrLn ("Categories: " ++ show categories) main ::...
md5/hs-zenfolio
examples/GetCategories.hs
Haskell
bsd-3-clause
506
{-# LANGUAGE TupleSections, OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, RecordWildCards, DeriveGeneric ,MultiParamTypeClasses ,FlexibleInstances #-} module Protocol.ROC.PointTypes.PointType121 where import GHC.Generics import qualified Data.ByteString as BS import Data.Word import Dat...
jqpeterson/roc-translator
src/Protocol/ROC/PointTypes/PointType121.hs
Haskell
bsd-3-clause
30,295