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 CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Snap.Internal.Http.Server.Socket.Tests (tests) where ------------------------------------------------------------------------------ import Control.Applicative ((<$>)) import qu...
sopvop/snap-server
test/Snap/Internal/Http/Server/Socket/Tests.hs
Haskell
bsd-3-clause
6,866
import System.IO import TPM doExport :: String -> TPM_PUBKEY -> IO () doExport fileName pubKey = do handle <- openFile fileName WriteMode hPutStrLn handle $ show pubKey hClose handle
armoredsoftware/protocol
tpm/mainline/attestation/exportEK.hs
Haskell
bsd-3-clause
189
module Compiler.Parser(parse) where import Compiler.Lp import Compiler.Util parse :: String -> Program parse = map parseRule . chunks . filter (not . dull) . lines where dull x = all isSpace x || "#" `isPrefixOf` x chunks = rep (\(x:xs) -> first (x:) $ break (not . isSpace . head) xs) parseRul...
silkapp/tagsoup
dead/parser/Compiler/Parser.hs
Haskell
bsd-3-clause
2,105
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[RnNames]{Extracting imported and top-level names in scope} -} {-# LANGUAGE CPP, NondecreasingIndentation #-} module RnNames ( rnImports, getLocalNonValBinders, rnExports, extendGlobalRdrEnvRn, gresFromAvails, calcul...
forked-upstream-packages-for-ghcjs/ghc
compiler/rename/RnNames.hs
Haskell
bsd-3-clause
77,667
{-# LANGUAGE ForeignFunctionInterface #-} module Layout.Foreign where import Foreign.C.Types import GHC.Exts foreign import ccall "wxStyledTextCtrl_ShowLines" wxStyledTextCtrl_ShowLines :: Ptr (Int) -> CInt -> CInt -> IO () foreign export ccall "wxStyledTextCtrl_ShowLines" wxStyledTextCtrl_ShowLines :: Ptr (Int) ->...
RefactoringTools/HaRe
test/testdata/Layout/Foreign.hs
Haskell
bsd-3-clause
355
module Test13 where f = [(let x = 45 in [x])]
mpickering/HaRe
old/testing/refacSlicing/Test13.hs
Haskell
bsd-3-clause
47
{-# LANGUAGE EmptyDataDecls, TypeFamilies, UndecidableInstances, ScopedTypeVariables, TypeOperators, FlexibleInstances, NoMonomorphismRestriction, MultiParamTypeClasses, FlexibleContexts #-} module IndTypesPerfMerge where data a :* b = a :* b infixr 6 :* data TRUE data FALSE dat...
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/IndTypesPerfMerge.hs
Haskell
bsd-3-clause
4,264
module Bug1 where -- | We should have different anchors for constructors and types\/classes. This -- hyperlink should point to the type constructor by default: 'T'. data T = T
DavidAlphaFox/ghc
utils/haddock/html-test/src/Bug1.hs
Haskell
bsd-3-clause
179
{-# LANGUAGE DataKinds #-} -- This bug related to type trimming, and -- hence showed up only with -O0 module Bug() where data UnaryTypeC a = UnaryDataC a type Bug = 'UnaryDataC
ezyang/ghc
testsuite/tests/polykinds/T5912.hs
Haskell
bsd-3-clause
183
data Vec3 = Vec3 !Double !Double !Double deriving (Show) infixl 6 ^+^, ^-^ infixr 7 *^, <.> negateV :: Vec3 -> Vec3 negateV (Vec3 x y z) = Vec3 (-x) (-y) (-z) (^+^), (^-^) :: Vec3 -> Vec3 -> Vec3 Vec3 x1 y1 z1 ^+^ Vec3 x2 y2 z2 = Vec3 (x1 + x2) (y1 + y2) (z1 + z2) v ^-^ v' = v ^+^ negateV v' (*^) :: Double -> V...
olsner/ghc
testsuite/tests/numeric/should_run/T9407.hs
Haskell
bsd-3-clause
1,556
module FilenameDescr where import Data.Char import Data.Either import Data.List import BuildInfo import Utils import Tar -- We can't just compare plain filenames, because versions numbers of GHC -- and the libraries will vary. So we use FilenameDescr instead, which -- abstracts out the version numbers. type Filenam...
urbanslug/ghc
distrib/compare/FilenameDescr.hs
Haskell
bsd-3-clause
2,287
{-# LANGUAGE ScopedTypeVariables #-} import Control.Exception import Control.Monad import GHC.Conc main = join $ atomically $ do catchSTM (throwSTM ThreadKilled `orElse` return (putStrLn "wtf")) (\(e::SomeException) -> return (putStrLn "ok"))
urbanslug/ghc
testsuite/tests/rts/T8035.hs
Haskell
bsd-3-clause
255
module Foundation where import Prelude import Yesod import Yesod.Static import Yesod.Auth import Yesod.Auth.BrowserId import Yesod.Auth.GoogleEmail import Yesod.Default.Config import Yesod.Default.Util (addStaticContentExternal) import Network.HTTP.Conduit (Manager) import qualified Settings import Settings.Developmen...
dphilipson/word_guesser_web
Foundation.hs
Haskell
mit
6,537
module Database.Posts ( createPost, getPostsSince, getPost, postChildren, ) where import BasePrelude import Control.Concurrent.Chan import Data.Text (Text) import Data.Time.Clock (getCurrentTime, UTCTime) import Database.Internal toPost :: [SqlValue] -> ResolvedPost toPost [idPost, idUser, content, idParent, ...
hlian/basilica
Database/Posts.hs
Haskell
mit
2,620
module Antiqua.Graphics.Window( Window, WindowSettings(..), createWindow, useWindow, getKey, getScroll, resetScroll ) where import qualified Graphics.UI.GLFW as GLFW import Data.IORef import System.IO.Unsafe import Control.DeepSeq import Antiqua.Common import Graphics.Rendering.OpenGL.Raw ...
olive/antiqua-prime
src/Antiqua/Graphics/Window.hs
Haskell
mit
3,037
-- source: http://stackoverflow.com/a/23124701/499478 {-# LANGUAGE MultiParamTypeClasses, TypeFamilies, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} module Augment (augmentWith) where class Augment a b f h where augmentWith :: (a -> b) -> f -> h instance (a ~ c, h ~ b) => Augment a b c h wh...
Wizek/fuzzy-match
src/Augment.hs
Haskell
mit
460
module Quipp.Vmp where import Debug.Trace import Control.Applicative ((<$>), (<*>)) import Control.Monad.Trans.Class (lift) -- import transformers-0.3.0.0:Control.Monad.Trans.Class (lift) import Data.Foldable (foldlM) import Data.List (elemIndex) import Data.Map (Map, (!)) import qualified Data.Map as Map import Data....
jessica-taylor/quipp2
src/Quipp/Vmp.hs
Haskell
mit
2,688
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings, TupleSections, GADTs #-} module DayX where import AdventPrelude import Data.List (iterate) input :: String input = "......^.^^.....^^^^^^^^^...^.^..^^.^^^..^.^..^.^^^.^^^^..^^.^.^.....^^^^^..^..^^^..^^.^.^..^^..^^^.." -- input = "..^^." -- input = ".^^.^.^^^^" show...
farrellm/advent-2016
src/Day18.hs
Haskell
mit
985
main = putStrLn $ show solve solve :: Int solve = numSpiralDiagSum 1001 numSpiralDiagSum :: Int -> Int numSpiralDiagSum n = sum $ map (sum . (uncurry every)) $ take (div (n+1) 2) $ zip (1:[2,4..]) numSpiral where f n xs = every n xs -- Each layer of the infinite number spiral (e.g. [[1], [2,3,4,5,6,7,8,9], ..]...
pshendry/project-euler-solutions
0028/solution.hs
Haskell
mit
549
{-# LANGUAGE OverloadedStrings #-} import Debug.Trace {- CODE CHALLENGE: Solve the Change Problem. The DPCHANGE pseudocode is reproduced below for your convenience. Input: An integer money and an array Coins = (coin1, ..., coind). Output: The minimum number of coins with denominations Coins that changes mon...
tinkerthaler/bioinformatics3
src/DPChange.hs
Haskell
mit
1,937
{-# LANGUAGE DeriveGeneric #-} module Lattice where import GHC.Generics (Generic) class Ord a => Lattice a where top :: a bottom :: a (\/) :: a -> a -> a (/\) :: a -> a -> a flowsTo :: a -> a -> Bool -- | slightly more interesting lattice -- H -- / \ -- ...
kellino/TypeSystems
gradualSecurity/src/Lattice.hs
Haskell
mit
2,151
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE CPP #-} module Stackage.Select ( select , defaultSelectSettings ) where import Data.Either (partitionEithers) import qualified Data.Map as Map import Data.Maybe (mapMaybe) import Data.Set (e...
sinelaw/stackage
Stackage/Select.hs
Haskell
mit
4,652
{-# LANGUAGE BangPatterns, RankNTypes #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_GHC -fspec-constr #-} {-# OPTIONS_GHC -fdicts-cheap #-} {- OPTIONS_GHC -optlo-globalopt #-} {- OPTIONS_GHC -optlo-loop-unswitch #-} {- OPTIONS_GHC -optlo-mem2reg #-} {- OPTIONS_GHC -optlo-prune-eh #-} {-# OPTIONS...
ku-fpg/hermit-streamfusion
Concat.hs
Haskell
mit
4,909
{- - Copyright (c) 2017 The Agile Monkeys S.L. <hackers@theam.io> - - 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 requir...
J2RGEZ/haskell-do
src/common/HaskellDo/Toolbar/Types.hs
Haskell
apache-2.0
1,339
-- Copyright 2020 Google LLC -- -- 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 -- -- https://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/xscreensaver-dbus
src/Pool.hs
Haskell
apache-2.0
5,395
{-# LANGUAGE DeriveDataTypeable, NamedFieldPuns, RecordWildCards, ScopedTypeVariables #-} -- | -- Module: Network.Riak.Connection.Pool -- Copyright: (c) 2011 MailRank, Inc. -- License: Apache -- Maintainer: Nathan Hunter <nhunter@janrain.com> -- Stability: experimental -- Portability: portable -- -- ...
janrain/riak-haskell-client
src/Network/Riak/Connection/Pool.hs
Haskell
apache-2.0
4,640
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Network.MoeSocks.Type ( module Network.MoeSocks.Type.Runtime , module Network.MoeSocks.Type.Common ) where import Network.MoeSocks.Type.Runtime import Network.MoeSocks.Type.Common
nfjinjing/moesocks
src/Network/MoeSocks/Type.hs
Haskell
apache-2.0
255
{-# LANGUAGE TupleSections, TypeOperators, Rank2Types, BangPatterns, FunctionalDependencies, MultiParamTypeClasses, MagicHash, ScopedTypeVariables, GADTs, FlexibleContexts, TypeFamilies, TypeSynonymInstances, FlexibleInstances #-} module System.Mem.Concurrent.WeakMap ( WeakMap(..) , new,new',copy' , lookup , ins...
cornell-pl/HsAdapton
src/System/Mem/Concurrent/WeakMap.hs
Haskell
bsd-3-clause
9,263
module Sync.Common where import Control.Monad.State import qualified Data.Map as M import System.INotify import System.Log.Logger as E type SyncState = StateT Sync IO () type FileStructureFactory = FilePath -> StateT Sync IO (FileStructure) data Sync = Sync { getMap :: M.Map FilePath FileStructure, getFile...
kevinm416/sync
Sync/Common.hs
Haskell
bsd-3-clause
861
{-# LANGUAGE CPP, BangPatterns, ViewPatterns, FlexibleInstances, TypeOperators, FlexibleContexts, TypeSynonymInstances #-} {-# LANGUAGE MultiParamTypeClasses, PatternGuards #-} #if __GLASGOW_HASKELL__ >= 700 {-# OPTIONS -fllvm #-} #endif module Data.TrieMap.RadixTrie.Search (insertEdge) where import Control.Monad.Unpa...
lowasser/TrieMap
Data/TrieMap/RadixTrie/Search.hs
Haskell
bsd-3-clause
4,571
module Persistent.CRUDSpec where import Database.Persist import Database.Persist.Sql import Persistent.CRUD import Test.Hspec spec :: Spec spec = describe "createUser" $ it "returns the created user id" $ do let email = "foo@bar.com" firstName = "Foo" ...
stackbuilders/persistent-crud
test/Persistent/CRUDSpec.hs
Haskell
bsd-3-clause
648
-- | パターンマッチのコンパイル module Malgo.Desugar.Match (match, PatMatrix, patMatrix) where import Control.Lens (At (at), Prism', has, over, (?=), _1) import qualified Data.List as List import qualified Data.List.NonEmpty as NonEmpty import qualified Data.Map.Strict as Map import Data.Traversable (for) import Koriel.Core.Syntax...
takoeight0821/malgo
src/Malgo/Desugar/Match.hs
Haskell
bsd-3-clause
9,274
module Main where import Control.Applicative import Control.Arrow import Control.Monad import Data.Attoparsec.Char8 hiding (take) import qualified Data.Attoparsec.Char8 as AC (take) import Data.Char (ord) import Data.List (foldl') import Data.ByteString.Char8 (pack, unpack) import Data.ByteString (ByteString) int :: ...
cutsea110/tsr-test
Devel.hs
Haskell
bsd-3-clause
1,238
module Scheme.DataType.Error.Try where import DeepControl.Monad.Except -- for Chaitin's Omega function data TryError = OUTOFDATA | OUTOFTIME | PARSEErr String | OTHER String instance Error TryError where strMsg s = OTHER s instance Show TryError where show OUTOFDAT...
ocean0yohsuke/Scheme
src/Scheme/DataType/Error/Try.hs
Haskell
bsd-3-clause
460
-- -- Module : Granulepos -- Copyright : (c) Conrad Parker 2006 -- License : BSD-style -- Maintainer : conradp@cse.unsw.edu.au -- Stability : experimental -- Portability : portable module Codec.Container.Ogg.Granulepos ( Granulepos (..), gpPack, gpUnpack ) where import Data.Word (Word64) --------...
kfish/hogg
Codec/Container/Ogg/Granulepos.hs
Haskell
bsd-3-clause
865
module Graphics.UI.Gtk.WebKit.WebSettings where {- -- * Desciption -- | WebKitWebSettings can be applied to a WebKitWebView to control the to be used text encoding, color, -- font sizes, printing mode, script support, loading of images and various other things. -- * Types WebSettings, WebSettingsClass, EditingB...
mightybyte/reflex-dom-stubs
src/Graphics/UI/Gtk/WebKit/WebSettings.hs
Haskell
bsd-3-clause
15,359
import Test.HUnit import Text.Parsec.Error (ParseError, errorMessages, messageString) import qualified SvgParser as SVG import SvgParser (SVG) import Attributes (Attribute(..)) parseFile :: String -> IO (Either ParseError SVG) parseFile filename = do file <- readFile filename return $ SVG.parse file cmpToFile :...
elaye/svg-parser
test/Spec.hs
Haskell
bsd-3-clause
872
{-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings #-} module Conifer.Types where import Data.Maybe import Data.Tree(Tree(..)) import Diagrams.Coordinates import Diagrams.Prelude -- hiding (rotationAbout, direction) import Diagrams.ThreeD.Types import Diagrams.ThreeD.Vector import Control.Monad (mzero) import ...
bobgru/conifer
src/Conifer/Types.hs
Haskell
bsd-3-clause
9,328
module MoreDigits where import Data.Number.IReal import Data.Number.IReal.IReal import Data.Number.IReal.IntegerInterval import LinAlg import Newton import Integrals import Erf {- This file contains solutions to some of the problems from the MoreDigits friendly competition, held at LORIA, Nancy, France, in July 2006...
sydow/ireal
applications/MoreDigits.hs
Haskell
bsd-3-clause
8,375
{-# LANGUAGE RecordWildCards #-} module TestPrelude ( module Control.Concurrent.STM , module Control.Monad , module Data.Vector , module Network.DHT.Kademlia.Bucket , module Network.DHT.Kademlia.Def , module Test.Hspec , module TestEq , addNodeSimple , newEnv , sendNoop , defaultNode , fullKBucket , leftKBucket , ri...
phylake/kademlia
test/TestPrelude.hs
Haskell
bsd-3-clause
1,901
{-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module LambdaCms.Core.Handler.User ( getUserAdminIndexR , getUserAdminNewR , postUserAdminNewR , getUserAdminEditR , patchUs...
geraldus/lambdacms
lambdacms-core/LambdaCms/Core/Handler/User.hs
Haskell
mit
17,686
{-# LANGUAGE OverloadedStrings #-} module Gpg.GenRevoke where import Control.Monad import Data.Text (Text) import qualified Data.Text as Text import Gpg.Run data RevocationReason = NoReason | Compromised | Superseeded | No...
Philonous/pontarius-gpg
src/Gpg/GenRevoke.hs
Haskell
mit
983
module Pos.Chain.Delegation.Proof ( DlgProof , mkDlgProof ) where import Pos.Crypto (Hash, hash) import Pos.Chain.Delegation.Payload -- | Proof of delegation payload. type DlgProof = Hash DlgPayload -- | Creates 'DlgProof' out of delegation payload. mkDlgProof :: DlgPayload ...
input-output-hk/cardano-sl
chain/src/Pos/Chain/Delegation/Proof.hs
Haskell
apache-2.0
350
module Sansa.Commands.AddTorrent ( addTorrentCmd ) where import Sansa.CommandsCommon import Sansa.Commands.CommonOpts import Aria2.Commands (addTorrent) import Aria2.Types import System.Directory import Data.Maybe import qualified Data.ByteString as B import qualified Data.ByteString.Base64 as Base64 im...
rootzlevel/sansa
src/Sansa/Commands/AddTorrent.hs
Haskell
bsd-2-clause
1,434
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-| This module exports the 'Config' datatype, which you can use to configure the Snap HTTP server. -} module Snap.Http.Server.Config ( Config , ConfigBackend(..) , ConfigLog(..) , emptyConfig , defaultConfig ,...
beni55/snap-server
src/Snap/Http/Server/Config.hs
Haskell
bsd-3-clause
20,343
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[Demand]{@Demand@: A decoupled implementation of a demand domain} -} {-# LANGUAGE CPP, FlexibleInstances, TypeSynonymInstances #-} module Demand ( StrDmd, UseDmd(..), Count(..), countOnce, countMan...
nushio3/ghc
compiler/basicTypes/Demand.hs
Haskell
bsd-3-clause
75,989
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Fix -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2002 -- License : ...
nushio3/ghc
libraries/base/Control/Monad/Fix.hs
Haskell
bsd-3-clause
3,278
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} module Blockchain.BlockChain ( nextDifficulty, addBlock, addBlocks, addTransaction, addTransactions, getBestBlock, getBestBlockHash, getGenesisBlockHash, runCodeForTransaction ) where import Control.Monad import Control.Monad.IfElse import Contr...
jamshidh/ethereum-vm
src/Blockchain/BlockChain.hs
Haskell
bsd-3-clause
17,599
{-# LANGUAGE KindSignatures, TupleSections, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, OverloadedStrings, ExistentialQuantification, FlexibleInstances #-} module Graphics.Storyboard.Behavior where import Control.Applicative import Control.Concurrent.STM import qualified Graphics.B...
tonymorris/story-board
src/Graphics/Storyboard/Behavior.hs
Haskell
bsd-3-clause
3,968
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Config.Kde -- Copyright : (c) Spencer Janssen <spencerjanssen@gmail.com> -- License : BSD -- -- Maintainer : Spencer Janssen <spencerjanssen@gmail.com> ...
f1u77y/xmonad-contrib
XMonad/Config/Kde.hs
Haskell
bsd-3-clause
1,683
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Distribution.Solver.Types.Settings ( ReorderGoals(..) , IndependentGoals(..) , AvoidReinstalls(..) , ShadowPkgs(..) , StrongFlags(..) , EnableBackjumping(..) ) where import Distribution.Simple.Setup ( BooleanF...
bennofs/cabal
cabal-install/Distribution/Solver/Types/Settings.hs
Haskell
bsd-3-clause
1,091
module Main where double x = x + x
frankiesardo/seven-languages-in-seven-weeks
src/main/haskell/day1/double.hs
Haskell
apache-2.0
40
<?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="fa-IR"> <title>Front-End Scanner | ZAP Extension</title> <maps> <homeID>top</homeID> <m...
thc202/zap-extensions
addOns/frontendscanner/src/main/javahelp/org/zaproxy/zap/extension/frontendscanner/resources/help_fa_IR/helpset_fa_IR.hs
Haskell
apache-2.0
978
{-# LANGUAGE MagicHash, UnboxedTuples #-} -- | FFI and hmatrix helpers. -- -- Sample usage, to upload a perspective matrix to a shader. -- -- @ glUniformMatrix4fv 0 1 (fromIntegral gl_TRUE) \`appMatrix\` perspective 0.01 100 (pi\/2) (4\/3) -- @ -- module Data.Packed.Foreign ( app , appVector, appVectorLen ...
mightymoose/liquidhaskell
benchmarks/hmatrix-0.15.0.1/lib/Data/Packed/Foreign.hs
Haskell
bsd-3-clause
3,201
module BadExprArg where {-@ type ListN a N = {v:[a] | len v = N} @-} {-@ foo :: ListN 0 0 @-} foo :: [a] foo = undefined
mightymoose/liquidhaskell
tests/crash/BadExprArg.hs
Haskell
bsd-3-clause
123
{-# LANGUAGE ImplicitParams, RankNTypes #-} -- Trac #1445 module Bug where f :: () -> (?p :: ()) => () -> () f _ _ = () g :: (?p :: ()) => () g = f () ()
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_compile/tc230.hs
Haskell
bsd-3-clause
158
{-# LANGUAGE BangPatterns #-} -- -- The Computer Language Benchmarks Game -- http://benchmarksgame.alioth.debian.org/ -- -- Contributed by Don Stewart -- Parallelized by Louis Wasserman import System.Environment import Control.Monad import System.Mem import Data.Bits import Text.Printf import GHC.Conc -- -- an artifi...
beni55/ghcjs
test/nofib/shootout/binary-trees/Main.hs
Haskell
mit
1,919
-- Test purpose: -- -- Ensure the plural "s" in warnings is only shown if there are more than -- one entries {-# OPTIONS_GHC -Wredundant-constraints #-} {-# OPTIONS_GHC -Wtype-defaults #-} module PluralS () where -- Defaulting type classes defaultingNum = 123 `seq` () defaultingNumAndShow = show 123 -- Redund...
ezyang/ghc
testsuite/tests/warnings/should_compile/PluralS.hs
Haskell
bsd-3-clause
478
-- Test for #1617 module T1617 where import Prelude () import Control.Monad (mplus) import qualified Control.Monad (mplus)
urbanslug/ghc
testsuite/tests/ghci/scripts/ghci027_1.hs
Haskell
bsd-3-clause
123
-- !!! tests calls of `error' (that make calls of `error'...) -- main = error ("1st call to error\n"++( error ("2nd call to error\n"++( error ("3rd call to error\n"++( error ("4th call to error\n"++( error ("5th call to error\n"++( error ("6th call to error" )))))))))))
sdiehl/ghc
testsuite/tests/codeGen/should_run/cgrun016.hs
Haskell
bsd-3-clause
313
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-| Copyright : (c) Microsoft License : MIT Maintainer : adamsap@microsoft.com Stability : alpha Portability : portable The module exports the built-in code g...
upsoft/bond
compiler/src/Language/Bond/Codegen/Templates.hs
Haskell
mit
1,705
module Hircules.Directories ( -- dirname, basename, makeDirectory) where import Control.Monad (unless) import System.Directory (createDirectory, doesDirectoryExist) --import System.FilePath -- dirname :: FilePath -> FilePath -- dirname = joinSegments . init . p...
juhp/hircules
src/Hircules/Directories.hs
Haskell
mit
909
module Data.PackedSet where import qualified Data.Set as ST import qualified Data.Map as MP data PackedSet a = PackedSet -- Total number of elements, including interval elements. { psSize :: Int -- Primary interval ends. , psPrimaryIv :: (a,a) -- Lower end of all ...
adizere/nifty-sets
src/Data/PackedSet.hs
Haskell
mit
5,293
module JSError ( JSError (..) , ThrowsError , IOThrowsError , liftThrows , throwError , liftIO , runExceptT ) where import Control.Monad.Except import JSEntity (JSExpression, JSStatement, JSVal) import Text.Megaparsec.Error (ParseError) data JSError = NumArgs Intege...
li-zhirui/JSAnalyzer
JSError.hs
Haskell
mit
1,950
module Simulation.Node ( Node (endpoints, counter) , Hostname , Port , Simulation.Node.create , createEndpoint , removeEndpoint , activateHttpServices , as ) where import Control.Applicative ((<$>), (<*>)) import Control.Concurrent.Async (Async, async) imp...
kosmoskatten/programmable-endpoint
src/Simulation/Node.hs
Haskell
mit
2,503
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} module Betfair.APING.Types.TimeRange ( TimeRange(.....
joe9/betfair-api
src/Betfair/APING/Types/TimeRange.hs
Haskell
mit
801
module Main where import Solidran.Lexf.Detail main :: IO () main = do alphabet <- (getLine >>= (return . filter (/= ' '))) n <- (getLine >>= (return . read)) mapM_ (putStrLn) $ getAlphabetStrings n alphabet
Jefffrey/Solidran
src/Solidran/Lexf/Main.hs
Haskell
mit
234
module HttpStuff where import Data.ByteString.Lazy hiding (map) import Network.Wreq urls :: [String] urls = [ "http://httpbin.com/ip" , "http://httpbin.com/bytes/g" ] mappingGet :: [IO (Response ByteString)] mappingGet = map get urls -- better than the above traversedUrls :: IO [Response Byte...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter21.hsproj/HttpStuff.hs
Haskell
mit
365
{-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Control.Applicative ((<$>), (<*>)) import Control.Monad import Control.Monad...
Philonous/d-bus
tests/Main.hs
Haskell
mit
10,373
import System.IO import System.Process main = do (_, Just hout, Just herr, jHandle) <- -- Replace with some other command on Windows createProcess (proc "/bin/date" args) { cwd = Just "." , std_out = CreatePipe , std_err = CreatePipe } where a...
tjakway/blackjack-simulator
main/ErrorFilter.hs
Haskell
mit
329
module Utils.List ( takeWhileInclusive, listToInt ) where -- Same as take while, but includes the element that we terminate on. -- E.g. takeWhileInclusive (/=3) [1,2,3,4] -> [1,2,3] takeWhileInclusive :: (a -> Bool) -> [a] -> [a] takeWhileInclusive _ [] = [] takeWhileInclusive p (x:xs) = x : if p x then takeWhi...
daniel-beard/projecteulerhaskell
Problems/Utils/list.hs
Haskell
mit
581
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} -- | Common handler functions. module Handler.Common where import Data.FileEmbed...
rgrempel/frelm.org
src/Handler/Common.hs
Haskell
mit
5,102
module Geometry.Polygon where import Algebra.Matrix as M import Algebra.Vector as V import Control.Exception.Base import qualified Data.Graph.Extensions as Graph import Data.List as List import Data.List.Extensions as ListExt import Data.Map as Map import Data.Maybe as Maybe import Data.Ratio as Ratio import Data.Set ...
stevedonnelly/haskell
code/Geometry/Polygon.hs
Haskell
mit
9,621
{-# LANGUAGE GADTs #-} {-# OPTIONS_GHC -fno-do-lambda-eta-expansion #-} module Text.Regex.Applicative.Compile (compile) where import Control.Monad.Trans.State import Text.Regex.Applicative.Types import Control.Applicative import Data.Maybe import qualified Data.IntMap as IntMap compile :: RE s a -> (a -> [Thread s r]...
mitchellwrosen/regex-applicative
Text/Regex/Applicative/Compile.hs
Haskell
mit
4,683
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module Problem08 (partA, partB) where import Data.List import Control.Lens import Text.Megaparsec hiding (State) import Text.Megaparsec.Strin...
edwardwas/adventOfCodeTwo
src/Problem08.hs
Haskell
mit
2,697
{-# LANGUAGE ExistentialQuantification, FlexibleContexts, RankNTypes, ScopedTypeVariables, UndecidableInstances #-} module World.Utils ( actionDirection, cellAgent, cellWumpus, cellEntity, cellHas, light, light', numItems, shortestPaths, searchPaths, dist, coordDis...
jtapolczai/wumpus
World/Utils.hs
Haskell
apache-2.0
13,859
{- © Utrecht University (Department of Information and Computing Sciences) -} module Domain.Scenarios.Services.ExtraServices where import Control.Arrow import Data.Maybe import Ideas.Common.Library import Ideas.Service.State import Domain.Scenarios.Expression import Domain.Scenarios.Globals import Domain.Scenarios....
UURAGE/ScenarioReasoner
src/Domain/Scenarios/Services/ExtraServices.hs
Haskell
apache-2.0
2,881
{-# OPTIONS -fglasgow-exts -#include "../include/gui/qtc_hs_QItemSelection.h" #-} ----------------------------------------------------------------------------- {-| Module : QItemSelection.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:14 ...
uduki/hsQt
Qtc/Gui/QItemSelection.hs
Haskell
bsd-2-clause
4,210
module RaptrSpec where import Network.Raptr.Raptr import Test.Tasty import Test.Tasty.Hspec raptrSpec = describe "Raptr" $ do it "runs 3 node cluster" $ do result <- runRaptr result `shouldBe` True
capital-match/raptr
test/RaptrSpec.hs
Haskell
bsd-3-clause
243
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| This module contains logic for converting Dhall expressions to and...
Gabriel439/Haskell-Dhall-Library
dhall/src/Dhall/Binary.hs
Haskell
bsd-3-clause
47,233
-------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.Functions -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- All raw functions fro...
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions.hs
Haskell
bsd-3-clause
2,781
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.EXT.SemaphoreFd -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability ...
haskell-opengl/OpenGLRaw
src/Graphics/GL/EXT/SemaphoreFd.hs
Haskell
bsd-3-clause
723
-- usage: runhaskell CopyToUsbDrive.hs live-image.iso /dev/sdX -- -- This will copy the live-image.iso to your USB thumb drive. It will further -- add a partition on your bootable USB thumb drive that can be used by -- Windows. Therefore it will first remove the existing Live-Linux partition -- then create a new partit...
KaiHa/debian-live
CopyToUsbDrive.hs
Haskell
bsd-3-clause
5,652
module Plot.Utils where import Data.Colour import Data.Colour.Names import Control.Lens import Data.Default.Class import Graphics.Rendering.Chart line_e, line_t, line_d :: LineStyle line_e = line_color .~ withOpacity red 0.8 $ line line_t = line_color .~ withOpacity blue 0.8 $ line line_d = line_color .~ withOpac...
finlay/random-dist
test/Plot/Utils.hs
Haskell
bsd-3-clause
1,265
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell import Prelude hiding (snd, fst) data ST a s = S (s -> (a, s)) [lq| data ST a s <pre :: s -> Prop, post :: a -> s -> Prop> = S (ys::(x:s<pre> -> ((a, s)<post>))) |] [lq| returnST :: forall <pre :: s -> Prop, post :: a -> s -> Prop>. xStat...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/State.hs
Haskell
bsd-3-clause
947
module FireLogic where import Data.List (find) import Data.Maybe (isNothing, fromMaybe) import Types onlyShallow :: [RequestParameter] -> Bool onlyShallow opts | (shallowIn && (length opts) == 1) || (not shallowIn) = True | otherwise = error "Shallow must be the only parameter" wh...
sphaso/firebase-haskell-client
src/FireLogic.hs
Haskell
bsd-3-clause
2,743
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE QuasiQuotes #-} module Tests.Mitsuba.Class where import Mitsuba.Class import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.TH import Data.Text (Text) import Test.HUnit import GHC.Generics import D...
jfischoff/hs-mitsuba
tests/Tests/Mitsuba/Class.hs
Haskell
bsd-3-clause
2,328
-- | -- Module : $Header$ -- Copyright : (c) 2013-2014 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable -- -- This module defines natural numbers with an additional infinity -- element, and various arithmetic operators on them. {...
dylanmc/cryptol
src/Cryptol/TypeCheck/Solver/InfNat.hs
Haskell
bsd-3-clause
4,834
{-# LANGUAGE DeriveDataTypeable #-} module SayAnnNames (plugin, SomeAnn(..)) where import GhcPlugins import Control.Monad (unless) import Data.Data data SomeAnn = SomeAnn deriving (Data, Typeable) plugin :: Plugin plugin = defaultPlugin { installCoreToDos = install } install :: [CommandLineOption] -> [CoreToDo] ...
sdiehl/ghc
testsuite/tests/plugins/annotation-plugin/SayAnnNames.hs
Haskell
bsd-3-clause
1,103
{-# OPTIONS_HADDOCK hide #-} -- | -- Module : Streamly.Internal.Data.Strict -- Copyright : (c) 2019 Composewell Technologies -- (c) 2013 Gabriel Gonzalez -- License : BSD3 -- Maintainer : streamly@composewell.com -- Stability : experimental -- Portability : GHC -- -- | Strict data types to ...
harendra-kumar/asyncly
src/Streamly/Internal/Data/Strict.hs
Haskell
bsd-3-clause
2,125
{- ShadowMap.hs (adapted from shadowmap.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 -} import Control.Monad ( when, unless ) import Data.IORef ( IO...
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/examples/RedBook/ShadowMap.hs
Haskell
bsd-3-clause
8,315
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module API where ------------------------------------------------------------------------------ import Control.Monad (mzero) import qualified Data.Aeson as A import Data.Ae...
CBMM/CBaaS
cbaas-lib/src/API.hs
Haskell
bsd-3-clause
3,248
{-# LANGUAGE RankNTypes #-} -- | The following module implements -- /Compact Hilbert Indices - Technical Report -- CS-2006-07/ -- by Chris Hamilton. At the time of writing this comment, the document is -- found at: -- <https://www.cs.dal.ca/sites/default/files/technical_reports/CS-2006-07.pdf> -- module Data.A...
cje/hilbert
src/Data/Algorithm/Hilbert/Utility.hs
Haskell
bsd-3-clause
8,561
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} -- | The event mode lets you manage your own input. -- Pressing ESC will still closes the window, but you don't get automatic -- pan and zoom controls like with 'graphicsout'. Should only be called once -- dur...
christiaanb/fpprac
src/FPPrac/Events.hs
Haskell
bsd-3-clause
14,107
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} -- | The Employee-Department schema used in th...
ulricha/dsh-tpc-h
Schema/Shredding.hs
Haskell
bsd-3-clause
1,842
-- | A queue of passive critical pairs, using a memory-efficient representation. {-# LANGUAGE TypeFamilies, RecordWildCards, FlexibleContexts, ScopedTypeVariables, StandaloneDeriving #-} module Twee.PassiveQueue( Params(..), Queue, Passive(..), empty, insert, removeMin, mapMaybe, toList, queueSize) where impor...
nick8325/kbc
src/Twee/PassiveQueue.hs
Haskell
bsd-3-clause
7,693
{-# LANGUAGE LambdaCase #-} -- | -- Module : Game.Simulation.Input -- Description : Contains input related functions and signals -- for the game simulation -- Copyright : (c) 2016 Caitlin Wilks -- License : BSD3 -- Maintainer : Caitlin Wilks <mitasuki@gmail.com> -- -- module Game.Si...
Catchouli/tyke
src/Game/Simulation/Input.hs
Haskell
bsd-3-clause
7,874
{-# LANGUAGE ViewPatterns #-} -- | The endpoints on the cloud server module Development.Shake.Internal.History.Bloom( Bloom, bloomTest, bloomCreate ) where import Data.Word import Data.Bits import Data.Hashable import Data.Semigroup import Foreign.Storable import Foreign.Ptr import Prelude -- | Given an Int...
ndmitchell/shake
src/Development/Shake/Internal/History/Bloom.hs
Haskell
bsd-3-clause
1,552
module Main where putHello :: String -> IO () putHello x = putStrLn ("Hello " ++ x) main :: IO () main = putHello "Fragnix!"
phischu/fragnix
tests/quick/HiFragnix/HiFragnix.hs
Haskell
bsd-3-clause
126
{- | Module : Camfort.Specification.Units.Parser.Types Description : Defines the representation of unit specifications resulting from parsing. Copyright : (c) 2017, Dominic Orchard, Andrew Rice, Mistral Contrastin, Matthew Danish License : Apache-2.0 Maintainer : dom.orchard@gmail.com Stability : e...
dorchard/camfort
src/Camfort/Specification/Units/Parser/Types.hs
Haskell
apache-2.0
1,869