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 |
|---|---|---|---|---|---|
import Test.QuickCheck
main :: IO ()
main = putStrLn "Test suite not yet implemented"
| nozaq/programming-in-haskell | test/Spec.hs | Haskell | mit | 87 |
-- | Modular wrapper around Posix signal handlers
--
-- This module is only included in the .cabal file when we are not on Windows.
module Pos.Infra.Util.SigHandler
( Signal(..)
, installHandler
, uninstallAllHandlers
) where
import Universum
import Control.Concurrent (... | input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/Util/SigHandler.hs | Haskell | mit | 3,250 |
-- |
-- Module : Criterion.Main
-- Copyright : (c) 2009-2014 Bryan O'Sullivan
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- Wrappers for compiling and running benchmarks quickly and easily.
-- See 'defaultMain' below for an example.
mo... | paulolieuthier/criterion | Criterion/Main.hs | Haskell | bsd-2-clause | 7,392 |
-------------------------------------------------------------------------------
--
-- Module : Yesod.Feed
-- Copyright : Patrick Brisbin
-- License : as-is
--
-- Maintainer : Patrick Brisbin <me@pbrisbin.com>
-- Stability : Stable
-- Portability : Portable
--
-- Generic Feed and Feed Entry dat... | chreekat/yesod | yesod-newsfeed/Yesod/Feed.hs | Haskell | bsd-2-clause | 1,220 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1998
\section[PatSyn]{@PatSyn@: Pattern synonyms}
-}
{-# LANGUAGE CPP #-}
module PatSyn (
-- * Main data types
PatSyn, mkPatSyn,
-- ** Type deconstruction
patSynName, patSynArity, patSynIsInfix,
... | shlevy/ghc | compiler/basicTypes/PatSyn.hs | Haskell | bsd-3-clause | 16,364 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE Constr... | juhp/stack | src/Stack/Types/Package.hs | Haskell | bsd-3-clause | 16,867 |
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Network.BitTorrent.Tracker.TestData
( TrackerEntry (..)
, isUdpTracker
, isHttpTracker
, trackers
, badTracker
) where
import Data.Maybe
import Data.String
import Network.URI
import Data.Torrent
d... | DavidAlphaFox/bittorrent | tests/Network/BitTorrent/Tracker/TestData.hs | Haskell | bsd-3-clause | 2,679 |
<?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="it-IT">
<title>DOM XSS Active Scan Rule | ZAP Extension</title>
<maps>
<homeID>top</homeID>... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/domxss/resources/help_it_IT/helpset_it_IT.hs | Haskell | apache-2.0 | 986 |
-------------------------------------------------------------------------------
-- |
-- Module : System.Hardware.Haskino.Test.ExprWord8
-- Copyright : (c) University of Kansas
-- License : BSD3
-- Stability : experimental
--
-- Quick Check tests for Expressions returning a Expr Word8
------------------... | ku-fpg/kansas-amber | tests/ExprTests/IfThenElseWord8.hs | Haskell | bsd-3-clause | 1,353 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
module Database.Persist.Sql.Migration
( parseMigration
, parseMigration'
, printMigration
, showMigration
, getMigration
, runMigration
, runMigrationSilent
, runMigrationUnsafe
, migrate
) where
import Control.Monad.Trans.Control (MonadBaseCo... | mitchellwrosen/persistent | persistent/Database/Persist/Sql/Migration.hs | Haskell | mit | 4,181 |
<?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="da-DK">
<title>Getting started Guide</title>
<maps>
<homeID>top</homeID>
<mapref locati... | thc202/zap-extensions | addOns/gettingStarted/src/main/javahelp/org/zaproxy/zap/extension/gettingStarted/resources/help_da_DK/helpset_da_DK.hs | Haskell | apache-2.0 | 964 |
module A2 where
import C2
import D2
sumSq xs
= ((sum (map (sq sq_f) xs)) + (sumSquares xs)) +
(sumSquares1 xs)
sq_f_2 = 2
main = sumSq [1 .. 4]
| kmate/HaRe | old/testing/addOneParameter/A2AST.hs | Haskell | bsd-3-clause | 167 |
{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
--
-- The register allocator
--
-- (c) The University of Glasgow 2004
--
-----------------------------------------------------------------------------
{-
The algorithm is roughly:
1... | ezyang/ghc | compiler/nativeGen/RegAlloc/Linear/Main.hs | Haskell | bsd-3-clause | 37,857 |
module SafeLang14_A (IsoInt, h, showH, P, p, showP) where
newtype IsoInt = I Int
h :: IsoInt
h = I 2
showH :: String
showH = let I n = h
in show n
data P = P Int
p :: P
p = P 3
showP :: P -> String
showP (P n) = "Should be 3 := " ++ show n
| hferreiro/replay | testsuite/tests/safeHaskell/safeLanguage/SafeLang14_A.hs | Haskell | bsd-3-clause | 255 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE Unsafe #-}
{-# OPTIONS_HADDOCK not-home #-}
-------------------------------------------------------------------------... | urbanslug/ghc | libraries/base/GHC/Natural.hs | Haskell | bsd-3-clause | 21,893 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
module TcCustomSolverSuper where
import GHC.TypeLits
import Data.Typeable
{-
When solving super-class instances, GHC solves the evidence without
using the solver (see `tcSuperClasses` in `TcInstDecls`).
However, some classes need to be excepted from this... | wxwxwwxxx/ghc | testsuite/tests/typecheck/should_compile/TcCustomSolverSuper.hs | Haskell | bsd-3-clause | 528 |
{-# LANGUAGE OverloadedStrings #-}
module IO where
import Prelude hiding (readFile, putStrLn)
import Control.Monad (mzero)
import Data
import Data.Map.Lazy hiding (foldl, map, maximum, member, size)
import Data.Text.Lazy hiding (empty, foldl, map, maximum)
import Data.Aeson
import Data.ByteString.Lazy hiding (empty, f... | marcellussiegburg/icfp-2015 | IO.hs | Haskell | mit | 2,757 |
module RandomExample1 where
import System.Random
data Die = DieOne | DieTwo | DieThree | DieFour | DieFive | DieSix deriving (Eq, Show)
intToDie :: Int -> Die
intToDie n =
case n of
1 -> DieOne
2 -> DieTwo
3 -> DieThree
4 -> DieFour
5 -> DieFive
6 -> DieSix
x -> error $ "intTo... | JoshuaGross/haskell-learning-log | Code/Haskellbook/State/src/RandomExample1.hs | Haskell | mit | 584 |
module Oden.Go.PrettySpec where
import Oden.Go.Identifier
import Oden.Go.AST
import Oden.Go.Type
import Oden.Go.Pretty ()
import Text.PrettyPrint.Leijen
import Test.Hspec
shouldPrintAs x s = displayS (renderPretty 0.4 100 (pretty x)) "" `shouldBe` s
ident... | AlbinTheander/oden | test/Oden/Go/PrettySpec.hs | Haskell | mit | 6,869 |
module Main (main) where
import Network.Hstack
import Network.Hstack.Internal
import Control.Monad.Identity
import Control.Monad.State.Lazy
import qualified Data.ByteString as BS
import Data.Maybe
import Test.Framework.Providers.QuickCheck2
import Test.Framework (defaultMain)
test_1 = let
a :: OutcomeT Maybe Int
... | davidhinkes/hstack | tests/Test.hs | Haskell | mit | 726 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ViewPatterns #-}
module Hanabi.Client
( startClient
) where
import Control.Concurrent.Async (async, cancel)
import Control.Concurrent.MVar
(MVar, newEmptyMVar, put... | TimoFreiberg/hanabi | src/Hanabi/Client.hs | Haskell | mit | 4,025 |
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Test.Relation
-- Copyright : (c) Andrey Mokhov 2016-2022
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
--
-- Testsuite for "Algebra.Graph.Re... | snowleopard/alga | test/Algebra/Graph/Test/Relation.hs | Haskell | mit | 2,086 |
module Settings.Flavours.Quickest (quickestFlavour) where
import Flavour
import Expression
import {-# SOURCE #-} Settings.Default
quickestFlavour :: Flavour
quickestFlavour = defaultFlavour
{ name = "quickest"
, args = defaultBuilderArgs <> quickestArgs <> defaultPackageArgs
, libraryWays = ... | izgzhen/hadrian | src/Settings/Flavours/Quickest.hs | Haskell | mit | 681 |
module Main where
import Server
main :: IO ()
main = startServer
| evansb/sacred | sacred/Main.hs | Haskell | mit | 68 |
-- |
-- Module: AI.Fann.Types
-- Copyright: (C) 2016 Patrik Sandahl
-- Licence: MIT
-- Maintainer: Patrik Sandahl <patrik.sandahl@gmail.com>
-- Stability: experimental
-- Portability: Linux
module AI.Fann.Types
( ActivationFunction (..)
, InputData
, OutputData
, activationToInt
) whe... | kosmoskatten/hfann | src/AI/Fann/Types.hs | Haskell | mit | 1,812 |
----------
-- Functor
----------
class Functor f where
fmap :: (a -> b) -> f a -> f b
instance Functor ((->) r) where
fmap = (.)
--lifting a function
----------------------
-- Applicative Functor
----------------------
class (Functor f) => Applicative f where
pure :: a -> f a
(<*>) :: f (a -> b) ->... | zxl20zxl/learnyouahaskell | Typeclasses.hs | Haskell | mit | 924 |
module Print3 where
myGreeting :: String
myGreeting = "hello" ++ "world!"
hello :: String
hello = "hello"
world :: String
world = "world!"
main :: IO ()
main = do
putStrLn myGreeting
putStrLn secondGreeting
where secondGreeting = concat [hello, " ", world]
| raventid/coursera_learning | haskell/print3.hs | Haskell | mit | 267 |
module Hpcb.Data.KicadPCB (
kicadPCB
) where
import Hpcb.SExpr
import Hpcb.Data.Circuit
import Hpcb.Data.NetNumbering
import Hpcb.Data.Net
-- | Generates the general section from a given circuit.
general :: Circuit -> Item
general c@(Circuit f g s) = Item "general" [
Item "links" [PInt 0],
Item "no_connects" [P... | iemxblog/hpcb | src/Hpcb/Data/KicadPCB.hs | Haskell | mit | 4,773 |
module ACME.Yes.PreCure5.GoGo
( module ACME.Yes.PreCure5.GoGo.Profiles
, isPreCure5GoGo
) where
import ACME.Yes.PreCure5.GoGo.Profiles
import ACME.Yes.PreCure5.GoGo.Parser
| igrep/yes-precure5-command | ACME/Yes/PreCure5/GoGo.hs | Haskell | mit | 179 |
module Polynomial.A330542Spec (main, spec) where
import Test.Hspec
import Polynomial.A330542 (a330542)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A330542" $
it "correctly computes the first 20 elements" $
map a330542 [2..21] `shouldBe` expectedValue where
expectedValue = [2,6,12,30,60,1... | peterokagey/haskellOEIS | test/Polynomial/A330542Spec.hs | Haskell | apache-2.0 | 397 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Openshift.V1.NamedTagEventList where
import GHC.Generics
import Data.Text
import Openshift.V1.TagEvent
import Openshift.V1.TagEventCondition
im... | minhdoboi/deprecated-openshift-haskell-api | openshift/lib/Openshift/V1/NamedTagEventList.hs | Haskell | apache-2.0 | 723 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QGraphicsScene.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:34
Warning : this file is machine generated - d... | keera-studios/hsQt | Qtc/Enums/Gui/QGraphicsScene.hs | Haskell | bsd-2-clause | 6,183 |
-- http://www.codewars.com/kata/545f05676b42a0a195000d95
module RankVector where
import Data.List
import Data.Maybe
ranks :: Ord a => [a] -> [Int]
ranks xs = map (succ . fromJust . flip elemIndex ys) xs where
ys = sortBy (flip compare) xs | Bodigrim/katas | src/haskell/6-Rank-Vector.hs | Haskell | bsd-2-clause | 242 |
{-|
Module : Grammar.MC
Description : Definition of the MC monad.
Copyright : (c) Davide Mancusi, 2017
License : BSD3
Maintainer : arekfu@gmail.com
Stability : experimental
Portability : POSIX
This module exports the 'MC' (Monte Carlo) monad, which can be used to stream
the pseudo-random number generator... | arekfu/grammar-haskell | src/Grammar/MC.hs | Haskell | bsd-3-clause | 4,936 |
module Misc where
import Control.Applicative
import System.Directory
import System.FilePath
import Data.List
feither :: Either a b -> (a -> c) -> (b -> c) -> c
feither e f g = either f g e
fmaybe :: Maybe a -> b -> (a -> b) -> b
fmaybe m f g = maybe f g m
dotMo :: String -> ... | bergmark/mmdoc | src/Misc.hs | Haskell | bsd-3-clause | 559 |
module Main where
import HW3Test (hw3Tests)
import HW4Test (hw4Tests)
import HW5Test (hw5Tests)
import HW6Test (hw6Tests)
import HW7Test (hw7Tests)
import HW8Test (hw8Tests)
import HW10Test (hw10Tests)
import HW11Test ... | cgag/cis-194-solutions | test/Main.hs | Haskell | bsd-3-clause | 880 |
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
-- Haskell implementation of H2O's priority queue.
-- https://github.com/h2o/h2o/blob/master/lib/http2/scheduler.c
module RingOfQueues (
Entry
, newEntry
, renewEntry
, ... | kazu-yamamoto/http2 | bench-priority/RingOfQueues.hs | Haskell | bsd-3-clause | 4,292 |
{-# LANGUAGE PackageImports #-}
module Text.ParserCombinators.ReadP (module M) where
import "base" Text.ParserCombinators.ReadP as M
| silkapp/base-noprelude | src/Text/ParserCombinators/ReadP.hs | Haskell | bsd-3-clause | 138 |
module VisualizationData.Queue.Bankers where
import VisualizationData.Queue.Interface
import qualified Data.List as L
import qualified VisualizationData.LenList as LL
data BQueue a
= BQueue
{ heads :: LL.LenList a
, tails :: LL.LenList a
}
instance Show a => Show (BQueue a) where
show q =
"fromList " +... | timjb/pfds-visualizations | src/VisualizationData/Queue/Bankers.hs | Haskell | bsd-3-clause | 1,779 |
{-# LANGUAGE QuasiQuotes #-}
module Main where
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit (Assertion, (@?=))
import qualified Data.ByteString.Char8 as B
import Data.Loc (SrcLoc, noLoc, startPos)
import Control.Exception (SomeException)
import Language.C.Quote.C
import qualified Lan... | flowbox-public/language-c-quote | tests/unit/Main.hs | Haskell | bsd-3-clause | 15,024 |
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
module Data.Logic.Atomic.Class where
import Data.Functor.Identity
import Data.Functor.Compose
class Atomic a r | r -> a where
atom :: a -> r
data AnyAtomic a = AnyAtomic
... | kylcarte/finally-logical | src/Data/Logic/Atomic/Class.hs | Haskell | bsd-3-clause | 1,629 |
{-# Language StandaloneDeriving, PatternGuards, CPP, OverloadedStrings #-}
module CabalBounds.Main
( cabalBounds
) where
import Distribution.PackageDescription (GenericPackageDescription)
import Distribution.PackageDescription.Parsec (parseGenericPackageDescription, runParseResult)
import Distribution.Parsec.Co... | dan-t/cabal-bounds | lib/CabalBounds/Main.hs | Haskell | bsd-3-clause | 11,070 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Ordinal.KM.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
import D... | facebookincubator/duckling | tests/Duckling/Ordinal/KM/Tests.hs | Haskell | bsd-3-clause | 504 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
module FPNLA.Operations.BLAS.Strategies.SYRK.Strategies.DefPar () where
import Control.DeepSeq (NFData)
import Con... | mauroblanco/fpnla-examples | src/FPNLA/Operations/BLAS/Strategies/SYRK/Strategies/DefPar.hs | Haskell | bsd-3-clause | 2,176 |
{-# LANGUAGE CPP, ScopedTypeVariables #-}
module TcErrors(
reportUnsolved, reportAllUnsolved, warnAllUnsolved,
warnDefaulting,
solverDepthErrorTcS
) where
#include "HsVersions.h"
import TcRnTypes
import TcRnMonad
import TcMType
import TcType
import RnEnv( unknownNameSuggestions )
import Type
... | oldmanmike/ghc | compiler/typecheck/TcErrors.hs | Haskell | bsd-3-clause | 101,589 |
{-# LANGUAGE PackageImports #-}
import "hs-yesod-proto-nucleus" Application (develMain)
import Prelude (IO)
main :: IO ()
main = develMain
| Greif-IT/hs-yesod-proto | hs-yesod-proto-nucleus/app/devel.hs | Haskell | bsd-3-clause | 140 |
module Cipher where
import Data.Char
-- Loops Int values through a specified range
modRange :: Int -> Int -> Int -> Int
modRange min max val = mod (val - min) (max - min + 1) + min
-- 'modRange' for lowercase alphabetic characters
alphaLower :: Int -> Int
alphaLower = modRange 97 122
-- caesar cipher for single Cha... | pdmurray/haskell-book-ex | src/ch9/Cipher.hs | Haskell | bsd-3-clause | 608 |
{-# LANGUAGE NoMonomorphismRestriction #-}
module Backend.InductiveGraph.Proto1 where
import Backend.InductiveGraph.Draw
import Backend.InductiveGraph.DrawTIKZ
import Backend.InductiveGraph.InductiveGraph
import Backend.InductiveGraph.PrintLatex
import Backend.InductiveGraph.Probability
import Data.Graph.Inductive.Gr... | vzaccaria/bddtool | src/Backend/InductiveGraph/Proto1.hs | Haskell | bsd-3-clause | 1,685 |
module Insomnia.Main.Command where
import System.Environment (getArgs)
data Command =
Typecheck !FilePath
| Gamble !FilePath
| HelpUsage
processArguments :: IO Command
processArguments = do
args <- getArgs
case args of
[arg] | arg == "--help" -> return HelpUsage
| otherwise -> return $ Typech... | lambdageek/insomnia | src/Insomnia/Main/Command.hs | Haskell | bsd-3-clause | 476 |
{-# LANGUAGE OverloadedStrings #-}
module Bead.View.Content.EvaluationTable.Page (
evaluationTable
) where
import Control.Monad
import Data.Function (on)
import Data.List (sortBy)
import Data.Maybe (fromMaybe)
import Data.Map (Map)
import qualified Data.Map as Ma... | andorp/bead | src/Bead/View/Content/EvaluationTable/Page.hs | Haskell | bsd-3-clause | 6,839 |
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Text.Template
main :: IO ()
main = do
t <- T.readFile "samples/sample1.tp"
mr <- template convert get t
maybe (return ()) T.putStr mr
convert :: T.Text -> [T.Text]
convert "name" = ["Yoshikuni", "Kazuhiro... | YoshikuniJujo/template | tests/test2t.hs | Haskell | bsd-3-clause | 496 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for ganeti-htools.
-}
{-
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 permitted provided that the following condit... | mbakke/ganeti | test/hs/Test/Ganeti/HTools/Backend/Text.hs | Haskell | bsd-2-clause | 13,376 |
{-# OPTIONS_HADDOCK prune #-}
-- |
-- This package is deprecated, use Doctest`s cabal integration instead.
--
-- See: <https://github.com/sol/doctest-haskell#cabal-integration>
module Test.Framework.Providers.DocTest (docTest) where
import qualified Test.DocTest as DocTest
import Test.Framework
import Test.Framework.P... | sakari/test-framework-doctest | src/Test/Framework/Providers/DocTest.hs | Haskell | bsd-3-clause | 1,350 |
{-|
Provides functions to establish connections, both passively and actively, with Openflow switches.
-}
module Network.Data.OF13.Server
( Switch(..)
, Factory
, runServer
, runServerOne
, sendMessage
, talk
, talk2
, connectToSwitch
) where
import Control... | AndreasVoellmy/openflow | src/Network/Data/OF13/Server.hs | Haskell | bsd-3-clause | 3,323 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[PrelNames]{Definitions of prelude modules and names}
Nota Bene: all Names defined in here should come from the base package
- ModuleNames for prelude modules,
e.g. pREL_BASE_Name :: ModuleName
- Modules for prelude modules
e... | oldmanmike/ghc | compiler/prelude/PrelNames.hs | Haskell | bsd-3-clause | 100,843 |
module Bead.View.Fay.Hooks where
import Prelude
import Bead.View.Fay.HookIds
data EvaluationHook = EvaluationHook {
evFormId :: String
, evSelectionId :: String
, evHiddenValueId :: String
, evSelectionDivId :: String
, evHelpMessageId :: String
}
{-
createCourseHook = EvaluationHook {
e... | pgj/bead | snaplets/fay/src/Bead/View/Fay/Hooks.hs | Haskell | bsd-3-clause | 2,541 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
module Clang.Type
( isSameType
, getTypeSpelling
, getKind
, getCanonicalType
, getPointeeType
, getResultType
, getNumArgTypes
, getArgType
, isFunctionTypeVariadic
, getTypedefDeclUnderlyingType
, getEnumDeclIntegerType
, getEnumConstantDeclValue
, ... | deech/LibClang | src/Clang/Type.hs | Haskell | bsd-3-clause | 5,032 |
{-# LANGUAGE ExistentialQuantification #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Command
-- Copyright : Duncan Coutts 2007
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : non-portable (Existential... | trskop/cabal | Cabal/Distribution/Simple/Command.hs | Haskell | bsd-3-clause | 25,266 |
module DeepSeq2 where
import qualified Control.Parallel.Strategies as CP
fib t n
| n <= 1 = 1
| otherwise = n1_2 + n2_2 + 1
where
n1 = fib 20 (n-1)
n2 = fib 20 (n-2)
(n1_2, n2_2)
= CP.runEval
(do n1_2 <- (rpar_abs_1 `CP.dot` CP.rdeepseq) n1
... | RefactoringTools/HaRe | old/testing/introThreshold/DeepSeq2_TokOut.hs | Haskell | bsd-3-clause | 555 |
module DoExp2 where
f x = g undefined
g x = do
x <- getLine
putStrLn x
| kmate/HaRe | old/testing/foldDef/DoExpr2_TokOut.hs | Haskell | bsd-3-clause | 96 |
module T9441b where
f1 :: Integer -> Integer
f1 n
| n <= 1 = 1
| otherwise = go n 1
where
go 0 r = r
go m r = go (m - 1) (r * m)
f2 :: Integer -> Integer
f2 n = go n 1
where
go 0 s = s
go p s = go (p - 1) (s * p)
| sdiehl/ghc | testsuite/tests/simplCore/should_compile/T9441b.hs | Haskell | bsd-3-clause | 243 |
{-# LANGUAGE BangPatterns #-}
module Main where
import qualified Data.ByteString as S
import Data.IORef
import Control.Monad
makeBs :: Int -> S.ByteString
makeBs n = S.replicate n (fromIntegral n)
doStuff :: IORef [S.ByteString] -> Int -> IO ()
doStuff ref n = do
let !bs = makeBs n
modifyIORef ref (bs:)
{-# ... | ezyang/ghc | testsuite/tests/perf/should_run/T7257.hs | Haskell | bsd-3-clause | 691 |
module T5514 where
class Foo a where
foo :: a -> a
instance (Foo a, Foo b) => Foo (a, b) where
foo = foo' ()
-- foo' :: () -> b -> b
foo' es = const id (unitId es)
unitId :: () -> ()
unitId = id
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_compile/T5514.hs | Haskell | bsd-3-clause | 201 |
module Main where
import Data.Conduit ((=$), ($$))
import Control.Monad (guard, void)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Reader.Class (asks)
import Data.Conduit.Find
import qualified Data.Conduit.List as DCL
import Data.List (isSuffix... | jwiegley/find-conduit | test/find-hs.hs | Haskell | mit | 1,922 |
{-# LANGUAGE DeriveAnyClass, DeriveGeneric, FlexibleContexts,
MultiParamTypeClasses #-}
{- |
Module : System.JBI.Commands.Common
Description : How to handle build tools
Copyright : (c) Ivan Lazar Miljenovic
License : MIT
Maintainer : Ivan.Miljenovic@gmail.com
-}
module Syste... | ivan-m/jbi | lib/System/JBI/Commands/BuildTool.hs | Haskell | mit | 7,701 |
module GHCJS.DOM.SVGFEColorMatrixElement (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/SVGFEColorMatrixElement.hs | Haskell | mit | 53 |
{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
module Turtle (turtleDraw, turtleSimlate, Turtle(..), Command(..)) where
import Control.Arrow
import GHC.Float (double2Float)
import Graphics.Gloss
window :: String -> Display
window s = InWindow s (500,500) (30,30... | lesguillemets/lsyst.hs | src/Turtle.hs | Haskell | mit | 2,531 |
{-# LANGUAGE
TypeFamilies
#-}
{-|
Module : Text.ByoParser.Result
Description : Class of parsing results and drivers
Copyright : (c) 2016 Nicolas Godbout
License : MIT
Maintainer : nicolas.godbout@gmail.com
Stability : unstable
-}
module Text.ByoParser.Result (
-- * P... | DrNico/byoparser | Text/ByoParser/Result.hs | Haskell | mit | 2,818 |
module Lambency.GameSession (
TimeStep, GameSession,
physicsDeltaTime, physicsDeltaUTC, mkGameSession
) where
--------------------------------------------------------------------------------
import qualified Control.Wire as W
import GHC.Float
import Data.Time
import Lambency.Types
------------------------------... | Mokosha/Lambency | lib/Lambency/GameSession.hs | Haskell | mit | 683 |
module System.Himpy.Recipes.WinServices where
import System.Himpy.Recipes.Utils
import System.Himpy.Mib
import System.Himpy.Types
import System.Himpy.Logger
import System.Himpy.Output.Riemann
import Control.Concurrent.STM.TChan (TChan)
import qualified Data.Map as M
srv_rcp :: [String] -> TChan ([Metric]) -> TChan (St... | pyr/himpy | System/Himpy/Recipes/WinServices.hs | Haskell | mit | 711 |
module PWM where
import Data.List
import Data.List.Split
import Numeric.Container
import System.Random
import Util
-- | Data type for nucleotide and nucleotide sequences.
data Nucleotide = A | C | G | T deriving (Bounded, Enum, Eq, Ord, Read, Show)
type Sequence = [Nucleotide]
-- | Accumulates a list of associat... | fgrsnau/emgene | src/PWM.hs | Haskell | mit | 3,145 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Monad.State.Strict
import qualified Control.Monad.State.Lazy as SL
import Data.Function (on)
import Data.List (nub, nubBy)
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified MiniSet ... | nh2/haskell-ordnub | ordnub.hs | Haskell | mit | 12,905 |
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Constellation.Types where
import Control.Applicative
import Control.Monad.Base
import Control.Monad.Error
import Control.Monad.Logger
import Control.Monad.Reader
import ... | ClassyCoding/constellation-server | src/Constellation/Types.hs | Haskell | mit | 875 |
module Test.Week10 where
import Test.Tasty
import Test.Tasty.HUnit
import Week10
week10 :: TestTree
week10 = testGroup "Week 10 - Applicative functors, Part I"
[
exercise1
, exercise2
, exercise3
, exercise4
, exercise5
]
exercise1 =
testGroup "Exercise 1 - Parser Functor" [
testCase "Example ... | taylor1791/cis-194-spring | test/Test/Week10.hs | Haskell | mit | 1,411 |
module Reforest.CompressionSpec where
import Test.Hspec
import Reforest
import qualified Data.Set as Set
import Test.HUnit
a `shouldBeSubsetOf` b =
assertBool (show a ++ " not subset of " ++ show b)
(Set.fromList a `Set.isSubsetOf` Set.fromList b)
genLangSet = Set.fromList . genLang
spec :: Spec
spec = do
... | gebner/reforest | test/Reforest/CompressionSpec.hs | Haskell | mit | 767 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE InstanceSigs #-}
import Network.HTTP
--import Network.HTTP.Conduit
import Control.Concurrent.Async
import Text.Printf
import Control.Exception
import System.CPUTime
-- loop :: Int -> IO ()
-- loop i =
-- if i == 0 then do
-- pu... | eulerfx/learnfp | http.hs | Haskell | mit | 1,155 |
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Handler.Models where
import Cache
import Import hiding (intercalate, (<>))
import Form
import Data.List (nub)
import SessionState
import Data.Monoid
import Database.Persist.Types
import Database.Persist.Sql
... | swamp-agr/carbuyer-advisor | Handler/Models.hs | Haskell | mit | 1,744 |
module Main where
import Control.Concurrent
import AIM.OpenAuth
import AIM.Client
import AIM.Boss
import AIM.Oscar
import System.IO
getScreenName :: IO (String)
getScreenName = do
putStr "AIM Screen Name> "
hFlush stdout
getLine
getPassword :: IO (String)
getPassword = do
putStr "AIM Password> "
hFlush st... | chrismoos/haskell-aim-client | src/Main.hs | Haskell | apache-2.0 | 1,145 |
{-
Copyright 2010-2012 Cognimeta Inc.
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 to in writ... | Cognimeta/cognimeta-utils | src/Cgm/Prelude.hs | Haskell | apache-2.0 | 2,373 |
{- |
Module : Bio.Motions.Callback.Periodic
Description : Contains the Periodic callback transformer
License : Apache
Stability : experimental
Portability : unportable
-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Fl... | Motions/motions | src/Bio/Motions/Callback/Periodic.hs | Haskell | apache-2.0 | 2,571 |
-- Typeclass
class BasicEq a where
isEqual :: a -> a -> Bool
instance BasicEq Bool where
isEqual True True = True
isEqual False False = True
isEqual _ _ = False
| EricYT/Haskell | src/chapter-6-1.hs | Haskell | apache-2.0 | 177 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Transaction where
import Control.Lens
import Control.Lens.TH
import Data.Function
import Data.Hashable
import Commutating
import TransactionState
newtype TransactionID = TransactionID Int deriving(Eq, Ord, Hashable)
data Transacti... | kdkeyser/halvin | src/halvin/Transaction.hs | Haskell | apache-2.0 | 987 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
module Score
( Score
, Input(..)
, Choice(..)
, score
, positive
#ifdef TEST
, minimum
#endif
) where
import Control.Applicative
import Control.Monad
import Data.Maybe (mapMaybe)
import Data.Text (Text)
import qual... | supki/wybor | src/Score.hs | Haskell | bsd-2-clause | 1,706 |
{-# LANGUAGE DeriveDataTypeable #-}
module Data.Mathematica.Type where
import System.Console.CmdArgs
data Mathematica_data = Test
deriving (Show,Data,Typeable)
test :: Mathematica_data
test = Test
mode = modes [test]
| wavewave/mathematica-data | lib/Data/Mathematica/Type.hs | Haskell | bsd-2-clause | 240 |
module Application.DiagramDrawer.Verbatim where
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Lib
verbatim :: QuasiQuoter
verbatim = QuasiQuoter { quoteExp = litE . stringL
, quotePat = undefined
, quoteType = undefined
, quoteDec = ... | wavewave/diagdrawer | lib/Application/DiagramDrawer/Verbatim.hs | Haskell | bsd-2-clause | 357 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeFamilies #-}
-- |
-- Module: $HEADER$
-- Description: TODO
-- Copyright: (c) 2016, Peter Trško
-- License: BSD3
--
-- Maintainer: peter.trsko@gmail.com
-- Stability: experimental
-- Portability: MultiParamTyp... | trskop/data-analysis | src/DataAnalysis/Decode.hs | Haskell | bsd-3-clause | 1,404 |
module Entity.Bound where
import qualified Data.List as L
import qualified Gamgine.Math.BoxTree as BT
import qualified Gamgine.Math.Box as B
import qualified GameData.Entity as E
import qualified GameData.Animation as A
import qualified Entity.Position as EP
bound :: E.Entity -> E.Bound
bound E.Player {E.playerPositi... | dan-t/layers | src/Entity/Bound.hs | Haskell | bsd-3-clause | 699 |
module Connection where
import Prelude ()
import Prelude.MH
import Brick.BChan
import Control.Concurrent ( forkIO, threadDelay )
import qualified Control.Concurrent.STM as STM
import Control.Exception ( SomeException, catch )
import qualified Data.HashMap.Strict as HM... | aisamanra/matterhorn | src/Connection.hs | Haskell | bsd-3-clause | 3,589 |
{-# OPTIONS_GHC -Wall -fno-warn-unused-do-bind #-}
module Parse.Type where
import Data.List (intercalate)
import Text.Parsec ((<|>), (<?>), char, many1, string, try)
import Parse.Helpers
import qualified Reporting.Annotation as A
import AST.V0_16
tvar :: IParser Type
tvar =
addLocation
(TypeVariable <$> lowVa... | fredcy/elm-format | parser/src/Parse/Type.hs | Haskell | bsd-3-clause | 3,357 |
{- Copyright (c) 2008 David Roundy
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 conditions and the following... | droundy/franchise | Distribution/Franchise/SplitFile.hs | Haskell | bsd-3-clause | 3,540 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
import Language.Haskell.Liquid.Prelude
--------------------------------------------------------------------
-------------- Defining A List Type --------------------------------
--------------------------------------------------------------------
[lq| data List [l... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/ListISort-LType.hs | Haskell | bsd-3-clause | 1,395 |
module Text.Roundtrip.Classes where
import Prelude hiding ((<*>), pure)
import Data.Eq (Eq)
import Data.Char (Char)
import Data.Text as T
import Data.XML.Types (Name(..), Content)
import Control.Isomorphism.Partial (IsoFunctor)
infixl 3 <|>
infixl 3 <||>
infixr 6 <*>
class ProductFunctor f where
(<*>) :: f alph... | skogsbaer/roundtrip | src/Text/Roundtrip/Classes.hs | Haskell | bsd-3-clause | 1,566 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
module Ticket.Site
( routes
) where
import Data.ByteString (ByteString)
import Data.ByteString.Char8 (unpack)
import Snap.Core
import Snap.Snaplet
... | ExternalReality/features | src/Ticket/Site.hs | Haskell | bsd-3-clause | 3,927 |
module SyntaxHighlighting.AsLatexPt where
import Utils.Utils
import Data.Char
import TypeSystem
import SyntaxHighlighting.Coloring
import SyntaxHighlighting.Renderer
import Text.PrettyPrint.ANSI.Leijen
data LatexRenderer = LatexRenderer FullColoring SyntaxStyle
instance Renderer LatexRenderer where
create = Lat... | pietervdvn/ALGT | src/SyntaxHighlighting/AsLatexPt.hs | Haskell | bsd-3-clause | 3,663 |
module Crete.Product.Product where
import Text.ParserCombinators.Parsec (parse)
import Data.Maybe (catMaybes)
import Data.Either (partitionEithers)
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Crete.Product.ProductParser as PP
import Crete.Store.StoreTypes (ProductMap, Pr... | fphh/crete | src/Crete/Product/Product.hs | Haskell | bsd-3-clause | 1,298 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Time.TimeZone.Parse
( parseTimezone
) where
import Data.... | facebookincubator/duckling | Duckling/Time/TimeZone/Parse.hs | Haskell | bsd-3-clause | 7,587 |
{-# LANGUAGE DeriveDataTypeable #-}
module Error
(
PullE(..),
CommandError(..),
putErr
)
where
import System.IO
import System.Exit (ExitCode(..))
import Data.Typeable
import Control.Exception
import Data.ConfigFile
data CommandError =
ProjectExist
| NoProject
| PatchingError
| DiffError ExitCode
|... | lambda-zorn/det | src/Error.hs | Haskell | bsd-3-clause | 1,519 |
{-# LANGUAGE RecordWildCards #-}
module Material where
import Control.Monad (when)
import Foreign.Ptr
import Graphics.GL
import Graphics.GL.Ext.EXT.TextureFilterAnisotropic
import Prelude hiding (any, ceiling)
import Util
import qualified Codec.Picture as JP
import qualified Codec.Picture.Types as JP
import qualified ... | ocharles/hadoom | hadoom/Material.hs | Haskell | bsd-3-clause | 3,629 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Strip
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This module provides an library interface to the @strip@ program.
module Distribution.Simple.Program.Strip... | sopvop/cabal | Cabal/Distribution/Simple/Program/Strip.hs | Haskell | bsd-3-clause | 2,855 |
{-# LANGUAGE DeriveDataTypeable, DeriveFoldable, DeriveTraversable, DeriveFunctor #-}
module Language.Haskell.AST.Exts.HSX
where
import Data.Data
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
import Language.Haskell.AST.Core hiding ( Module, Pat, Exp )
-- | XML extenstions to the @GModule@ t... | jcpetruzza/haskell-ast | src/Language/Haskell/AST/Exts/HSX.hs | Haskell | bsd-3-clause | 3,682 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.