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 System.Environment
import qualified Data.Map as Map
import qualified Data.Text as Text
import qualified Data.List as List
main = do
[s] <- getArgs
f <- readFile s
putStr ((unlines . map getChecksum . lines) f)
dict s = show(Map.toList $ Map.fromListWith (+) [(c, 1) | c <- s])
process = dict . removeDash... | VisionistInc/advent-of-code-2016 | joshgordon/04/part1.hs | Haskell | mit | 583 |
module Test.Time where
import Import
import Test.Hspec
import Station.Types.Card.Time
test :: SpecWith ()
test = do
describe "the TAI implementation" $ do
it "has the correct unixEpoch" $ do
(show unixEpoch :: Text) `shouldBe` "1970-01-01 00:00:00 UTC"
| seagreen/station | test/Test/Time.hs | Haskell | mit | 312 |
module Main where
import Test.QuickCheck
import Prelude hiding (reverse)
reverse :: [a] -> [a]
reverse [] = []
reverse (x:xs) = reverse xs ++ [x]
-- XXX: Now some quick-check property declaration
rev_rev :: [Int] -> [Int] -> Bool
rev_rev x y = reverse (x++y) == reverse y ++ reverse x
main :: IO ()
main = quickC... | amal029/haskell-tests | qcheck.hs | Haskell | mit | 333 |
module Unison.Note where
import Data.List
import Control.Monad
import Control.Applicative
-- | Hierarchical error message type used throughout Unison
newtype Note = Note [String]
-- | Monad transformer for adding notes
newtype Noted m a = Noted { unnote :: m (Either Note a) }
run :: Monad m => Noted m a -> m a
run ... | nightscape/platform | shared/src/Unison/Note.hs | Haskell | mit | 2,817 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
module Data.Streaming.Network
( -- * Types
ServerSettings
, ClientSettings
, HostPreference
, Message (..)
, AppData
#if !WINDOWS
, ServerSettingsUnix
, ClientSettingsUnix
, AppDataUnix
#endif
... | fpco/streaming-commons | Data/Streaming/Network.hs | Haskell | mit | 23,204 |
---------------------------------------------------------------------------------------------------
-----------------------------------------------Import----------------------------------------------
---------------------------------------------------------------------------------------------------
import Data.List
-... | divayprakash/haskell-course | week7programmingAssignment.hs | Haskell | mit | 5,390 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.RTCSessionDescriptionCallback
(newRTCSessionDescriptionCallback,
newRTCSessionDescriptionCallbackSync,
newRTCSessionDescriptionCallbackAsync,
RTCSessionDescriptionCallback)
wh... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/RTCSessionDescriptionCallback.hs | Haskell | mit | 2,688 |
add :: Integer -> Integer -> Integer
add x y = x + y
inc = add 1
sum' :: (Num a) => [a] -> a
sum' = foldl (+) 0 | joelbirchler/talks | _includes/function-oriented-js/add.hs | Haskell | mit | 116 |
import Control.Monad (unless)
import Test.Hspec (Spec, describe, expectationFailure, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import FoodChain (song)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
specs = describe "song" $ ... | exercism/xhaskell | exercises/practice/food-chain/test/Tests.hs | Haskell | mit | 3,899 |
module Cases
(
-- * Processor
process,
-- ** Case Transformers
CaseTransformer,
lower,
upper,
title,
-- ** Delimiters
Delimiter,
spinal,
snake,
whitespace,
camel,
-- * Default Processors
spinalize,
snakify,
camelize,
)
where
import Cases.Prelude hiding (Word)
import qualified Data.Att... | nikita-volkov/cases | library/Cases.hs | Haskell | mit | 4,015 |
module Test.Smoke.Types.Executable where
import Test.Smoke.Paths
import Test.Smoke.Types.Base
data Shell
= Shell (ResolvedPath File) Args
deriving (Eq, Show)
data Executable
= ExecutableProgram (ResolvedPath File) Args
| ExecutableScript Shell Script
deriving (Eq, Show)
| SamirTalwar/Smoke | src/lib/Test/Smoke/Types/Executable.hs | Haskell | mit | 284 |
-- |
-- Extensions to the standard mutable Vector API.
module VectorBuilder.MVector where
import Data.Vector.Generic.Mutable
import qualified VectorBuilder.Core.Builder as A
import qualified VectorBuilder.Core.Update as C
import VectorBuilder.Prelude
-- |
-- Construct a mutable vector from a builder.
--
-- Supports a... | nikita-volkov/vector-builder | library/VectorBuilder/MVector.hs | Haskell | mit | 598 |
module Data.Aeson.Schema.Types.Tests
( tests
) where
import Test.Framework
import Test.Framework.Providers.HUnit
import qualified Test.HUnit as HU
import Data.Aeson
import qualified Data.ByteString.Lazy as L
import Data.Foldable ... | Fuuzetsu/aeson-schema | test/Data/Aeson/Schema/Types/Tests.hs | Haskell | mit | 2,128 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-- | Hetcons_Transaction is a Monad for constructing transactions in which a message is processed.
-- From within Hetcons_Transaction, you can send messages (1a, 1b,... | isheff/hetcons | src/Hetcons/Receive_Message.hs | Haskell | mit | 20,820 |
{- GPC parser -}
module GPC.Parser(parseSource) where
import Control.Applicative hiding ((<|>), many, optional, empty)
import Text.ParserCombinators.Parsec
import Text.Parsec.Expr
import GPC.AST
import GPC.Lexer
import Control.Arrow
import Data.List
{- Operator Tables -}
-- | Need operators to evaluate ordinary exp... | RossMeikleham/GPC | src/GPC/Parser.hs | Haskell | bsd-2-clause | 7,596 |
-- | Controller library.
module HL.C
(module C
,App(..)
,C
,io)
where
import HL.Foundation (Handler)
import HL.Foundation as C (Route(..))
import HL.Types as C
import Control.Monad.Extra
import Data.Text as C (Text)
import Yesod as C
import Yesod.Blaze as C
-- | Controller type.
type C = Handler
| chrisdone/hl | src/HL/C.hs | Haskell | bsd-3-clause | 311 |
-- Metric Temporal Logic (MTL) operators over a discrete time
-- domain consisting of sampled time values
module Copilot.Library.MTL
( eventually, eventuallyPrev, always, alwaysBeen,
until, release, since, Copilot.Library.MTL.trigger, matchingUntil,
matchingRelease, matchingSince, matchingTrigger ) where
im... | fredyr/copilot-libraries | src/Copilot/Library/MTL.hs | Haskell | bsd-3-clause | 6,655 |
module Control.Parallel.MPI.Utils (asBool, asInt, asEnum, debugOut) where
import Foreign
import Foreign.C.Types
import System.IO.Unsafe as Unsafe
asBool :: (Ptr CInt -> IO ()) -> IO Bool
asBool f =
alloca $ \ptr -> do
f ptr
res <- peek ptr
return $ res /= 0
asInt :: (Ptr CInt -> IO ()) -> IO Int
asInt ... | bjpop/haskell-mpi | src/Control/Parallel/MPI/Utils.hs | Haskell | bsd-3-clause | 658 |
{-|
Module : Numeric.ER.Real.Arithmetic.LinearSolver
Description : arbitrary precision piece-wise something function enclosures
Copyright : (c) 2008 Jan Duracz, Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental
Portability : portab... | michalkonecny/polypaver | src/Numeric/ER/Real/Arithmetic/LinearSolver.hs | Haskell | bsd-3-clause | 3,225 |
{-# LANGUAGE ScopedTypeVariables #-}
module Spec.ExecuteF64 where
import Spec.Decode
import Spec.Machine
import Spec.ExecuteF (getRoundMode, updateFFlags, isNaN)
import Data.Int
import Data.Word
import Data.Bits
import SoftFloat
import Prelude hiding (isNaN)
execute :: forall p t. (RiscvMachine p t) => InstructionF64 ... | mit-plv/riscv-semantics | src/Spec/ExecuteF64.hs | Haskell | bsd-3-clause | 1,550 |
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-}
-- Here, we will dump the data contained in happythings_form.txt into
-- a sqlite database.
module SqlTable where
import Control.Exception
import Data.Typeable
import Text.RawString.QQ
import Database.SQLite.Simple
import Database.SQLite.Simple.Types
import Data.Text (T... | arcticmatt/happy-site | src/SqlTable.hs | Haskell | bsd-3-clause | 2,490 |
-- | Full compiler tests.
module Language.Java.Paragon.ParacSpec (main, spec) where
import Test.Hspec
import Control.Monad
import System.Directory
import System.FilePath
import Language.Java.Paragon.Error
import Language.Java.Paragon.Interaction.Flags
import Language.Java.Paragon.Parac
-- | To be able to run this ... | bvdelft/paragon | test/Language/Java/Paragon/ParacSpec.hs | Haskell | bsd-3-clause | 2,182 |
module Servant.Server.Auth.Token.RocksDB (
RocksDBBackendT
, runRocksDBBackendT
, RocksDBEnv
, newRocksDBEnv
) where
import Control.Monad.Base
import Control.Monad.Catch
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.Trans.Control
import Control.Monad.Trans.Resource
import Ser... | NCrashed/servant-auth-token | servant-auth-token-rocksdb/src/Servant/Server/Auth/Token/RocksDB.hs | Haskell | bsd-3-clause | 5,943 |
{-# LANGUAGE FlexibleContexts #-}
----------------------------------------------------------------------------------
-- |
-- Module : Tct.Processor.Bounds.Automata
-- Copyright : (c) Martin Avanzini <martin.avanzini@uibk.ac.at>,
-- Georg Moser <georg.moser@uibk.ac.at>,
-- Andreas... | ComputationWithBoundedResources/tct-trs | src/Tct/Trs/Encoding/Bounds/Automata.hs | Haskell | bsd-3-clause | 10,266 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module TCReader where
import Database.TokyoCabinet.Storable
import Control.Monad
import Control.Monad.Reader
import Database.TokyoCabinet
(
TCM
, TCDB
, HDB
, BDB
, FDB
, new
, runTCM
, OpenMode(..)
)
import qualified Database.Toky... | tom-lpsd/tokyocabinet-haskell | examples/TCReader.hs | Haskell | bsd-3-clause | 1,495 |
module Database.PostgreSQL.PQTypes.Transaction (
Savepoint(..)
, withSavepoint
, withTransaction
, begin
, commit
, rollback
, withTransaction'
, begin'
, commit'
, rollback'
) where
import Control.Monad
import Control.Monad.Catch
import Data.Function
import Data.String
import Data.Typeable
im... | scrive/hpqtypes | src/Database/PostgreSQL/PQTypes/Transaction.hs | Haskell | bsd-3-clause | 5,038 |
module Language.Xi.Base where
import Language.Xi.Base.Parser
import Language.Xi.Base.Analysis
import Language.Xi.Base.Interpreter
| fizruk/xi-base | src/Language/Xi/Base.hs | Haskell | bsd-3-clause | 131 |
{-# LANGUAGE RecordWildCards, DeriveGeneric, DeriveDataTypeable #-}
module Data.Liblinear (
Problem(..),
Example(..),
Feature(..),
Parameter(..),
Model,
train,
def,
) where
import Control.Applicative
import Control.Exception
import Control.Monad
import Data.Data
import Data.Default
import Data.Monoid
i... | tanakh/hs-liblinear | Data/Liblinear.hs | Haskell | bsd-3-clause | 5,981 |
{-# OPTIONS -Wall #-}
import qualified Esge.Run as ERun
main :: IO ()
main = do
_ <- ERun.replRun "story.esge" [
ERun.defaultRepl
]
return ()
| neosam/esge | src/esgeAdvanture.hs | Haskell | bsd-3-clause | 172 |
module Papps.Plugins.SQLExecute (
sqlResults
)
where
#ifdef sql-execute
import Database.HDBC
import Database.HDBC.MySQL
import Data.List (intercalate)
sqlResults :: String -> IO String
sqlResults sql = do
conn <- connectMySQL $ defaultMySQLConnectInfo {
mysqlHost = "localhost"
... | teneighty/papps | src/Papps/Plugins/SQLExecute.hs | Haskell | bsd-3-clause | 1,131 |
{-# LANGUAGE TemplateHaskell #-}
module Render.MSurfaceT where
import Control.Lens (makeLenses)
import qualified Data.ByteString as B
import qualified Data.Vector.Unboxed as UV
import qualified Constants
import Render.MTexInfoT
import Types
makeLenses ''MSurfaceT
newMSurface... | ksaveljev/hake-2 | src/Render/MSurfaceT.hs | Haskell | bsd-3-clause | 1,161 |
{-# OPTIONS_GHC -Wall #-}
module File.Watcher where
import Control.Concurrent (forkIO, threadDelay)
import Control.Concurrent.Chan (newChan, readChan, writeChan)
import qualified System.FSNotify as Notify
import qualified Elm.Project as Project
import Elm.Project (Project)
-- GRAPH
data Graph =
Graph
{ _el... | evancz/builder | src/File/Watcher.hs | Haskell | bsd-3-clause | 1,394 |
{-# LANGUAGE LambdaCase, TupleSections #-}
module Transformations.Optimising.EvaluatedCaseElimination where
import Data.Functor.Foldable as Foldable
import Grin.Grin
evaluatedCaseElimination :: Exp -> Exp
evaluatedCaseElimination = ana builder where
builder :: Exp -> ExpF Exp
builder = \case
ECase val alts | ... | andorp/grin | grin/src/Transformations/Optimising/EvaluatedCaseElimination.hs | Haskell | bsd-3-clause | 476 |
-- | Uhit test that seeds a 3D grid with a few points, computes the
-- Euclidean distance transform of that grid, then checks a few points
-- to see if the distance transformed grid agrees with an exhaustive
-- nearest-neighbor search.
module Main (main) where
import qualified Data.Vector.Unboxed as V
import qualified ... | acowley/DistanceTransform | src/tests/Main.hs | Haskell | bsd-3-clause | 1,907 |
{-# LANGUAGE TypeFamilies, Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Mem.StableName.Dynamic
-- Copyright : (c) Edward Kmett 2010
-- License : BSD3
-- Maintainer : ekmett@gmail.com
-- Stability : experimental
-- Portability : ... | FranklinChen/stable-maps | System/Mem/StableName/Dynamic.hs | Haskell | bsd-3-clause | 3,405 |
module Database.Persist.SqlBackend.Internal.IsolationLevel where
import Data.String (IsString(..))
-- | Please refer to the documentation for the database in question for a full
-- overview of the semantics of the varying isloation levels
data IsolationLevel = ReadUncommitted
| ReadCommitted
... | paul-rouse/persistent | persistent/Database/Persist/SqlBackend/Internal/IsolationLevel.hs | Haskell | mit | 760 |
module Main where
import HEP.Kinematics.TwoBody
import Control.Applicative (liftA2)
import Control.Monad (replicateM)
import System.Random.MWC
main :: IO ()
main = do
rs <- createSystemRandom >>= genRandoms 10
let twobodies = map (mkTwoBodyEvent 250 (0, 0, 125, 91)) rs
mapM_ print (twobodies ... | cbpark/hep-kinematics | examples/twobody.hs | Haskell | bsd-3-clause | 498 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
TcMatches: Typecheck some @Matches@
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
module TcMatches ( tcMatchesFun, tcGRHS... | olsner/ghc | compiler/typecheck/TcMatches.hs | Haskell | bsd-3-clause | 48,118 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[PatSyntax]{Abstract Haskell syntax---patterns}
-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Undecida... | bitemyapp/ghc | compiler/hsSyn/HsPat.hs | Haskell | bsd-3-clause | 20,048 |
{-# language OverloadedLists #-}
{-# language OverloadedStrings #-}
{-# language TypeFamilies #-}
module Planetary.Core.Syntax.Test (unitTests) where
import Network.IPLD
import EasyTest
import Planetary.Core
import Planetary.Support.Ids
unitTy :: ValTy Cid
unitTy = DataTy (UidTy unitId) []
unitTests :: Test ()
unit... | joelburget/interplanetary-computation | src/Planetary/Core/Syntax/Test.hs | Haskell | bsd-3-clause | 897 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyl... | frantisekfarka/ghc-dsi | compiler/nativeGen/X86/RegInfo.hs | Haskell | bsd-3-clause | 2,135 |
{-# LANGUAGE TypeFamilies, MonoLocalBinds #-}
module T12526 where
import Data.Kind (Type)
type family P (s :: Type -> Type) :: Type -> Type -> Type
type instance P Signal = Causal
type family S (p :: Type -> Type -> Type) :: Type -> Type
type instance S Causal = Signal
class (P (S p) ~ p) => CP p
instance CP Causal... | sdiehl/ghc | testsuite/tests/indexed-types/should_compile/T12526.hs | Haskell | bsd-3-clause | 1,133 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Trustworthy #-} -- can't use Safe due to IsList instance
{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.List.NonEmpty
-- Copyright : (C) 2011-2015 ... | tolysz/prepare-ghcjs | spec-lts8/base/Data/List/NonEmpty.hs | Haskell | bsd-3-clause | 18,806 |
{-
- Id Example Program
- Ensnaffled by SLPJ from MIT via
- RPaul <rpaul@juicy-juice.lcs.mit.edu> 93/08/26.
- Original author: Steve Heller
-}
module Main (main) where
import Data.Array
import System.Environment
-- Generation of radicals
data Radical = H | C Radical Radical Radical
three_partitions :: Int -> [... | seereason/ghcjs | test/nofib/imaginary/paraffins/Main.hs | Haskell | mit | 2,657 |
{-# LANGUAGE ImplicitParams #-}
-- !!! Implicit parameter test
module Main where
main = do { let ?x = 13 in putStrLn $ show $ foo
; let ?x = 14 in putStrLn $ show $ baz () }
foo :: (?x :: Int) => Int
foo = ?x
-- Check that defaulting works too
baz () = ?x
| ezyang/ghc | testsuite/tests/typecheck/should_run/tcrun012.hs | Haskell | bsd-3-clause | 272 |
module Q where
q = "DO NOT SEE ME"
| mydaum/cabal | cabal-testsuite/PackageTests/InternalLibraries/q/Q.hs | Haskell | bsd-3-clause | 35 |
----------------------------------------------------------------
--
-- | aartifact
-- http://www.aartifact.org/
--
-- Contributors to this module:
-- Andrei Lapets
-- David House
--
-- @src\/ContextHypergraph.hs@
--
-- Data structure for a hypergraph with a defined closure
-- function.
--
-----------------... | aartifact/aartifact-verifier | src/ContextHypergraph.hs | Haskell | mit | 5,263 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.Matrix.Hermitian.Banded
(BandedHMatrix(..)
,vecChangeRep
,TriangularRepr
,upperRep
,lowerRep
... | lensky/hs-matrix | lib/Data/Matrix/Hermitian/Banded.hs | Haskell | mit | 8,204 |
{-# LANGUAGE ScopedTypeVariables #-}
module Real
( real
) where
import Test.QuickCheck.Checkers (EqProp, inverseL)
import Test.Tasty (testGroup, TestTree)
import Test.Tasty.QuickCheck (testProperty, Arbitrary)
real :: forall a. (Arbitrary a, EqProp a, Show a, Fractional a, Real a) =>
(a -> Rational) -> T... | expipiplus1/exact-real | test/Real.hs | Haskell | mit | 845 |
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Criterion.Main
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Examples
import Database.HLINQ.Deconstructor
import Database.HLINQ.Utilities
import System.IO.Unsafe
import qualified Query as HDB
normalisedCompose fun = do
exp <- runQ $ (no... | juventietis/HLINQ | benchmark/Main.hs | Haskell | mit | 4,599 |
-- This module manages the movement through Hyperspace
-- and the transistion from a ship being in Hyperspace
-- to being landed on a destination planet
module IX.Universe.HyperSpace
(manageTravel
,evalHyp
,evalSetSpeed
,evalHypComm
,evalMove
,commTransitions
,changeShip
,getName
,getPlanet
... | mlitchard/IX | src/IX/Universe/HyperSpace.hs | Haskell | mit | 9,033 |
-- Imports
import qualified Data.Map.Strict as M
import Data.Map.Strict((!))
import Utils
import System.Environment
--import Debug.Trace
import qualified FeatherweightJava as FJ
-- Data types
type KlassName = String
type MethodName = String
type FieldName = String
type ObjectName = String
data KlassType = SimpleKlas... | swistak35/fgj_interpreter | main_fgj.hs | Haskell | mit | 19,542 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
module Control.Applicative.Extra
( dispatchA
, dispatchByA
, dispatchWhenA
) where
import Prelude (error)
import Data.List
import Data.String
import Data.Bool
import Data.Eq
import Data.Function
import Data.Int
-- import Data.Ord
import Data.Functor
import Saf... | circuithub/circuithub-prelude | Control/Applicative/Extra.hs | Haskell | mit | 4,005 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Text.Html.PigLet.Th
( makeTemplate
, setContent
, embedContent
, addAttr
, pass
, Selector (..))
where
import Util.BlazeFromHtml hiding (main)
import Util.GenerateHtmlCombinators hiding (main)
import Text.HTML.TagSoup
im... | kkspeed/PigLet | src/Text/Html/PigLet/Th.hs | Haskell | mit | 5,284 |
module Parser where
import Text.ParserCombinators.Parsec
import Control.Applicative hiding ((<|>))
import Stack
number :: Parser String
number = many1 digit
minus :: Parser String
minus = (:) <$> char '-' <*> number
integer :: Parser String
integer = {- plus <|> -} minus <|> number
float :: Parser Float
float = ... | JonHarder/RPNCalc | src/Parser.hs | Haskell | mit | 1,330 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Integration.Foreign.Lua.APISpec (spec) where
import qualified Data.Text as T
import TestImport hiding (assertEqual)
import Test.HUnit (assertEqual, assertFailure)
import qualified Foreign.Lua as Lua
import Foreign.Lua.Types (LuaExtra(LuaExtra... | rzetterberg/alven | src/test/Integration/Foreign/Lua/APISpec.hs | Haskell | mit | 3,498 |
riffle :: [a] -> [a] -> [a]
riffle xs ys = concat [[x,y] | (x,y) <- xs `zip` ys]
| AkronCodeClub/edX-FP101x-Oct-2014 | ryan_p/HW1029/Riffle.hs | Haskell | mit | 81 |
module Auth0.API.Management where
| kelecorix/api-auth0 | src/Auth0/API/Management.hs | Haskell | mit | 35 |
{-# OPTIONS_GHC -Wall #-}
module LogAnalysis ( module Log
, parseMessage
, parse
, insert
, build
, inOrder
, whatWentWrong ) where
import Log
parseMessage :: String -> LogMessage
parseMessage line = cas... | mgrabovsky/upenn-cis194 | hw02/LogAnalysis.hs | Haskell | cc0-1.0 | 1,556 |
{-
Copyright 2016, Dominic Orchard, Andrew Rice, Mistral Contrastin, Matthew Danish
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
... | dorchard/camfort | src/Camfort/Specification/Stencils/Syntax.hs | Haskell | apache-2.0 | 10,412 |
{-
Copyrights (c) 2016. Samsung Electronics Ltd. All right reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | ryzhyk/cocoon | cocoon/P4/Header.hs | Haskell | apache-2.0 | 5,613 |
--Modules.
--import Data.List
-- :m + Data.List Data.Map Data.Set --No GHCI
-- import Data.List (nub, sort) --Métodos específicos
-- import Data.List hiding (nub) --Retira método específico
-- import qualified Data.Map as M -- Com namespace (customizado)
import Data.List
import Data.Char
import qualified Data.Map as ... | WillGluck/HaskellPlayground | modulesPlayground.hs | Haskell | apache-2.0 | 8,070 |
module Auth0.Management.Rules where
--------------------------------------------------------------------------------
import Data.Aeson
import Data.Proxy
import Data.Text
import GHC.Generics
import Servant.API
import Servant.Client
--------------------------------------------------------------------------------
import ... | alasconnect/auth0 | src/Auth0/Management/Rules.hs | Haskell | apache-2.0 | 3,305 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QTextFrame.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:21
Warning : this file is machine generated - do no... | uduki/hsQt | Qtc/Gui/QTextFrame.hs | Haskell | bsd-2-clause | 11,437 |
-- {-# INCLUDE <FTGL/ftgl.h> #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -O2 -fglasgow-exts #-}
-- | * Author: Jefferson Heard (jefferson.r.heard at gmail.com)
--
-- * Copyright 2008 Renaissance Computing Institute < http://www.renci.org >
--
-- * License: GNU LGPL
--
-- * Compatibility GHC... | rvion/ftgl-haskell | Graphics/Rendering/FTGL.hs | Haskell | bsd-2-clause | 13,377 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
... | oisdk/Expr | expr-playgrounds/src/Numeric/Expr.hs | Haskell | bsd-3-clause | 15,483 |
module ParsecExpr(module Text.ParserCombinators.Parsec.Expr) where
import Text.ParserCombinators.Parsec.Expr
| OS2World/DEV-UTIL-HUGS | oldlib/ParsecExpr.hs | Haskell | bsd-3-clause | 109 |
-- 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. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
module Duckling.D... | rfranek/duckling | tests/Duckling/Distance/KO/Tests.hs | Haskell | bsd-3-clause | 603 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Path.CheckInstall where
import Control.Monad.Extra (anyM, (&&^))
import qualified Data.Text as T
import Stack.Prelude
import qualified System.Directory as D
import qualified System.FilePa... | MichielDerhaeg/stack | src/Path/CheckInstall.hs | Haskell | bsd-3-clause | 2,507 |
{-# LANGUAGE RankNTypes #-}
module FreeM where
import Control.Monad
import Data.Profunctor
newtype FreeM a = FreeM { foldM :: forall m. Monoid m => (a -> m) -> m }
instance Monoid (FreeM a) where
mempty = FreeM $ const mempty
mappend (FreeM a) (FreeM b) = FreeM $ liftM2 mappend a b
lift :: a -> FreeM a
lift a ... | isovector/category-theory | src/FreeM.hs | Haskell | bsd-3-clause | 412 |
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE TemplateHaskellQuotes #-}
#else
{-# LANGUAGE TemplateHaskell #-}
#endif
------------------------------------------------------------------------------
-- |
-- Module: Database.PostgreSQL.Simple.TypeInfo.Macro
-- Copyright: (c) 2013 Leon P Smith
--... | tomjaguarpaw/postgresql-simple | src/Database/PostgreSQL/Simple/TypeInfo/Macro.hs | Haskell | bsd-3-clause | 1,721 |
module System.Timeout.Resettable ( module System.Timeout.Resettable.ADT ) where
import System.Timeout.Resettable.ADT
| basvandijk/resettable-timeouts | System/Timeout/Resettable.hs | Haskell | bsd-3-clause | 117 |
{-# LANGUAGE NoImplicitPrelude #-}
--
-- Photon map generator
--
module Main where
import Control.Monad
import NumericPrelude
import Ray.Algebra
import Ray.Physics
import Ray.Light
import Tracer
import Scene
nphoton = 10000 :: Int
main :: IO ()
main = do
let tflux = sum $ map flux lgts
putStrLn $ show (tflux... | eijian/raytracer | app/old/Main-0.hs | Haskell | bsd-3-clause | 529 |
{-# Language DeriveDataTypeable #-}
{-# Language LambdaCase #-}
{-# Language OverloadedStrings #-}
{-# Language TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.River.Arbitrary (
X(..)
) where
import Data.Char (ord)
import qualified Data.HashSet as HashSet
import qualified Data.Tex... | jystic/river | test/Test/River/Arbitrary.hs | Haskell | bsd-3-clause | 4,479 |
{-# LANGUAGE Rank2Types, TemplateHaskell, BangPatterns, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Numeric.AD.Mode.Chain
-- Copyright : (c) Edward ... | yairchu/ad | src/Numeric/AD/Mode/Chain.hs | Haskell | bsd-3-clause | 8,247 |
{-# LANGUAGE CPP, NamedFieldPuns, NondecreasingIndentation #-}
{-# OPTIONS_GHC -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
-----------------------------------------------------------------------------
--
-- GHC Driver
--
-- (c) The University of Glasgow 2005
--
------------------------------... | holzensp/ghc | compiler/main/DriverPipeline.hs | Haskell | bsd-3-clause | 97,028 |
-- 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. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE GADT... | rfranek/duckling | Duckling/Rules/IT.hs | Haskell | bsd-3-clause | 1,397 |
-- 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. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE Over... | rfranek/duckling | Duckling/Numeral/CS/Corpus.hs | Haskell | bsd-3-clause | 1,094 |
{-# LANGUAGE OverloadedStrings #-}
module Is_Point_In_Path where
import Graphics.Blank
import Wiki -- (400,400)
main :: IO ()
main = blankCanvas 3000 $ \ context -> do
send context $ do
strokeStyle "blue";
beginPath();
rect(100,100,200,200)
cmds <- sequence [ do
... | ku-fpg/blank-canvas | wiki-suite/Is_Point_In_Path.hs | Haskell | bsd-3-clause | 824 |
module ScrabbleScoreKata.Day8Spec (spec) where
import Test.Hspec
import ScrabbleScoreKata.Day8 (score)
spec :: Spec
spec = do
it "is zero when given an empty input" $ do
score "" `shouldBe` 0
it "is 1 when given lowercase 'a'" $ do
score "a" `shouldBe` 1
... | Alex-Diez/haskell-tdd-kata | old-katas/test/ScrabbleScoreKata/Day8Spec.hs | Haskell | bsd-3-clause | 1,080 |
{-# LANGUAGE FlexibleContexts #-}
import Plots
import Plots.Axis
import Plots.Types hiding (B)
import Data.List
import Dataset
import Diagrams.Prelude
import Diagrams.Backend.Rasterific
mydata1 = [(1,3), (2,5.5), (3.2, 6), (3.5, 6.1)]
mydata2 = mydata1 & each . _1 *~ 0.5
mydata3 = [V2 1.2 2.7, V2 2 5.1, V2 3.2 2.6,... | bergey/plots | examples/others.hs | Haskell | bsd-3-clause | 1,113 |
{-#Language DeriveFunctor
, DeriveFoldable
, DeriveTraversable
#-}
module Language.TheExperiment.AST.Module where
import Text.Parsec.Pos
import Data.Foldable
import Data.Traversable
import Language.TheExperiment.AST.Statement
data Module a = Module SourcePos [Definition a]
deriving... | jvranish/TheExperiment | src/Language/TheExperiment/AST/Module.hs | Haskell | bsd-3-clause | 370 |
import Test.DocTest
main = doctest ["-isrc:console", "Main"] | garethrowlands/marsrover | src/Doctests.hs | Haskell | bsd-3-clause | 61 |
-- Applicative parser for infix arithmetic expressions without any
-- dependency on hackage. Builds an explicit representation of the
-- syntax tree to fold over using client-supplied semantics.
module Spring13.Week5.Parser (parseExp) where
import Control.Applicative hiding (Const)
import Control.Arrow
import Data.Char... | bibaijin/cis194 | src/Spring13/Week5/Parser.hs | Haskell | bsd-3-clause | 3,758 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
-----------------------------------------------------------------------------
-- |
-- Module : Servant.Matlab
-- License : BSD3
-- Maintainer : Greg Hale <imalsogreg@g... | imalsogreg/servant-matlab | src/Servant/Matlab.hs | Haskell | bsd-3-clause | 4,665 |
{-# LANGUAGE RecordWildCards #-}
module System.IO.Streams.Realtime where
------------------------------------------------------------------------------
import Control.Concurrent (threadDelay)
import Control.Monad (when,(>=>))
import Data.Time ... | imalsogreg/realtime-streams | src/System/IO/Streams/Realtime.hs | Haskell | bsd-3-clause | 3,100 |
{-
SockeyeASTMeta.hs: AST metadata for Sockeye
Part of Sockeye
Copyright (c) 2018, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not find this file, copies can be found by writing to:
ETH Zurich D-INFK, CAB F.... | kishoredbn/barrelfish | tools/sockeye/SockeyeASTMeta.hs | Haskell | mit | 741 |
{-# OPTIONS_GHC -F -pgmF htfpp -fno-warn-missing-signatures #-}
module MultiTrieTest where
import Prelude hiding (null, repeat, map)
import Data.MultiTrie
import Data.Int
import qualified Data.Map as M
import qualified Data.List as L
import Test.Framework
{-# ANN module "HLint: ignore Use camelCase" #-}
type TestMu... | vadimvinnik/multi-trie | tests/MultiTrieTest.hs | Haskell | mit | 6,168 |
-- | Open a window and get an OpenGL context.
module Window (UI(..), initGL, terminate, EventKey(..)) where
import Control.Concurrent.STM (TQueue, atomically, newTQueueIO, tryReadTQueue, writeTQueue)
import Prelude hiding (init)
import Control.Applicative
import Control.Monad (when)
import Data.IORef
import Data.Ma... | bgaster/blocks | Window.hs | Haskell | mit | 3,987 |
<?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="fr-FR">
<title>Python Scripting</title>
<maps>
<homeID>top</homeID>
<mapref location="... | veggiespam/zap-extensions | addOns/jython/src/main/javahelp/org/zaproxy/zap/extension/jython/resources/help_fr_FR/helpset_fr_FR.hs | Haskell | apache-2.0 | 967 |
{-# LANGUAGE DeriveFoldable, DeriveFunctor, DeriveTraversable #-}
module Ermine.Core.Module
( Module(Module)
, definitions
, termExports
, instances
, types
, dataDecls
) where
import Control.Applicative
import Control.Lens
import Data.Binary as Binary
import Data.Bytes.Serial
import Data.ByteString
import Data... | PipocaQuemada/ermine | src/Ermine/Core/Module.hs | Haskell | bsd-2-clause | 2,792 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Functor.Compose
-- Copyright : (c) Ross Paterson 2010
-- License : BSD-style (see the file... | vTurbine/ghc | libraries/base/Data/Functor/Compose.hs | Haskell | bsd-3-clause | 3,246 |
{-# LANGUAGE NamedFieldPuns #-}
-- | Pure functions for working with CompileState
module Fay.Compiler.State where
import Fay.Compiler.Misc
import Fay.Compiler.QName
import qualified Fay.Exts.NoAnnotation as N
import Fay.Types
import qualified Data.Map as M
import ... | beni55/fay | src/Fay/Compiler/State.hs | Haskell | bsd-3-clause | 2,774 |
-- |
-- Module : Crypto.Cipher.Types
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : Stable
-- Portability : Excellent
--
-- Symmetric cipher basic types
--
{-# LANGUAGE DeriveDataTypeable #-}
module Crypto.Cipher.Types
(
-- * Cipher classes
Cipher(..)... | vincenthz/cryptonite | Crypto/Cipher/Types.hs | Haskell | bsd-3-clause | 878 |
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
module Haskell.Ide.Engine.Transport.JsonHttp.Undecidable where
import Data.Singletons.Prelude
import Haskell.Ide.Engine.PluginDescriptor
data ContextMappingFun... | JPMoresmau/haskell-ide-engine | src/Haskell/Ide/Engine/Transport/JsonHttp/Undecidable.hs | Haskell | bsd-3-clause | 567 |
--
-- Copyright © 2013-2015 Anchor Systems, Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
-- the 3-clause BSD licence.
--
{-# LANGUAGE DeriveDataTypeable... | jasonzoladz/oauth2-server | lib/Network/OAuth2/Server/Types/Client.hs | Haskell | bsd-3-clause | 7,280 |
-----------------------------------------------------------------------------
-- Dummy module to import all of the Hugs libraries; programmers should
-- normally be more selective than this when it comes to specifying the
-- modules that a particular program depends on.
--
-- Suitable for use with Hugs 98
-------------... | OS2World/DEV-UTIL-HUGS | oldlib/HugsLibs.hs | Haskell | bsd-3-clause | 652 |
module SortTest where
import Util.Sort
import Test.HUnit
tests = test [ "test1" ~: "quicksort [0]," ~: [0] ~=? (quicksort [0]),
"test2" ~: "quicksort [1,0,2]," ~: [0,1,2] ~=? (quicksort [1,0,2]) ]
-- test1 = TestCase (assertEqual "quicksort [0]," [0] (quicksort [0]))
-- test2 = TestCase (assertEqual "... | tohosokawa/haskell-dev-env | Test/SortTest.hs | Haskell | bsd-3-clause | 440 |
<?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>SVN Digger Files</title>
<maps>
<homeID>svndigger</homeID>
<mapref locat... | thc202/zap-extensions | addOns/svndigger/src/main/javahelp/help_da_DK/helpset_da_DK.hs | Haskell | apache-2.0 | 967 |
<?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="es-ES">
<title>DOM XSS Active Scan Rule | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | kingthorin/zap-extensions | addOns/domxss/src/main/javahelp/org/zaproxy/zap/extension/domxss/resources/help_es_ES/helpset_es_ES.hs | Haskell | apache-2.0 | 985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.