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 qualified Data.Sequence as Seq
import LogicGrowsOnTrees (exploreTree)
import LogicGrowsOnTrees.Examples.Queens (nqueensUsingBitsSolutions)
main = print . exploreTree . fmap Seq.singleton . nqueensUsingBitsSolutions $ 5 | gcross/LogicGrowsOnTrees | LogicGrowsOnTrees/tutorial/tutorial-2.hs | Haskell | bsd-2-clause | 226 |
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies,
GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-| All RPC calls are run within this monad.
It encapsulates:
* IO operations,
* failures,
* working with the daemon state.
Code that is specific either to the configuration or the lock man... | ganeti-github-testing/ganeti-test-1 | src/Ganeti/WConfd/Monad.hs | Haskell | bsd-2-clause | 14,252 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
module Bones.Skeletons.BranchAndBound.HdpH.Types where
import Control.Parallel.HdpH (Closure, Par, StaticDecl,
declare, mkClosure, static)
import GHC.Generics... | BlairArchibald/bones | lib/src/Bones/Skeletons/BranchAndBound/HdpH/Types.hs | Haskell | bsd-3-clause | 1,295 |
-- 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.Ordinal.ET.Corpus
( corpus ) where
import Prelude
import D... | facebookincubator/duckling | Duckling/Ordinal/ET/Corpus.hs | Haskell | bsd-3-clause | 681 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Haskell.GHC.ExactPrint.Types
( -- * Core Types
Anns
, emptyAnns
, Annotation(..)
, annNone
,... | mpickering/ghc-exactprint | src/Language/Haskell/GHC/ExactPrint/Types.hs | Haskell | bsd-3-clause | 8,397 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Language.Fay.JQuery.Cookie where
import Language.Fay.Prelude
import Language.Fay.FFI
data Cookie a = Cookie
{ cookieName :: String
, cookieValue :: a
, cookieExpires :: Maybe Double
, cookiePath :: Maybe String
}
-- | Set a ... | faylang/fay-server | modules/library/Language/Fay/JQuery/Cookie.hs | Haskell | bsd-3-clause | 997 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
module HVX.Internal.DCP
( Vex(..)
, GetVex(getVex)
, Mon(..)
, GetMon(getMon)
, ValidVex(validVex)
, FlipVex
, FlipMon
, ApplyVex
, ApplyMon
, AddVex
, AddMon
) where
class GetVex (v :: Vex) where
getVex :: e (v :: Vex) (m :: Mon) -> S... | chrisnc/hvx | src/HVX/Internal/DCP.hs | Haskell | bsd-3-clause | 2,838 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Handler.Download where
import qualified Data.Text as Text
import qualified Data.Text.Encoding as Text
import Yesod
import Foundation
getDownloadR :: Int -> Handler TypedContent
getDownloadR ident = do
Store... | grauwoelfchen/cowberry | Handler/Download.hs | Haskell | bsd-3-clause | 536 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
module Language.Lambda.Syntax.Named.Exp
(
Exp (Var,App,Lam,Let)
-- , bound
-- , free
, uname
, name
, fold
, gFold
, (#)
, (!)
) where
#if __GLASGOW_HASKEL... | julmue/UntypedLambda | src/Language/Lambda/Syntax/Named/Exp.hs | Haskell | bsd-3-clause | 2,682 |
{-# LANGUAGE FlexibleContexts, Rank2Types #-}
module Rede.SpdyProtocol.Session(
-- trivialSession
basicSession
-- ,showHeadersIfPresent
) where
import Control.Concurrent (forkIO)
import Control.Monad.IO.Class (liftIO)
import Control.M... | loadimpact/http2-test | hs-src/Rede/SpdyProtocol/Session.hs | Haskell | bsd-3-clause | 36,820 |
instance Pointed Point where
point = Point
instance MonadStep Point where
type SS Point = Point
step f xs = xs >>= f
| davdar/quals | writeup-old/sections/04MonadicAAM/02RecoveringConcrete/03PointMonadStep.hs | Haskell | bsd-3-clause | 123 |
{-# LANGUAGE FlexibleContexts, FlexibleInstances #-}
module Instances where
import Prelude as P
import Control.Applicative
import Test.QuickCheck
import Test.QuickCheck.Arbitrary
import Data.SparseVector
import qualified Data.Vector as V
import Data.Vector (Vector)
instance Arbitrary a => Arbitrary (Vector a) wher... | copumpkin/vector-sparse | tests/Instances.hs | Haskell | bsd-3-clause | 1,439 |
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Hasmin.Parser.Internal
-- Copyright : (c) 2017 Cristian Adrián Ontivero
-- License : BSD3
-- Stability : experimental
-- Portability : unknown
--
-------------------------------... | contivero/hasmin | src/Hasmin/Parser/Internal.hs | Haskell | bsd-3-clause | 13,226 |
{-# language QuasiQuotes #-}
{-# language TemplateHaskell #-}
module OpenCV.Internal.Core.Types.Vec.TH
( mkVecType
) where
import "base" Data.List ( intercalate )
import "base" Data.Monoid ( (<>) )
import "base" Foreign.Marshal.Alloc ( alloca )
import "base" Foreign.Storable ( peek )
import "base" System.IO.Unsaf... | Cortlandd/haskell-opencv | src/OpenCV/Internal/Core/Types/Vec/TH.hs | Haskell | bsd-3-clause | 6,443 |
module Network.Riak.HTTP.JSON
(put, tryPut, putWithRandomKey, putWithIndexes, get, defaultClient)
where
import Network.Riak.HTTP.Types
import Network.Riak.HTTP.Internal
import Network.HTTP
import Data.Aeson
import Data.ByteString.Lazy (ByteString(..))
import qualified Data.ByteString.Lazy.Char8 as BLC
put :: (ToJ... | ThoughtLeadr/Riak-Haskell-HTTP-Client | src/Network/Riak/HTTP/JSON.hs | Haskell | bsd-3-clause | 1,316 |
-- | Equations.
{-# LANGUAGE TypeFamilies #-}
module Twee.Equation where
import Twee.Base
import Control.Monad
--------------------------------------------------------------------------------
-- * Equations.
--------------------------------------------------------------------------------
data Equation f =
(:=:) {
... | nick8325/kbc | src/Twee/Equation.hs | Haskell | bsd-3-clause | 1,895 |
data Cartesian = Cartesian Double Double deriving Show
mulC :: Cartesian -> Double -> Cartesian
mulC (Cartesian x y) n = Cartesian (x * n) (y * n)
point1 :: Cartesian
point1 = Cartesian 8 5
data Polar = Polar Double Double deriving Show
mulP :: Polar -> Double -> Polar
mulP (Polar d r) n = Polar (d * n) r
point2 :... | YoshikuniJujo/funpaala | samples/21_adt/cpd.hs | Haskell | bsd-3-clause | 355 |
-----------------------------------------------------------------------------
-- |
-- Module : Main (HaddockCoverage)
-- Copyright : (C) 2015 Ivan Perez
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Ivan Perez <ivan.perez@keera.co.uk>
-- Stability : provisional
-- Portability : porta... | ivanperez-keera/Yampa | yampa/tests/HaddockCoverage.hs | Haskell | bsd-3-clause | 3,394 |
-- 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.Dimensions.KM
( allDimensions
) where
import Duckling.Dimensions.Types
allDimensions :: [Se... | facebookincubator/duckling | Duckling/Dimensions/KM.hs | Haskell | bsd-3-clause | 461 |
module Experiment (experiment, generators) where
import Data.Monoid
import Control.Arrow
import Simulation.Aivika
import Simulation.Aivika.Experiment
import Simulation.Aivika.Experiment.Chart
import qualified Simulation.Aivika.Results.Transform as T
-- | The simulation specs.
specs = Specs { spcStartTime = 0.0,
... | dsorokin/aivika-experiment-chart | examples/PortOperations/Experiment.hs | Haskell | bsd-3-clause | 2,683 |
-- |Some common functions that are available to all hasp programs by default.
--
-- Note that this does not include syntactic forms such as if, define, lambda,
-- and and (since they require behaviour such as short circuiting and mutation
-- that are not available to hasp functions), as well as standard library
-- func... | aldld/hasp | src/Builtins.hs | Haskell | bsd-3-clause | 5,719 |
-- | The type of tile kinds. Every terrain tile in the game is
-- an instantiated tile kind.
module Game.LambdaHack.Content.TileKind
( pattern S_UNKNOWN_SPACE, pattern S_UNKNOWN_OUTER_FENCE, pattern S_BASIC_OUTER_FENCE, pattern AQUATIC
, TileKind(..), ProjectileTriggers(..), Feature(..)
, makeData
, isUknownSpa... | LambdaHack/LambdaHack | definition-src/Game/LambdaHack/Content/TileKind.hs | Haskell | bsd-3-clause | 10,569 |
module Action where
import Storage
import Glue
generateSolutions :: IO ()
generateSolutions = do
prepareDB dbName
mRest <- dbDo getRest
case mRest of
Nothing -> do
(sols, rest) <- return $ firstSolutions 1
dbDo (addSolutions sols)
dbDo (replaceRest rest)
Just rest -> do
(sols, ne... | Stulv/sudoku | src/Action.hs | Haskell | bsd-3-clause | 944 |
module Data.Geo.GPX.Lens.HdopL where
import Data.Lens.Common
class HdopL a where
hdopL :: Lens a (Maybe Double)
| tonymorris/geo-gpx | src/Data/Geo/GPX/Lens/HdopL.hs | Haskell | bsd-3-clause | 117 |
{-# LANGUAGE ScopedTypeVariables #-}
module SplitBill where
import Control.Exception
import Control.Monad
import Data.Char
import Data.Decimal
import System.Directory
import System.Environment
import System.FilePath
import System.IO
import qualified Data.Map as Map
-- | `AnswersMap` binds textual answers to values ... | Minoru/split-bill-hs | src/SplitBill.hs | Haskell | bsd-3-clause | 9,743 |
{-# OPTIONS_HADDOCK hide, prune #-}
module Import.NoFoundation
( module Import
) where
import ClassyPrelude.Yesod as Import hiding (race_)
import Model as Import
import Settings as Import
import Settings.StaticFiles as Import
import Yesod.Auth as Import
import Yesod.C... | mb21/qua-kit | apps/hs/qua-server/src/Import/NoFoundation.hs | Haskell | mit | 396 |
module TestDemoNeuron where
import Test.Hspec
import AI.DemoNeuron
import TestNeuron
testDemoNeuron :: IO ()
testDemoNeuron = hspec $ do
describe "Reduced Neuron" $
it "should pass tests" $
True `shouldBe` True
describe "L2 Neuron" $
it "should pass tests" $
True `shouldBe` True
| jbarrow/LambdaNet | test/TestDemoNeuron.hs | Haskell | mit | 308 |
{-# LANGUAGE RecordWildCards #-}
-- | Logic of application and verification of data in Poll.
module Pos.DB.Update.Poll.Logic.Apply
( verifyAndApplyUSPayload
, verifyAndApplyProposal
, verifyAndApplyVoteDo
) where
import Universum hiding (id)
import Control.Monad.Excep... | input-output-hk/pos-haskell-prototype | db/src/Pos/DB/Update/Poll/Logic/Apply.hs | Haskell | mit | 18,113 |
<?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="sl-SI">
<title>>Run Applications | ZAP Extensions</title>
<maps>
<homeID>top</homeID>
... | veggiespam/zap-extensions | addOns/invoke/src/main/javahelp/org/zaproxy/zap/extension/invoke/resources/help_sl_SI/helpset_sl_SI.hs | Haskell | apache-2.0 | 983 |
-- | Miscellaneous string manipulation functions.
--
module Hakyll.Core.Util.String
( trim
, replaceAll
, splitAll
) where
import Data.Char (isSpace)
import Data.Maybe (listToMaybe)
import Text.Regex.TDFA ((=~~))
-- | Trim a string (drop spaces, tabs and newlines at both sides).
--
trim :: String -> ... | sol/hakyll | src/Hakyll/Core/Util/String.hs | Haskell | bsd-3-clause | 1,466 |
{-# LANGUAGE CPP #-}
module Data.Streaming.FilesystemSpec (spec) where
import Test.Hspec
import Data.Streaming.Filesystem
import Control.Exception (bracket)
import Data.List (sort)
#if !WINDOWS
import System.Posix.Files (removeLink, createSymbolicLink, createNamedPipe)
import Control.Exception (bracket, try, IOExcepti... | phadej/streaming-commons | test/Data/Streaming/FilesystemSpec.hs | Haskell | mit | 2,234 |
{- portable environment variables
-
- Copyright 2013 Joey Hess <joey@kitenet.net>
-
- License: BSD-2-clause
-}
{-# LANGUAGE CPP #-}
module Utility.Env where
#ifdef mingw32_HOST_OS
import Utility.Exception
import Control.Applicative
import Data.Maybe
import qualified System.Environment as E
import qualified Syst... | avengerpenguin/propellor | src/Utility/Env.hs | Haskell | bsd-2-clause | 2,003 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for the LV Parser -}
{-
Copyright (C) 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. Redistri... | andir/ganeti | test/hs/Test/Ganeti/Storage/Lvm/LVParser.hs | Haskell | bsd-2-clause | 4,731 |
{-# LANGUAGE OverloadedStrings #-}
module ListTeamsForOrganization where
import qualified Github.Auth as Github
import qualified Github.Organizations.Teams as Github
import System.Environment (getArgs)
main = do
args <- getArgs
result <- case args of
[team, token] -... | beni55/github | samples/Organizations/Teams/ListTeamsForOrganization.hs | Haskell | bsd-3-clause | 637 |
{-# OPTIONS_HADDOCK hide #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.GLboolean
-- Copyright : (c) Sven Panne 2002-2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
--... | hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/GLboolean.hs | Haskell | bsd-3-clause | 940 |
module Aws.S3.Commands.DeleteObject
where
import Aws.Core
import Aws.S3.Core
import Data.ByteString.Char8 ({- IsString -})
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
data DeleteObject = DeleteObject {
doObjectName :: T.Text,
... | frms-/aws | Aws/S3/Commands/DeleteObject.hs | Haskell | bsd-3-clause | 1,624 |
-- The intention is that this will be the new unit test framework.
-- Please add any working tests here. This file should do nothing
-- but import tests from other modules.
--
-- Stephen Blackheath, 2009
module Main where
import PackageTests.BenchmarkExeV10.Check
import PackageTests.BenchmarkOptions.Check
import Pac... | DavidAlphaFox/ghc | libraries/Cabal/Cabal/tests/PackageTests.hs | Haskell | bsd-3-clause | 8,160 |
module Type1 where
data Data a = C1 a Int Char |
C2 Int |
C3 Float
f :: Data a -> Int
f (C1 a b c) = b
f (C2 a) = a
f (C3 a) = 42
(C1 (C1 x y z) b c) = 89
| kmate/HaRe | old/testing/removeField/Type1.hs | Haskell | bsd-3-clause | 194 |
module Test2 () where
{-@ predicate CyclicC1 Q = CyclicC2 Q && CyclicC3 Q @-}
{-@ predicate CyclicC2 Q = CyclicC1 Q @-}
{-@ predicate CyclicC3 Q = CyclicC1 Q @-}
| abakst/liquidhaskell | tests/crash/CyclicPredAlias2.hs | Haskell | bsd-3-clause | 164 |
module Plugins (
FrontendPlugin(..), defaultFrontendPlugin,
Plugin(..), CommandLineOption,
defaultPlugin
) where
import CoreMonad ( CoreToDo, CoreM )
import TcRnTypes ( TcPlugin )
import GhcMonad
import DriverPhases
-- | Command line options gathered from the -PModule.Name:stuff syntax
-- are given t... | tjakway/ghcjvm | compiler/main/Plugins.hs | Haskell | bsd-3-clause | 1,772 |
{-# LANGUAGE TypeFamilyDependencies #-}
module T6018failclosed2 where
-- this one is a strange beast. Last equation is unreachable and thus it is
-- removed. It is then impossible to typecheck barapp and thus we generate an
-- error
type family Bar a = r | r -> a where
Bar Int = Bool
Bar Bool = Int
Bar ... | olsner/ghc | testsuite/tests/typecheck/should_fail/T6018failclosed2.hs | Haskell | bsd-3-clause | 398 |
-- 0xbf is an invalid character
bad = '¿'
| wxwxwwxxx/ghc | testsuite/tests/parser/unicode/utf8_011.hs | Haskell | bsd-3-clause | 42 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANG... | ogma-project/ogma | src/Web/Ogma/Api.hs | Haskell | mit | 4,325 |
main :: IO ()
main = do
putStrLn "Ingrese un numero"
numeroStr <- getLine
putStrLn "Ingrese una potencia"
potenciaStr <- getLine
let numero = read numeroStr :: Int
potencia = read potenciaStr :: Int
putStrLn $ show $ exponente numero potencia
where
exponente :: Int -> Int ... | clinoge/primer-semestre-udone | src/05-ciclos/exponente.hs | Haskell | mit | 534 |
{-# htermination (fsEsFloat :: Float -> Float -> MyBool) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Float = Float MyInt MyInt ;
data MyInt = Pos Nat | Neg Nat ;
data Nat = Succ Nat | Zero ;
primEqNat :: Nat -> Nat -> MyBool;
primEqNat Zero Zero ... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/SLASHEQ_5.hs | Haskell | mit | 1,940 |
module NLP.Senna.Foreign.Types where
import Foreign
type CSenna = Ptr ()
| slyrz/hase | src/NLP/Senna/Foreign/Types.hs | Haskell | mit | 76 |
{-# LANGUAGE LambdaCase #-}
{-@ fooMap :: _ -> i:[a] -> {o:[b] | (len i) = (len o)} @-}
fooMap :: (a -> b) -> [a] -> [b]
fooMap f = \case
[] -> []
l -> map f l
| santolucito/ives | tests/Foo.hs | Haskell | mit | 167 |
module Language.FA (
driverDFA,
driverNFA,
trimUnreachableStates,
minimizeDFA,
replaceStatesDFA,
replaceStatesNFA,
nubStatesDFA,
nubStatesNFA,
collectState,
collectStates,
collect,
dfa2nfa,
nfa2dfa,
-- NFA
epsilonClosure,
undistinguishableStates,... | banacorn/formal-language | haskell-legacy/Language/fa.hs | Haskell | mit | 14,187 |
import Data
import Data.Elements
( MasyuPearl (..),
Thermometer,
)
import qualified Data.Grid as Grid
import Data.Grid
import Data.GridShape
import qualified Data.GridShapeSpec
import qualified Data.GridSpec
import Data.List (sort)
import qualified Data.Map.Strict as Map
import Data.Pyramid (PyramidSol (..))
im... | robx/puzzle-draw | tests/tests.hs | Haskell | mit | 9,424 |
module Test.MLP(test) where
import Data.MLP as P
import qualified Data.DNN.Trainer as T
import qualified Data.Matrix as M
--utils
import Control.Monad.Identity(runIdentity)
import Control.Monad(forever,when,foldM)
--test modules
import System.Exit (exitFailure)
import Test.QuickCheck(verboseCheckWithResult)
import T... | aeyakovenko/rbm | Test/MLP.hs | Haskell | mit | 6,475 |
{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleContexts,OverloadedStrings,
GeneralizedNewtypeDeriving, MultiParamTypeClasses, NoImplicitPrelude
, TemplateHaskell, TypeFamilies, RecordWildCards, DeriveGeneric, DeriveDataTypeable #-}
module Tach.Acid.Impulse.Cruds.Types where
import CorePrelude
import qualified Da... | smurphy8/tach | core-libs/tach-acid-impulse-lib/src/Tach/Acid/Impulse/Cruds/Types.hs | Haskell | mit | 902 |
--marySue :: Maybe Bool
marySue = do
k <- Just 9
Just (k>8) | RAFIRAF/HASKELL | A Fistful of Monads/mary.hs | Haskell | mit | 65 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-application-applicationconfiguration.html
module Stratosphere.ResourceProperties.KinesisAn... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsV2ApplicationApplicationConfiguration.hs | Haskell | mit | 6,799 |
module P004 where
import Euler
solution :: EulerType
solution = Left $ foldl (
\m a -> foldMaybe (
\m b -> let c = a * b in
if c <= m then Nothing
else if pal c then Just c
else Just m
) m [999, (if a `divides` 11 then 998 else 988) .. a]
) 0 [999, 998 .. 100]
main = printEuler solution... | Undeterminant/euler-haskell | P004.hs | Haskell | cc0-1.0 | 321 |
{-# LANGUAGE RecordWildCards, NamedFieldPuns, BangPatterns #-}
module SSync.RollingChecksum (
RollingChecksum
, init
, value
, value16
, forBlock
, roll
) where
import Prelude hiding (init)
import Data.Bits (shiftR, shiftL, xor, (.&.))
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
impor... | socrata-platform/ssync | src/main/haskell/SSync/RollingChecksum.hs | Haskell | apache-2.0 | 2,513 |
{-# 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... | apyrgio/snf-ganeti | test/hs/Test/Ganeti/Rpc.hs | Haskell | bsd-2-clause | 4,509 |
module Data.Drasil.Software.Products where
import Language.Drasil
import Utils.Drasil
import Data.Drasil.Concepts.Documentation (game, video, open, source)
import Data.Drasil.Concepts.Computation (computer)
import Data.Drasil.Concepts.Software (program)
import Data.Drasil.IdeaDicts
prodtcon :: [NamedChunk]
prodtcon... | JacquesCarette/literate-scientific-software | code/drasil-data/Data/Drasil/Software/Products.hs | Haskell | bsd-2-clause | 744 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Database.Sqroll.Table
( -- * Types
Table (..)
, NamedTable (..)
, FieldInfo (..)
-- * Creating tables
, namedTable
, field
... | pacak/sqroll | src/Database/Sqroll/Table.hs | Haskell | bsd-3-clause | 7,280 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Sandbox
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- UI for the sandboxing functionality.
----------------------------------------------------------... | ian-ross/cabal | cabal-install/Distribution/Client/Sandbox.hs | Haskell | bsd-3-clause | 37,321 |
module Lang.Php.Ast.Stmt (
module Lang.Php.Ast.StmtParse,
module Lang.Php.Ast.StmtTypes,
module Lang.Php.Ast.StmtUnparse
) where
import Lang.Php.Ast.StmtParse
import Lang.Php.Ast.StmtTypes
import Lang.Php.Ast.StmtUnparse
| facebookarchive/lex-pass | src/Lang/Php/Ast/Stmt.hs | Haskell | bsd-3-clause | 230 |
module Instruction (
RegUsage(..),
noUsage,
GenBasicBlock(..), blockId,
ListGraph(..),
NatCmm,
NatCmmDecl,
NatBasicBlock,
topInfoTable,
entryBlocks,
Instruction(..)
)
where
import GhcPrelude
import Reg
import GHC.Cmm.BlockId
import GHC... | sdiehl/ghc | compiler/nativeGen/Instruction.hs | Haskell | bsd-3-clause | 6,365 |
module ParseOutput(parseOutput) where
import Text.Parsec
import Text.Parsec.String
import Text.Parsec.Perm
import Data.Char
import Types
import ParseUtil
parseOutput = do
r <- permute (
combine <$$>
(skipMany unwanted >> result)
<||>
(skipMany unwanted >> solutionLine))
skipMany unwanted
... | EJahren/PBCompOutputChecker | src/ParseOutput.hs | Haskell | bsd-3-clause | 1,495 |
{-# LANGUAGE OverloadedStrings #-}
module Cheapskate.Inlines (
parseInlines
, pHtmlTag
, pReference
, pLinkLabel)
where
import Cheapskate.ParserCombinators
import Cheapskate.Util
import Cheapskate.Types
import Data.Char hiding (Space)
import qualified Data.Sequence as Seq
import Data.Sequence ... | nukisman/elm-format-short | markdown/Cheapskate/Inlines.hs | Haskell | bsd-3-clause | 16,282 |
main :: IO ()
main = print $ sum [1..100] ^ 2 - sum (map (^ 2) [1..100])
| jaredks/euler | 006/006.hs | Haskell | bsd-3-clause | 73 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.Compatibility30
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability ... | haskell-opengl/OpenGLRaw | src/Graphics/GL/Compatibility30.hs | Haskell | bsd-3-clause | 45,469 |
module Data.UI.Input.Keyboard.ModKey(ModKey(..), unModKey, pretty) where
import Data.Monoid(mempty)
import Data.UI.Input.Keyboard.Mods(ModsState)
import qualified Data.UI.Input.Keyboard.Mods as Mods
import Data.UI.Input.Keyboard.Keys(Key)
import qualified Data.UI.Input.Keyboard.Keys as Keys
data ModKey = ModKey ModsS... | Peaker/keyboard | src/Data/UI/Input/Keyboard/ModKey.hs | Haskell | bsd-3-clause | 589 |
-- #hide
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.Texturing.TextureTarget
-- Copyright : (c) Sven Panne 2002-2005
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
... | FranklinChen/hugs98-plus-Sep2006 | packages/OpenGL/Graphics/Rendering/OpenGL/GL/Texturing/TextureTarget.hs | Haskell | bsd-3-clause | 2,185 |
{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}
#if MIN_VERSION_ghc_prim(0,3,1)
{-# LANGUAGE MagicHash #-}
#endif
-- |
-- Module: Data.Aeson.Parser.Internal
-- Copyright: (c) 2011-2016 Bryan O'Sullivan
-- (c) 2011 MailRank, Inc.
-- License: BSD3
-- Maintainer: Bryan O'Sullivan <bos@serpe... | roelvandijk/aeson | Data/Aeson/Parser/Internal.hs | Haskell | bsd-3-clause | 13,841 |
-----------------------------------------------------------------------------
-- |
-- Module : Application.DevAdmin.Cabal
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
------------------... | wavewave/devadmin | lib/Application/DevAdmin/Cabal.hs | Haskell | bsd-3-clause | 2,720 |
{-# LANGUAGE OverloadedStrings #-}
module RealWorld.Api
( Api, server ) where
import Servant
import qualified RealWorld.Api.Articles as Articles
import qualified RealWorld.Api.Authentication as Authentication
import qualified RealWorld.Api.Profiles as Profiles
import qualified RealWorld.Api.Tags ... | zudov/servant-realworld-example-app | src/RealWorld/Api.hs | Haskell | bsd-3-clause | 775 |
{-
(c) The AQUA Project, Glasgow University, 1993-1998
\section[SimplMonad]{The simplifier Monad}
-}
module SimplMonad (
-- The monad
SimplM,
initSmpl, traceSmpl,
getSimplRules, getFamEnvs,
-- Unique supply
MonadUnique(..), newId,
-- Counting
SimplCoun... | GaloisInc/halvm-ghc | compiler/simplCore/SimplMonad.hs | Haskell | bsd-3-clause | 7,734 |
{-# LANGUAGE BangPatterns, PatternGuards #-}
module SECDH.Eval
( secdhEval
, secdhInit
, secdhInitProgram
, secdhFinish
, secdhEvalStats
, secdhFinishStats
, secdhIter
, Rule (..)
) where
--import Debug.Trace
import Language.Slambda.Types
import Languag... | pgavin/secdh | lib/SECDH/Eval.hs | Haskell | bsd-3-clause | 23,297 |
module Main where
putStr str = case str of
[ ] -> return ()
c : cs -> putChar c >> putStr cs
putStrLn str = putStr str >> putChar '\n'
main = putStrLn "Hello, world!"
| YoshikuniJujo/toyhaskell_haskell | examples/hello.hs | Haskell | bsd-3-clause | 172 |
-- |
-- Module : Main
-- Copyright : Jared Tobin 2012
-- License : BSD3
--
-- Maintainer : jared@jtobin.ca
-- Stability : experimental
-- Portability : unknown
{-# OPTIONS_GHC -Wall #-}
module Main where
import Kospi
import Control.Monad (forever, when)
import Control.Monad.Trans (lift)
imp... | jtobin/prompt-pcap | Main.hs | Haskell | bsd-3-clause | 4,897 |
{-# OPTIONS_GHC -XFlexibleInstances #-}
module Database.CouchDB.Tests ( main, allTests) where
import Control.Monad.Trans (liftIO)
import Control.Exception (finally)
import Test.HUnit
import Database.CouchDB
import Database.CouchDB.JSON
import Text.JSON
-- --------------------------------------------------------------... | astro/haskell-couchdb | src/Database/CouchDB/Tests.hs | Haskell | bsd-3-clause | 2,815 |
module PFDS.Sec5.Ex8a where
import PFDS.Commons.PairingHeap (PairingHeap (..))
data BinTree e = E' | T' e (BinTree e) (BinTree e) deriving (Show)
toBinary :: PairingHeap e -> BinTree e
toBinary E = E'
toBinary (T e []) = T' e E' E'
toBinary (T e (h1:hs)) = T' e (toBinary h1) (unloop hs) where
unloop [] =... | matonix/pfds | src/PFDS/Sec5/Ex8a.hs | Haskell | bsd-3-clause | 777 |
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
module Test.Type(
sleep, sleepFileTime, sleepFileTimeCalibrate,
testBuildArgs, testBuild, testSimple, testNone,
shakeRoot,
defaultTest, hasTracker, notCI, notWindowsCI, notMacCI,
copyDirectoryChanged, copyFileChang... | ndmitchell/shake | src/Test/Type.hs | Haskell | bsd-3-clause | 13,510 |
{-# LANGUAGE RecordWildCards #-}
-- | Logic of local data processing in Update System.
module Pos.DB.Update.Logic.Local
(
-- * Proposals
isProposalNeeded
, getLocalProposalNVotes
, processProposal
-- * Votes
, isVoteNeeded
, getLocalVote
, processV... | input-output-hk/pos-haskell-prototype | db/src/Pos/DB/Update/Logic/Local.hs | Haskell | mit | 17,535 |
{-# LANGUAGE TypeOperators #-}
{-# Language RebindableSyntax #-}
{-# Language ScopedTypeVariables #-}
{-# Language FlexibleContexts #-}
module Main where
import Prelude hiding ((>>=), (>>), fail, return, id, lookup)
import Symmetry.Language
import Symmetry.Verify
import Symmetry.SymbEx
import SrcHelper
-- msg1 : All... | abakst/symmetry | checker/tests/todo/SrcConcDB.hs | Haskell | mit | 4,690 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
module Lamb... | lambdacms/lambdacms | lambdacms-core/LambdaCms/Core/Models.hs | Haskell | mit | 686 |
{-# LANGUAGE TypeOperators #-}
module TypeOperator where
-- - @"+" defines/binding SumTypeOp
data a + b = Sum a b
-- - @"+" ref SumTypeOp
mkSum :: a -> b -> a + b
mkSum x y = Sum x y
| google/haskell-indexer | kythe-verification/testdata/basic/TypeOperators.hs | Haskell | apache-2.0 | 186 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
----------------------------------------... | PipocaQuemada/ermine | src/Ermine/Interpreter.hs | Haskell | bsd-2-clause | 15,554 |
module Data.STM.Bag (
Impl,
module Data.STM.Bag.Class
) where
import Data.STM.Bag.Class
import Data.STM.Bag.Internal.PTLB
-- | The default implementation
type Impl = PTLB
| Alllex/stm-data-collection | src/Data/STM/Bag.hs | Haskell | bsd-3-clause | 182 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.PackageIndex
-- Copyright : (c) David Himmelstrup 2005,
-- Bjorn Bringert 2007,
-- Duncan Coutts 2008
--
-... | seereason/cabal | cabal-install/Distribution/Client/PackageIndex.hs | Haskell | bsd-3-clause | 10,633 |
-- | Regression tests for specific bugs.
--
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
module Tests.Regressions
(
tests
) where
{-
import Control.Exception (SomeException, handle)
import System.IO
import Test.HUnit (assertBool, assertEqual, assertFailure)
import qualified Data.ByteString as B... | ghcjs/ghcjs-base | test/Tests/Regressions.hs | Haskell | mit | 3,214 |
module GoToSymbolFunction_ReferenceLeftMostFunctionWithoutTypeSig where
test 1 = a
test 2 = b
test 3 = c
t<caret>est 4 = d | charleso/intellij-haskforce | tests/gold/codeInsight/GoToSymbolFunction_ReferenceLeftMostFunctionWithoutTypeSig.hs | Haskell | apache-2.0 | 123 |
{-| External data loader.
This module holds the external data loading, and thus is the only one
depending (via the specialized Text\/Rapi\/Luxi modules) on the actual
libraries implementing the low-level protocols.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
All rights reserved.
Redistribution and use i... | leshchevds/ganeti | src/Ganeti/HTools/ExtLoader.hs | Haskell | bsd-2-clause | 5,938 |
<?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="fil-PH">
<title>Selenium add-on</title>
<maps>
<homeID>top</homeID>
<mapref location="... | ccgreen13/zap-extensions | src/org/zaproxy/zap/extension/selenium/resources/help_fil_PH/helpset_fil_PH.hs | Haskell | apache-2.0 | 962 |
-- Operations on the global state of the vectorisation monad.
module Vectorise.Monad.Global (
readGEnv,
setGEnv,
updGEnv,
-- * Configuration
isVectAvoidanceAggressive,
-- * Vars
defGlobalVar, undefGlobalVar,
-- * Vectorisation declarations
lookupVectDecl,
-- * Scalars
globalParallelVars, glob... | snoyberg/ghc | compiler/vectorise/Vectorise/Monad/Global.hs | Haskell | bsd-3-clause | 7,644 |
{-# LANGUAGE TypeFamilies #-}
module T10836 where
type family Foo a = r | r -> a where
Foo Int = Int
Foo Bool = Int
type family Bar a = r | r -> a where
Bar Int = Int
Bar Bool = Int
| acowley/ghc | testsuite/tests/typecheck/should_fail/T10836.hs | Haskell | bsd-3-clause | 202 |
{-# LANGUAGE RankNTypes, MonoLocalBinds #-}
module T13804 where
f periph = let sr :: forall a. [a] -> [a]
sr = if periph then reverse else id
sr2 = sr
-- The question: is sr2 generalised?
-- It should be, because sr has a type sig
-- even tho... | sdiehl/ghc | testsuite/tests/typecheck/should_compile/T13804.hs | Haskell | bsd-3-clause | 390 |
import Control.Concurrent
import Control.Exception
import System.Mem ( performGC )
import System.Mem.Weak ( addFinalizer )
data P = P (MVar Bool)
-- Bug reported by Manuel Chakravarty, namely that we weren't checking
-- for runnable finalizers before declaring that the program is
-- deadlocked.
main = do
-- gcThrea... | hferreiro/replay | testsuite/tests/concurrent/should_run/conc031.hs | Haskell | bsd-3-clause | 734 |
-- !!! Importing unknown name
module M where
import Prelude(f)
| urbanslug/ghc | testsuite/tests/module/mod80.hs | Haskell | bsd-3-clause | 64 |
module KNXd.Client.Internal.Serialize where
import Data.ByteString (ByteString)
import Data.HList
import Data.Serialize
import Data.Word
import KNXd.Client.Internal.Types
-- |Some types need nonstandard serialization,
-- so it's easier to just serialize in a special class.
class ConvertWire a where
putWire :: Putt... | KaneTW/knxd-native-client | src/KNXd/Client/Internal/Serialize.hs | Haskell | mit | 1,944 |
module P11 where
import P10(encode)
data Item a = Single a | Multiple Int a deriving(Show)
-- | Modified run-length encoding
-- >>> encodeModified "aaaabccaadeeee"
-- [Multiple 4 'a',Single 'b',Multiple 2 'c',Multiple 2 'a',Single 'd',Multiple 4 'e']
encodeModified :: Eq a => [a] -> [Item a]
encodeModified = fmap to... | briancavalier/h99 | p11.hs | Haskell | mit | 404 |
{-# LANGUAGE OverloadedStrings #-}
module CoinApi.Types.Quote where
import CoinApi.Types.Internal
import CoinApi.Types.Trade
import Data.Aeson.Types
data Quote = Quote { symbol_id :: !Text
, time_exchange :: !UTCTime
, time_coinapi :: !UTCTime
, ask_price... | coinapi/coinapi-sdk | data-api/haskell-rest/CoinApi/Types/Quote.hs | Haskell | mit | 1,892 |
-- Remove duplicates from list
-- https://www.codewars.com/kata/57a5b0dfcf1fa526bb000118
module RemoveDuplicates where
import Data.List (nub)
distinct :: [Int] -> [Int]
distinct = nub
| gafiatulin/codewars | src/8 kyu/RemoveDuplicates.hs | Haskell | mit | 187 |
module Ecma.Prims where
import Data.Int
import Data.Word
import Data.Binary.IEEE754 (doubleToWord)
nan :: Double
nan = read "NaN"
infinity :: Double
infinity = read "Infinity"
-- 8.6.1
class Value a where
--value :: (Typeable b) => a -> b
value :: a -> a
class Writable a where
w... | phylake/avm3 | ecma/prims.hs | Haskell | mit | 1,954 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
-- | CmdItem is a tool to build command lines.
module Data.CmdItem where
import Control.Applicative ((<$>))
import Data.Either (either, partitionEither... | geraud/cmd-item | src/Data/CmdItem.hs | Haskell | mit | 2,040 |
module NinetyNine.Parser (module X) where
import NinetyNine.Parser.Char as X
import NinetyNine.Parser.Combinator as X
import NinetyNine.Parser.Prim as X
import NinetyNine.Parser.Token as X
import NinetyNine.Parser.Example.Expr as X
| airt/Haskell-99 | src/NinetyNine/Parser.hs | Haskell | mit | 233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.