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 OverloadedStrings, ScopedTypeVariables, CPP, DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving, MultiParamTypeClasses, TemplateHaskell, TypeFamilies, RecordWildCards #-} import Control.Applicative ((<$>), optional) import Control.Exception ( bracket ) import Control.Monad ( msum, forM_, map...
jpschaumloeffel/sr5gm
sr5gm/sr5gm.hs
Haskell
mit
4,167
{-# LANGUAGE OverloadedStrings #-} import Data.Hash.MD5 import qualified Database.Redis as R import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as BL import Web.Scotty import Network.HTTP.Types import Control.Monad.Trans (liftIO) import qualified Data.Text.Lazy.Encoding as TL import...
EDmitry/shortener-hs
shortener.hs
Haskell
mit
2,150
import Control.Monad.Reader data Expr = Val Int | Add Expr Expr | Var String deriving (Show) type Env = [(String, Int)] type Eval a = ReaderT Env Maybe a eval :: Expr -> Eval Int eval (Val n) = return n eval (Add x y) = liftM2 (+) (eval x) (eval y) eval (Var x) = do env <- ask val <- lift (lookup x env) ...
riwsky/wiwinwlh
src/transformer.hs
Haskell
mit
527
{-# LANGUAGE OverloadedStrings #-} module Data.Time.Calendar.BankHolidaySpec (spec) where import Data.Time import Data.Time.Calendar.BankHoliday (isWeekday, isWeekend) import Test.Hspec spec :: Spec spec = do describe "isWeekday" $ do it "is accurate" $ do all (\d -> isWeekday d) [ (fromGregori...
tippenein/BankHoliday
test/Data/Time/Calendar/BankHolidaySpec.hs
Haskell
mit
911
module Aldus.Types where
lgastako/aldus
src/Aldus/Types.hs
Haskell
mit
26
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, TypeOperators, FlexibleContexts #-} module Main where import Control.Monad import Data.List import Data.Yaml import Flow import Flow.Builder ( rule ) import Flow.Kernel import Kernel.Binning import Kernel.Cleaning import Kernel.Data import Kernel.Degrid i...
SKA-ScienceDataProcessor/RC
MS6/programs/continuum.hs
Haskell
apache-2.0
12,331
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.Unversioned.ListMeta where import GHC.Generics import Data.Text import qualified Data.Aeson -- | ListMeta describes metadata that sy...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/Unversioned/ListMeta.hs
Haskell
apache-2.0
1,103
{- MathHmatrix.hs - Mapping of Linear algebra routines via the hMatrix library. - hMatrix uses GSL and a BLAS implementation such as ATLAS. - - Timothy A. Chagnon - CS 636 - Spring 2009 -} module MathHmatrix where import Numeric.LinearAlgebra deg2rad :: RealT -> RealT deg2rad d = d * pi / 180 type RealT = Doub...
tchagnon/cs636-raytracer
a1/MathHmatrix.hs
Haskell
apache-2.0
1,933
{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}...
markus1189/discrimination
src/Data/Discrimination/Internal/WordMap.hs
Haskell
bsd-2-clause
7,597
{-| Module describing an instance. The instance data type holds very few fields, the algorithm intelligence is in the "Node" and "Cluster" modules. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
apyrgio/snf-ganeti
src/Ganeti/HTools/Instance.hs
Haskell
bsd-2-clause
13,964
{-# LANGUAGE BangPatterns #-} {-| Convenience 'Pipe's, analogous to those in "Control.Pipe.List", for 'Pipe's containing binary data. -} module Control.Pipe.Binary ( -- * Producers produce -- ** Infinite streams , iterate , iterateM , repeat , repeatM -- ** Bounded streams ...
duairc/pipes
src/Control/Pipe/Binary.hs
Haskell
bsd-3-clause
11,736
{-# LANGUAGE TemplateHaskell #-} module Database.Sqroll.TH ( initializeAllTablesDec ) where import Database.Sqroll.Internal (Sqroll, HasTable, sqrollInitializeTable) import Data.Maybe import Language.Haskell.TH -- | create a function 'initializeAllTables :: Sqroll -> IO ()' that, when run, -- will initialize table...
pacak/sqroll
src/Database/Sqroll/TH.hs
Haskell
bsd-3-clause
1,364
{-# LANGUAGE RankNTypes, GADTs, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, AllowAmbiguousTypes #-} module HLib61 where import Control.Category ((>>>)) import Control.Monad ((>=>)) import Data.Dynamic type UserInput = String class (Read n, Show n) => Serializable n instance forall n. (Read n, Show n...
homam/fsm-conversational-ui
src/HLib61.hs
Haskell
bsd-3-clause
4,576
module Evolution.Internal ( EvolutionRules ( EvolutionRules , mutation , breeding , selection , deaths , expression , optimumForGeneration ) , evolution ) where import Data.Random import Data.Functor () import In...
satai/FrozenBeagle
Simulation/Lib/src/Evolution/Internal.hs
Haskell
bsd-3-clause
1,805
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {- | Module : Verifier.SAW.Cryptol.Monadify Cop...
GaloisInc/saw-script
cryptol-saw-core/src/Verifier/SAW/Cryptol/Monadify.hs
Haskell
bsd-3-clause
48,330
module HEP.Data.LHEF.Type where import Data.IntMap (IntMap) import HEP.Kinematics (HasFourMomentum (..)) import HEP.Kinematics.Vector.LorentzVector (setXYZT) data EventInfo = EventInfo { nup :: Int -- ^ Number of partic...
cbpark/lhef-tools
src/HEP/Data/LHEF/Type.hs
Haskell
bsd-3-clause
2,679
{-# LANGUAGE QuasiQuotes, TypeFamilies #-} import Prelude hiding (product, sum) import Text.Papillon import Data.Char import System.Environment main :: IO () main = do arg : _ <- getArgs case expr $ parse arg of Right (r, _) -> print r Left _ -> putStrLn "parse error" [papillon| value :: Int = ds:(d:[isDigit...
YoshikuniJujo/papillon
examples/arith_old.hs
Haskell
bsd-3-clause
618
{-# LANGUAGE TypeFamilies #-} module Network.EasyBitcoin.Internal.Transaction where import Network.EasyBitcoin.Internal.Words import Network.EasyBitcoin.Internal.Base58 ( encodeBase58 , decodeBase58 , addRedundancy ...
vwwv/easy-bitcoin
Network/EasyBitcoin/Internal/Transaction.hs
Haskell
bsd-3-clause
12,007
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Numeric.Units.Dimensional.DK.HaTeX where import Text.LaTeX.Base import Numeric.Units.Dimensional.DK instance (Texy v, KnownDimension d, Fractional v) => Texy (Quantity d v) where texy val = texy (val...
bjornbm/dimensional-dk-experimental
src/Numeric/Units/Dimensional/DK/HaTeX.hs
Haskell
bsd-3-clause
332
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-} module FunPtr where import Ivory.Compile.C.CmdlineFrontend import Ivory.Language f :: Def ('[Sint32] :-> Sint32) f = proc "f" (\ n -> body (ret (n + 1))) invoke :: Def ('[ ProcPtr ('[Sint32] :-> Sint32), Sint32] :-> Sint32) invoke = proc "invoke" (\ k n ->...
Hodapp87/ivory
ivory-examples/examples/FunPtr.hs
Haskell
bsd-3-clause
628
{-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: Type alias for case insensitive strict text. -- Copyright: (c) 2014 Peter Trsko -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experimental -- Portability: NoImplicitPrelude -- -- Type alias for case...
trskop/skeletos
src/Skeletos/Type/CIText.hs
Haskell
bsd-3-clause
544
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.SGIX.BlendAlphaMinmax -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portab...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/SGIX/BlendAlphaMinmax.hs
Haskell
bsd-3-clause
689
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveFunctor, DeriveDataTypeable, TypeSynonymInstances, PatternGuards #-} module Idris.AbsSyntaxTree where import Idris.Core.TT import Idris.Core.Evaluate import Idris.Core.Elaborate hiding (Tactic(..)) import Idris.Core.Typecheck import Idris.Docst...
athanclark/Idris-dev
src/Idris/AbsSyntaxTree.hs
Haskell
bsd-3-clause
95,914
module MainSpec (main, spec) where import Test.Hspec import Test.HUnit (assertEqual, Assertion) import Control.Exception import System.Directory (getCurrentDirectory, setCurrentDirectory) import System.FilePath import Runner (Summary(..)) import Ru...
ekmett/doctest
test/MainSpec.hs
Haskell
mit
4,830
{- Copyright 2012-2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
kustomzone/plush
src/Plush/Job.hs
Haskell
apache-2.0
10,433
{-# OPTIONS -Wall #-} module Examples.HMM where import Prelude hiding (Real) import Language.Hakaru.Syntax import Language.Hakaru.Expect (Expect(..)) import Language.Hakaru.Sample (Sample(..)) import System.Random.MWC (withSystemRandom) import Control.Monad (replicateM) import Data.Number.LogFloat (LogFloat) -- Cond...
bitemyapp/hakaru
Examples/HMM.hs
Haskell
bsd-3-clause
4,483
module HLearn.Models.Classifiers.Perceptron where import qualified Data.Map as Map import qualified Data.Vector.Unboxed as VU import HLearn.Algebra import HLearn.Models.Distributions import HLearn.Models.Classifiers.Common import HLearn.Models.Classifiers.Centroid import HLearn.Models.Classifiers.NaiveNN -------...
iamkingmaker/HLearn
src/HLearn/Models/Classifiers/Perceptron.hs
Haskell
bsd-3-clause
2,296
{-# LANGUAGE FlexibleContexts #-} -- | Likes handling -- <http://instagram.com/developer/endpoints/likes/#> module Instagram.Likes ( getLikes ,like ,unlike )where import Instagram.Monad import Instagram.Types import qualified Network.HTTP.Types as HT -- | Get a list of users who have liked this media. getLike...
potomak/ig
src/Instagram/Likes.hs
Haskell
bsd-3-clause
1,068
------------------------------------------------------------------------------- -- | -- Module : OpenAI.Gym.Data -- License : BSD3 -- Stability : experimental -- Portability: non-portable ------------------------------------------------------------------------------- module Data.Gym where {- ( GymEnv (..) ...
stites/reinforce
reinforce-environments/src/Data/Gym.hs
Haskell
bsd-3-clause
3,572
-- | Interface to the management event bus. module Control.Distributed.Process.Management.Internal.Bus ( publishEvent ) where import Control.Distributed.Process.Internal.CQueue ( enqueue ) import Control.Distributed.Process.Internal.Types ( MxEventBus(..) , Message ) import Data.Foldable (forM_) import S...
qnikst/distributed-process
src/Control/Distributed/Process/Management/Internal/Bus.hs
Haskell
bsd-3-clause
571
<?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="sr-SP"> <title>Groovy Support</title> <maps> <homeID>top</homeID> <mapref location="map...
thc202/zap-extensions
addOns/groovy/src/main/javahelp/org/zaproxy/zap/extension/groovy/resources/help_sr_SP/helpset_sr_SP.hs
Haskell
apache-2.0
959
-- Refactoring: move myFringe to module D3. This example aims to test the change of qualifiers, -- and the import/exports. module C3(Tree(..), SameOrNot(..)) where data Tree a = Leaf a | Branch (Tree a) (Tree a) sumTree:: (Num a) => Tree a -> a sumTree (Leaf x ) = x sumTree (Branch left right) = sumTree left + su...
SAdams601/HaRe
old/testing/moveDefBtwMods/C3_TokOut.hs
Haskell
bsd-3-clause
500
import Control.Concurrent import Control.Exception -- Test blocking of async exceptions in an exception handler. -- The exception raised in the main thread should not be delivered -- until the first exception handler finishes. main = do main_thread <- myThreadId m <- newEmptyMVar forkIO (do { takeMVar m; throwT...
tjakway/ghcjvm
testsuite/tests/concurrent/should_run/conc014.hs
Haskell
bsd-3-clause
864
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-} -- UndecidableInstances now needed because the Coverage Condition fails module ShouldFail where -- A stripped down functional-dependency -- example that causes GHC 4.08.1 to crash with: -- "basicTypes...
lukexi/ghc-7.8-arm64
testsuite/tests/typecheck/should_fail/tcfail093.hs
Haskell
bsd-3-clause
1,075
#! /usr/bin/env nix-shell #! nix-shell ./shell.nix -i runghc import Distribution.Simple main = defaultMain
k0001/haskell-money
safe-money/Setup.hs
Haskell
bsd-3-clause
107
{-# OPTIONS_GHC -Wall -Werror #-} module ManySecond where
holzensp/ghc
testsuite/tests/driver/dynamic_flags_002/ManySecond.hs
Haskell
bsd-3-clause
61
module Sudoku where import Data.Maybe (catMaybes, fromJust, isJust, listToMaybe) import Data.List ((\\), transpose) type SudokuVal = Int -- The type representing Sudoku values type EmptyPuzzle = [[ Maybe SudokuVal ]] -- A matrix where Nothing values represent unknowns. ...
brandonchinn178/sudoku
src/Sudoku.hs
Haskell
mit
3,674
module Test.Hspec.Core.Formatters.Pretty.Unicode ( ushow , ushows ) where import Prelude () import Test.Hspec.Core.Compat import Data.Char ushow :: String -> String ushow xs = ushows xs "" ushows :: String -> ShowS ushows = uShowString uShowString :: String -> ShowS uShowString cs =...
hspec/hspec
hspec-core/src/Test/Hspec/Core/Formatters/Pretty/Unicode.hs
Haskell
mit
688
myTuple = (8, 11) fst' = fst myTuple snd' = snd myTuple -- the zip function will merge two lists into tuples zip' = zip [1,2,3,4,5] [5,5,5,5,5] lazyZip = zip [1.. ] ["one", "two", "three", "four", "five"] --triangles problem triangles = [ (a,b,c) | c <- [1..10], b <- [1..10], a <- [1..10] ] rightTriangles = [...
luisgepeto/HaskellLearning
02 Starting Out/06_tuples.hs
Haskell
mit
500
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module IHaskell.Display.Widgets.Box.SelectionContainer.Tab ( -- * The Tab widget TabWidget -- * Constructor , mkTab ) where -- To...
gibiansky/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/SelectionContainer/Tab.hs
Haskell
mit
1,810
----------------------------------------------------------------------------- -- | -- Module : Data.Either.Unwrap -- Copyright : (c) Gregory Crosswhite -- License : BSD-style -- -- Maintainer : gcross@haskell.org -- Stability : provisional -- Portability : portable -- -- Functions for probing and u...
Spawek/HCPParse
src/Data/Either/Unwrap.hs
Haskell
mit
2,954
-- Prints Hello World N Times -- hello_worlds 0 = return() hello_worlds n = do putStrLn "Hello World" hello_worlds (n-1) -- Complete this function -- This part is related to the Input/Output and can be used as it is -- Do not modify it main = do n <- readLn :: IO Int hello_worlds n
jmeline/secret-meme
hackerrank/functional_programming/haskell/hello_world_n.hs
Haskell
mit
304
{-# LANGUAGE JavaScriptFFI #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} import Control.Applicative import Control.Monad import Control.Monad.Reader import qualified GHCJS.Types as T import qualified GHCJS.Foreign as F import qualified GHCJS.Marshal as M import WebGL import Simple ...
jmillikan/webgl-lessons-ghcjs
src/Lesson02.hs
Haskell
mit
4,723
module Tach.Wavelet.Core where import Tach.Wavelet.Core.Internal
smurphy8/tach
core-libs/tach-wavelet-core/src/Tach/Wavelet/Core.hs
Haskell
mit
66
{-# LANGUAGE DeriveGeneric #-} module Data.Monoid.Colorful.Term ( Term(..) , getTerm , hGetTerm ) where import Data.List (isPrefixOf, isInfixOf) import System.Environment (getEnv) import System.IO (Handle, hIsTerminalDevice, stdout) import GHC.Generics (Generic) -- | Terminal type. For less capable terminals t...
minad/colorful-monoids
src/Data/Monoid/Colorful/Term.hs
Haskell
mit
1,476
module GearScript.AST where data Type = Type { typeName :: String , typeParent :: Maybe Type } deriving (Show, Eq) data Typed a = Typed { typedType :: Maybe Type , typedVal :: a } data TopStatement = FunctionDef { functionName :: S...
teozkr/GearScript
src/GearScript/AST.hs
Haskell
mit
1,237
-- | Debugging functions. module RWPAS.Debug ( logShow ) where import Control.Concurrent import System.IO import System.IO.Unsafe logLock :: MVar () logLock = unsafePerformIO $ newMVar () {-# NOINLINE logLock #-} logShow :: Show a => a -> b -> b logShow thing result = unsafePerformIO $ withMVar logLock $ \_ -> ...
Noeda/rwpas
src/RWPAS/Debug.hs
Haskell
mit
415
-- http://www.codewars.com/kata/5266876b8f4bf2da9b000362 module Likes where likes :: [String] -> String likes [] = "no one likes this" likes (x:[]) = x++" likes this" likes (x:y:[]) = x++" and "++y++" like this" likes (x:y:z:[]) = x++", "++y++" and "++z++" like this" likes (x:y:zs) = x++", "++y++" and "++show (length ...
Bodigrim/katas
src/haskell/6-Who-likes-it.hs
Haskell
bsd-2-clause
344
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QSplashScreen_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:27 Warning : this file is machine generated - ...
keera-studios/hsQt
Qtc/Gui/QSplashScreen_h.hs
Haskell
bsd-2-clause
62,301
-------------------------------------------------------------------------------- module WhatMorphism.Dump ( Dump (..) ) where -------------------------------------------------------------------------------- import Coercion (Coercion) import CoreSyn import Data.List (intercalate)...
jaspervdj/what-morphism
src/WhatMorphism/Dump.hs
Haskell
bsd-3-clause
4,541
{- BezCurve.hs (adapted from bezcurve.c which is (c) Silicon Graphics, Inc) Copyright (c) Sven Panne 2002-2005 <sven.panne@aedion.de> This file is part of HOpenGL and distributed under a BSD-style license See the file libraries/GLUT/LICENSE This program uses evaluators to draw a Bezier curve. -} import...
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/examples/RedBook/BezCurve.hs
Haskell
bsd-3-clause
2,027
import Data.Char (isDigit) data YorthData = YNil | YInt Integer | YOpAdd | YOpSub | YOpMul | YOpDiv | YError String deriving (Show, Eq, Ord) data Closure = DoneToken | Closure [YorthData] Closure [(YorthData, [Closure])] Closure deriving (Show, Eq, Ord) empty_closure = (Closure [] empty...
tricorder42/yorth
yorth.hs
Haskell
bsd-3-clause
959
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FunctionalDependencies #-} ----------------------------------------------------------------------------- -- | -- Module : Indexed.Traversable -- Copyright : (C) 2012 Edward Km...
ekmett/indexed
src/Indexed/Traversable.hs
Haskell
bsd-3-clause
904
import Data.Text (unpack) import Data.List (sortOn) import Lib main :: IO () main = do mod <- parseModuleFromFile "test/Test1.purs" putStrLn "" putStrLn $ show mod putStrLn "" putStrLn "% facts" putStrLn . unpack . formatAtomsProlog . sortForProlog . factsFromModule $ mod pu...
epost/psc-query
test/Spec.hs
Haskell
bsd-3-clause
540
{-# LANGUAGE OverloadedStrings #-} import System.Random import System.Environment import Debug.Trace import Data.List import Control.Monad.Par import Control.DeepSeq import Data.Map (Map) import qualified Data.Map as Map -- ---------------------------------------------------------------------------- -- <<Talk newty...
mono0926/ParallelConcurrentHaskell
timetable3.hs
Haskell
bsd-3-clause
4,343
---------------------- -- PARELM -- ---------------------- module Parelm where import LPPE import Usage -- This function removes global parameters that are never used. parelm :: PSpecification -> PSpecification parelm (lppe, initial, dataspec) = (lppeReduced, initial2, dataspec) where unused = [...
utwente-fmt/scoop
src/Parelm.hs
Haskell
bsd-3-clause
607
{-# LANGUAGE TypeOperators #-} module Data.Semigroupoid.Category where import Data.Semigroupoid.Semigroupoid class Semigroupoid (~>) => Category (~>) where id :: a ~> a instance Category (->) where id a = a
tonymorris/type-class
src/Data/Semigroupoid/Category.hs
Haskell
bsd-3-clause
222
module D18Spec (main, spec) where import Test.Hspec import D18Lib import qualified Data.Vector as V import qualified Text.Parsec as P main :: IO () main = hspec spec spec :: Spec spec = parallel $ do describe "parsing" $ do it "parses a row" $ do let r = P.parse rowP "fixture" ".^\n" ...
wfleming/advent-of-code-2016
2016/test/D18Spec.hs
Haskell
bsd-3-clause
862
-- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file....
konn/leport
leport-web/Settings.hs
Haskell
bsd-3-clause
6,896
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} import Plots import Network.Wreq import Control.Lens import Data.Csv hiding ((.=)) import Plots.Axis import qualified Data.Vector as V import Data.ByteString.Lazy (ByteString) import Control.Arrow import Control.Monad.State (MonadState, execStateT) import Da...
bergey/plots
examples/stocks.hs
Haskell
bsd-3-clause
4,014
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.HcPkg -- Copyright : Duncan Coutts 2009, 2013 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides an library interface to the @hc-pkg@ progra...
fugyk/cabal
Cabal/Distribution/Simple/Program/HcPkg.hs
Haskell
bsd-3-clause
16,572
{-# LANGUAGE NoImplicitPrelude #-} module Jetski.Foreign.Return ( Return(..) , storableReturn , withReturn , retVoid , retInt8 , retInt16 , retInt32 , retInt64 , retWord8 , retWord16 , retWord32 , retWord64 , retFloat , retDouble , retCChar , retCUChar , retCWchar , retCInt , r...
ambiata/jetski
src/Jetski/Foreign/Return.hs
Haskell
bsd-3-clause
3,333
----------------------------------------------------------------------------- -- | -- Module : Data.SBV.SMT.SMT -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Abstraction of SMT solvers ---------------------------------------------...
Copilot-Language/sbv-for-copilot
Data/SBV/SMT/SMT.hs
Haskell
bsd-3-clause
26,491
{- Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.0 Kubernetes API version: v1.9.12 Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) -} {-| Module : Kubernetes.OpenAPI.API.Events ...
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/API/Events.hs
Haskell
bsd-3-clause
2,712
module ELc.Arbitrary where import Language.ELc import Lc.Arbitrary import Test.QuickCheck -------------------------------------------------------------- -- QuickCheck - Arbitratry -------------------------------------------------------------- instance Arbitrary ELc where arbitrary = arbitraryELc instance Arbit...
d-dorazio/lc
test/ELc/Arbitrary.hs
Haskell
bsd-3-clause
522
{-# LANGUAGE BangPatterns #-} module Scrabble (makeDict,process,validHand,prettySC ,ScrabbleCommand(..),Sort(..),Dict,FilePath,Score) where import Data.Array.Unboxed((!)) import Data.Ix(inRange) import Data.List(group,sort) import Data.Char(toUpper) import Tiles(freqArray) import Dict(Dict,build) impor...
ChrisKuklewicz/XWords
src/Scrabble.hs
Haskell
bsd-3-clause
3,074
{-# LANGUAGE OverloadedStrings #-} module CryptoTest (tests, cbTests) where import System.IO import System.IO.Temp import System.Posix.IO import Control.Monad (liftM, when) import Control.Monad.Trans.Maybe import Control.Monad.IO.Class import Control.Monad.Catch import Control.Concurrent import Data.List (isInfixOf) i...
mmhat/h-gpgme
test/CryptoTest.hs
Haskell
mit
12,536
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.HTTP2.Worker ( Respond , response , worker ) where #if __GLASGOW_HASKELL__ < 709 import Control.Applicative #endif import Contro...
soenkehahn/wai
warp/Network/Wai/Handler/Warp/HTTP2/Worker.hs
Haskell
mit
10,706
{-| Types used in both Events and Effects. -} module Urbit.Arvo.Common ( KingId(..), ServId(..) , Json, JsonNode(..) , Desk(..), Mime(..) , Port(..), Turf(..) , HttpServerConf(..), PEM(..), Key, Cert , HttpEvent(..), Method, Header(..), ResponseHeader(..) , ReOrg(..), reorgThroughNoun , AmesDest(..)...
jfranklin9000/urbit
pkg/hs/urbit-king/lib/Urbit/Arvo/Common.hs
Haskell
mit
6,142
-- | See "Control.Super.Monad.Functions". module Control.Supermonad.Functions ( module Control.Super.Monad.Functions ) where import Control.Super.Monad.Functions
jbracker/supermonad-plugin
src/Control/Supermonad/Functions.hs
Haskell
bsd-3-clause
168
{-# LANGUAGE CPP #-} import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import System.Exit (ExitCode(..), exitWith) import Gigasecond (fromDay) import Data.Time.Clock (UTCTime) import System.Locale (iso8601DateFormat) #if __GLASGOW_HASKELL__ >= 710 import Data.Time.Format (TimeLocale, ParseTime, pars...
stevejb71/xhaskell
gigasecond/gigasecond_test.hs
Haskell
mit
1,429
{-| Cluster checker. -} {- Copyright (C) 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of ...
andir/ganeti
src/Ganeti/HTools/Program/Hcheck.hs
Haskell
bsd-2-clause
13,579
{- (c) The University of Glasgow, 2004-2006 Module ~~~~~~~~~~ Simply the name of a module, represented as a FastString. These are Uniquable, hence we can build Maps with Modules as the keys. -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RecordWildCards #-} module Module ( -- * The ModuleName type ...
siddhanathan/ghc
compiler/basicTypes/Module.hs
Haskell
bsd-3-clause
18,321
{-# LANGUAGE CPP, BangPatterns #-} module Main where import Control.Monad import Data.Int import Network.Socket ( AddrInfo, AddrInfoFlag (AI_PASSIVE), HostName, ServiceName, Socket , SocketType (Stream), SocketOption (ReuseAddr) , accept, addrAddress, addrFlags, addrFamily, bindSocket, defaultProtocol , defa...
tweag/network-transport-zeromq
benchmarks/subparts/h-tcp-chan.hs
Haskell
bsd-3-clause
4,012
module Infix4 (f) where -- define an infix constructor and attempt to remove it... data T1 a b = b :#: a {- g :: T1 Int Int -> Int -} {- g (x :$: y) = x + y -} f x y = error "g (x :$: y) no longer defined for T1 at line: 5"
kmate/HaRe
old/testing/removeCon/Infix4_TokOut.hs
Haskell
bsd-3-clause
241
module ListSort () where import Language.Haskell.Liquid.Prelude {-@ type OList a = [a]<{\fld v -> (v >= fld)}> @-} {-@ predicate Pr X Y = (((len Y) > 1) => ((len Y) < (len X))) @-} {-@ split :: xs:[a] -> ({v:[a] | (Pr xs v)}, {v:[a]|(Pr xs v)}) <{\x y -> ((len x) + (len y) = (len xs))}>...
ssaavedra/liquidhaskell
tests/pos/ListMSort.hs
Haskell
bsd-3-clause
1,062
module Conflict1 where f :: Int -> Int f x = x + 1 f1 :: Int -> Int f1 x = x - 1 f3 :: Int -> (Int, Int) f3 x y = (x + 1, y - 1)
kmate/HaRe
old/testing/merging/Conflict1_TokOut.hs
Haskell
bsd-3-clause
133
{-# LANGUAGE RecordWildCards #-} -- | See: -- -- * \"The Probabilistic Relevance Framework: BM25 and Beyond\" -- <www.soi.city.ac.uk/~ser/papers/foundations_bm25_review.pdf‎> -- -- * \"An Introduction to Information Retrieval\" -- <http://nlp.stanford.edu/IR-book/pdf/irbookonlinereading.pdf> -- module Distribution...
ocharles/hackage-server
Distribution/Server/Features/Search/BM25F.hs
Haskell
bsd-3-clause
6,758
{-# LANGUAGE TypeFamilies #-} module B where import A data B type instance F (B,b) = () b :: () -> F (B,b) b = id
shlevy/ghc
testsuite/tests/driver/recomp017/B.hs
Haskell
bsd-3-clause
114
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} -- A very bogus program (multiple errors) but -- sent GHC 6.12 into a loop module T3330a where newtype Writer w a = Writer { runWriter :: (a, w) } execWriter :: Writer w a -> w execWriter m = snd (runWriter m) data AnyF (s :...
ezyang/ghc
testsuite/tests/indexed-types/should_fail/T3330a.hs
Haskell
bsd-3-clause
1,260
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} -- Test allocation of statically sized arrays. There's an optimization -- that targets these and we want to make sure that the code generated -- in the optimized case is correct. -- -- The tests proceeds by allocating a bunch of arrays of different -- sizes and r...
urbanslug/ghc
testsuite/tests/codeGen/should_run/StaticArraySize.hs
Haskell
bsd-3-clause
2,785
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module Impl.MVar1 where import Control.Concurrent.MVar import Control.Monad.IO.Class import Control.Monad.Trans.Either import Data.HashMap.Strict (HashMap) import qua...
AndrewRademacher/whimsy
src/Impl/MVar1.hs
Haskell
mit
1,786
{- - Comonad implementation of an infinite cellular automata grid, adapted with - minor modifications from Kukuruku's implementation here: - http://kukuruku.co/hub/haskell/cellular-automata-using-comonads - -} module Universe where import Control.Applicative (pure) import Control.Comonad (Comonad(..)) -- Univer...
billpmurphy/conway-combat
Universe.hs
Haskell
mit
3,075
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Nauva.Product.Varna.Shared ( root , batteryCard ) where import qualified Data.Aeson as A import Nauva.View import Nauva.Service.Head import Nauva.P...
wereHamster/nauva
product/varna/shared/src/Nauva/Product/Varna/Shared.hs
Haskell
mit
3,087
{-# LANGUAGE TupleSections, RecordWildCards, DeriveGeneric #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} ------------------------------------------------------------------------------ -- | -- Module : Mahjong.Kyoku -- Copyright : (C) 2014 Samuli Thomasson -- License : MIT (see the file LICENSE) --...
SimSaladin/hajong
hajong-server/src/Mahjong/Kyoku.hs
Haskell
mit
28,620
{-# LANGUAGE RecursiveDo #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStri...
tomsmalley/quickform
src/QuickForm/Validation.hs
Haskell
mit
3,284
-- | This module contains the algorithm for determining the best possible move -- in a game of tic-tac-toe. module Minimax (findOptimalMove) where ------------------- -- Local Imports -- import Board ---------- -- Code -- -- | Accessing the third element in a 3-tuple. thd :: (a, b, c) -> c thd (_, _, c) = c -- | ...
crockeo/tic-taskell
src/Minimax.hs
Haskell
mit
1,584
{-| Module : BreadU.Pages.Markup.Common.Header Description : HTML markup for pages' top area. Stability : experimental Portability : POSIX HTML markup for pages' top area. Please don't confuse it with <head>-tag, it's defined in another module. -} module BreadU.Pages.Markup.Common.Header ( commonHeader ...
denisshevchenko/breadu.info
src/lib/BreadU/Pages/Markup/Common/Header.hs
Haskell
mit
4,202
module System.Flannel.BuilderTreeSpec ( spec ) where import qualified System.Flannel.Argument as A import System.Flannel.Command import System.Flannel.CommandBuilder import System.Flannel.BuilderTree import Test.Hspec spec :: Spec spec = do describe "define" $ do context "when there is no previous...
nahiluhmot/flannel
spec/System/Flannel/BuilderTreeSpec.hs
Haskell
mit
2,162
-- | module Constraint.Term where import qualified Syntax constrain env term ty = case term of Literal lit -> Literal.constrain env lit ty
cpehle/faust
src/Constraint/Term.hs
Haskell
mit
153
{-# LANGUAGE OverloadedStrings, RecordWildCards, LambdaCase, ViewPatterns, ScopedTypeVariables, NoMonomorphismRestriction #-} module Network.AWS.Connection where import qualified Prelude as P import qualified Data.List as L import System.Environment (get...
thinkpad20/s3-streams
src/Network/AWS/Connection.hs
Haskell
mit
6,597
-- A module with some code to explore theorems in the monadic lambda calculus module TP where import Data.List import Data.Set (Set) import qualified Data.Set as Set import Data.Maybe import Data.Map (Map) import qualified Data.Map as Map import Data.Foldable hiding (concat,any,all) import Control.Monad.State import D...
gianlucagiorgolo/lambek-monad
TP.hs
Haskell
mit
19,668
module Main where import Text.ParserCombinators.UU import Text.ParserCombinators.UU.Utils import Text.ParserCombinators.UU.BasicInstances hiding (Parser, input) import System.Console.Haskeline import System.Environment (getArgs) type Parser a = P (Str Char String LineColPos) a main :: IO () main = do args <- getAr...
chriseidhof/TimeCalc
TimeCalc.hs
Haskell
mit
2,186
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} -- | Defines what each type of server does upon receiving each type of message. -- Thus, the consensus protocol is largely defined here. ...
isheff/hetcons
src/Hetcons/Receive.hs
Haskell
mit
11,350
{-**************************************************************************** * Hamster Balls * * Purpose: Rendering code for terrains in the game * * Author: David, Harley, Alex, Matt * * ...
harley/hamball
src/Terrain.hs
Haskell
mit
11,981
{- - Module to parse Lisp - - - Copyright 2013 -- name removed for blind review, all rights reserved! Please push a git request to receive author's name! -- - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of...
DatePaper616/code
lispParser.hs
Haskell
apache-2.0
3,029
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} module Lycopene.Web.Api where import Servant import Lycopene.Application (AppEngine) import Lycopene.Web.Trans (lyco) import Lycopene.Web.Request import qualified Lycopene.Core as Core ...
utky/lycopene
src/Lycopene/Web/Api.hs
Haskell
apache-2.0
2,660
-- | -- Common Data Types -- -- <https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf saml-core-2.0-os> §1.3 module SAML2.Core.Datatypes where import Prelude hiding (String) import qualified SAML2.XML.Schema.Datatypes as XS -- |§1.3.1 type XString = XS.String -- |§1.3.2 type AnyURI = XS.AnyURI -- |§1....
dylex/hsaml2
SAML2/Core/Datatypes.hs
Haskell
apache-2.0
420
{-# LANGUAGE TemplateHaskell, DeriveFunctor #-} {-| Some common Ganeti types. This holds types common to both core work, and to htools. Types that are very core specific (e.g. configuration objects) should go in 'Ganeti.Objects', while types that are specific to htools in-memory representation should go into 'Ganeti....
ganeti-github-testing/ganeti-test-1
src/Ganeti/Types.hs
Haskell
bsd-2-clause
32,269
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QStyleOptionFrameV2.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:21 Warning : this file is machine generate...
uduki/hsQt
Qtc/Gui/QStyleOptionFrameV2.hs
Haskell
bsd-2-clause
3,434