code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{- | some internal definit... | ariep/TCache | src/Data/TCache/Defs.hs | Haskell | bsd-3-clause | 10,379 |
{-# LANGUAGE CPP #-}
--
-- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
--
--------------------------------------------------------------
-- Converting Core to STG Syntax
--------------------------------------------------------------
-- And, as we have the info in hand, we may convert some lets to
-- le... | GaloisInc/halvm-ghc | compiler/stgSyn/CoreToStg.hs | Haskell | bsd-3-clause | 46,809 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
@Uniques@ are used to distinguish entities in the compiler (@Ids@,
@Classes@, etc.) from each other. Thus, @Uniques@ are the basic
comparison key in the compiler.
If there is any single operation that needs to be fast, i... | sdiehl/ghc | compiler/basicTypes/Unique.hs | Haskell | bsd-3-clause | 15,888 |
{-# OPTIONS_GHC -Wall #-}
module DFS where
import Types
import Unify
import Control.Monad (forM, liftM)
import Control.Monad.Error (strMsg, throwError)
import Control.Monad.State (gets)
import Data.Maybe (catMaybes)
--import Debug.Trace
getM... | osa1/MANTI | src/DFS.hs | Haskell | bsd-3-clause | 2,117 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Text as Text
import Graphics.Blank
import Paths_blank_canvas_examples (getDataDir)
-- A bare-bones demonstration of loading and playing/pausing an audio file.
main :: IO ()
main = do
dat <- getDataDir
blankCanvas 3000 { events = ["mousedow... | ku-fpg/blank-canvas | examples/audio/Main.hs | Haskell | bsd-3-clause | 1,972 |
module CF where
-- http://rosettacode.org/wiki/Continued_fraction/Arithmetic/G(matrix_NG,_Contined_Fraction_N)#NG
-- represents the homographic transform
-- a1*z + a
-- f(z) --> --------
-- b1*z + b
import Data.Natural
import Data.List (inits)
data NG = NG {a1 :: Natural, a :: Natural, b1 :: Natur... | rzil/CF-Agda | CF.hs | Haskell | bsd-3-clause | 2,476 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Network.Hawk.Internal.Types where
import Control.Applicative
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as BL
import Data.Text (Text)
import Data.Time.Clock.POSIX ... | rvl/hsoz | src/Network/Hawk/Internal/Types.hs | Haskell | bsd-3-clause | 3,669 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
module Main (main) where
import Codec.Compression.Zlib (compress)
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO)
import Control.Concurrent.MVar
import qualified Control.Exception as C
import Control.Monad (forM, when)
import quali... | noteed/buh | bin/buh.hs | Haskell | bsd-3-clause | 28,165 |
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Dimitri Sabadie
-- License : BSD3
--
-- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com>
-- Stability : experimental
-- Portability : portable
--
-- Position in space is a 3-float vector.
--------... | phaazon/quaazar | src/Quaazar/Geometry/Position.hs | Haskell | bsd-3-clause | 1,124 |
module Tutorial where
import MFlow.Wai.Blaze.Html.All
import Data.Monoid
-- widget signature : View rendering monad returnValue
-- flow aignature: FlowM rendering monad returnValue
-- page : View v m a -> FlowM v m a
main = runNavigation "" . step $ do
r <- page $ h3 << "Basic example with inputs and links"
... | agocorona/MFlow | Demos/Tutorial 1.hs | Haskell | bsd-3-clause | 5,648 |
module Blog.BackEnd.RefererStream where
import qualified System.Log.Logger as L
import qualified Blog.FrontEnd.Views as V
import qualified Blog.Constants as C
import qualified Control.Monad as CM
import qualified Data.Map as DM
import Data.List ( isPrefixOf )
import Control.Concurrent
import Control.Concurrent.Chan
im... | prb/perpubplat | src/Blog/BackEnd/RefererStream.hs | Haskell | bsd-3-clause | 2,355 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE NoForeignFunctionInterface #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE... | kumasento/accelerate-cuda | Data/Array/Accelerate/CUDA/Execute.hs | Haskell | bsd-3-clause | 28,128 |
-- | Bot that spits out core.
module Corebot where
| chrisdone/corebot | src/Corebot.hs | Haskell | bsd-3-clause | 52 |
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDer... | david-christiansen/final-pretty-printer | Text/PrettyPrint/Final/Demos/ListDemo.hs | Haskell | mit | 3,428 |
{-# LANGUAGE NoMonomorphismRestriction, FlexibleContexts, DeriveDataTypeable #-}
-- | Diagrams-AST provides a data oriented interface to the <http://hackage.haskell.org/package/diagrams> package.
module Diagrams.AST (
-- Functions
outputImage,
runImage,
getAngleFraction,
getAngleRadians,
getAngleDegrees,
... | beni55/Diagrams-AST | src/Diagrams/AST.hs | Haskell | bsd-3-clause | 7,010 |
-- Copyright (c) 2015 Eric McCorkle. 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 conditi... | emc2/saltlang | src/salt/Control/Monad/ProofNames/Class.hs | Haskell | bsd-3-clause | 2,847 |
{-# LANGUAGE GADTs, RecordWildCards, MagicHash, ScopedTypeVariables, CPP,
UnboxedTuples #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
-- |
-- Execute GHCi messages.
--
-- For details on Remote GHCi, see Note [Remote GHCi] in
-- compiler/ghci/GHCi.hs.
--
module GHCi.Run
( run, redirectInterrupts
) where
imp... | sdiehl/ghc | libraries/ghci/GHCi/Run.hs | Haskell | bsd-3-clause | 13,446 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE EmptyDataDecls #-}
module Text.Css where
import Data.List (intersperse, intercalate)
impo... | psibi/shakespeare | Text/Css.hs | Haskell | mit | 17,915 |
-- | A script for generating unrolled versions of three R2 benchmarks
-- For example, `makeCoinBias 42` will generate a file `CoinBias42.hs`
-- containing an unrolled version of the "coinBias" model that uses an
-- array of length 42
module Unroll where
import Text.PrettyPrint (parens, space, (<+>), punctuate, int, ... | zaxtax/hakaru | haskell/Tests/Unroll/Unroll.hs | Haskell | bsd-3-clause | 5,683 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module T17296 where
import Data.Foldable
import Data.Kind
import Language.Haskell.TH hiding (Type)
import System.IO
data family Foo1 :: Type -> Type
data instance Foo1 Bool = F... | sdiehl/ghc | testsuite/tests/th/T17296.hs | Haskell | bsd-3-clause | 1,017 |
<?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="hu-HU">
<title>Alert Filters | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapre... | denniskniep/zap-extensions | addOns/alertFilters/src/main/javahelp/org/zaproxy/zap/extension/alertFilters/resources/help_hu_HU/helpset_hu_HU.hs | Haskell | apache-2.0 | 976 |
module SortProps where
import Sort
assert S0 = {sort []} ::: []
assert S1 = All x . {sort [x]} === {[x]}
assert S2 = All x1 . All x2 . {sort [x1,x2]} === {[x1,x2]}
\/ {sort [x1,x2]} === {[x2,x1]}
--assert S = S0 /\ S1 /\ S2
ordered [] = True
ordered [x] = True
ordered (x1:x2:xs) = x1<=x2... | forste/haReFork | tools/hs2alfa/tests/SortProps.hs | Haskell | bsd-3-clause | 931 |
-- Test the classic "\SOH" ambiguity
module Main(main) where
main = do { print soh ; print (length (fst (head soh))) ;
print so ; print (length (fst (head so))) }
where
so, soh :: [(String,String)]
soh = reads "\"\\SOH\"" -- Should read \SOH
so = reads "\"\\SOx\"" -- Should ... | ezyang/ghc | libraries/base/tests/reads001.hs | Haskell | bsd-3-clause | 343 |
-- Check that the record selector for maskMB unfolds in the body of f
-- At one stage it didn't because the implicit unfolding looked too big
-- Trac #2581
module ShouldCompile where
import Data.Array.Base
data MBloom s a = MB {
shiftMB :: {-# UNPACK #-} !Int
, maskMB :: {-# UNPACK #-} !Int
,... | bitemyapp/ghc | testsuite/tests/eyeball/record1.hs | Haskell | bsd-3-clause | 453 |
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --no-main #-}
| AndrewRademacher/twitter-conduit | tests/Spec.hs | Haskell | bsd-2-clause | 60 |
-- Test for trac #2141
module Foo where
foo :: () -> ()
foo x = x { foo = 1 }
| wxwxwwxxx/ghc | testsuite/tests/rename/should_fail/rnfail054.hs | Haskell | bsd-3-clause | 80 |
module Annfail13 where
-- Testing that brackets are mandatory in the ANN syntax
{-# ANN f id 1 #-}
{-# ANN f 1 :: Int #-}
f x = x | urbanslug/ghc | testsuite/tests/annotations/should_fail/annfail13.hs | Haskell | bsd-3-clause | 130 |
module Main where
import Flight
main = do
input <- readFile "input.txt"
let constraints = map parseConstraint (lines input)
print $ maxScore 2503 constraints
| corajr/adventofcode2015 | 14/Main.hs | Haskell | mit | 166 |
module Rebase.GHC.MVar
(
module GHC.MVar
)
where
import GHC.MVar
| nikita-volkov/rebase | library/Rebase/GHC/MVar.hs | Haskell | mit | 68 |
insert x [] = [x]
insert x (y:ys)
| x < y = x:y:ys
| otherwise = y : insert x ys
isort [] = []
isort (x:xs) = insert x (isort xs)
main = do
print $ isort [4, 6, 9, 8, 3, 5, 1, 7, 2]
| shigemk2/haskell_abc | insert.hs | Haskell | mit | 203 |
module Options
( Command(..)
, Options(..)
, BuildParams(..)
, AuthCreds(..)
, parseOptions
) where
import Options.Applicative
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as BS
import Data.Maybe (mapMaybe)
import Jenkins.Types
type JobId = T.Text
newtype BuildParams = B... | afiore/jenkins-tty.hs | src/Options.hs | Haskell | mit | 3,617 |
import Control.Monad.Reader.Class (ask)
import XMonad.Main (xmonad)
import XMonad.Core
( X
, spawn
, ManageHook
, layoutHook
, startupHook
, manageHook
, logHook
, modMask
, terminal
, borderWidth
, normalBorderColor
, focusedBorderColo... | iambernie/dotfiles | .xmonad/xmonad.hs | Haskell | mit | 3,536 |
sumSquareDifference :: Int
sumSquareDifference =
let boundary = 100
sumSquare = sum [i^2 | i <- [1..100]]
squareSum = sum [1..100] ^ 2
in squareSum - sumSquare
| samidarko/euler | problem006.hs | Haskell | mit | 187 |
import qualified Data.Map as Map
data Person = Person { firstName :: String
, lastName :: String
, age :: Int
, height :: Float
, phoneNumber :: String
, flavor :: String } deriving (Show)
data Car = Car { compan... | yhoshino11/learning_haskell | ch7/ch7.hs | Haskell | mit | 4,769 |
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
module Language.Jass.Codegen.Type(
toLLVMType
, toLLVMType'
, defaultValue
, jassArray
, arraySize
, sizeOfType
, codeTypeSize
, codeTypeStruct
, pointerSize
, get... | NCrashed/hjass | src/library/Language/Jass/Codegen/Type.hs | Haskell | mit | 7,842 |
{-# LANGUAGE RecordWildCards #-}
module Interactive.Pipeline
( run_pipeline, Params' (..), Params, pos )
where
-- Modules
--import Browser
import Document.Document
import Documentation.SummaryGen
import Utilities.Config hiding ( wait )
import Interactive.Observable
import Interactive.Serialize
import ... | literate-unitb/literate-unitb | src/Interactive/Pipeline.hs | Haskell | mit | 14,380 |
module System.Flannel.CommandSpec
( spec
) where
import System.Flannel.Command
import qualified System.Flannel.Params as P
import Test.Hspec
spec :: Spec
spec = do
describe "runCommand" $ do
it "executes the command" $ do
result <- runCommand P.defaultParams $ isSet "no set"
... | nahiluhmot/flannel | spec/System/Flannel/CommandSpec.hs | Haskell | mit | 2,205 |
{-# LANGUAGE OverloadedStrings #-}
module PillsHs.Config where
import Clay
-- the maximum width of the container in pixels
pillsMaxWidth :: Size Abs
pillsMaxWidth = px 1024
pillsWideMaxWidth :: Size Abs
pillsWideMaxWidth = px 1180
pillsWiderMaxWidth :: Size Abs
pillsWiderMaxWidth = px 1366
-- the minimum width of ... | polo2ro/pillshs | src/PillsHs/Config.hs | Haskell | mit | 588 |
module Lambency.UI (
UIWire, WidgetEvent(..), WidgetState(..), Widget(..), screen,
animatedSpriteRenderer, spriteRenderer, colorRenderer,
textRenderer, dynamicTextRenderer,
combineRenderers,
hbox, vbox, glue
) where
--------------------------------------------------------------------------------
import Contr... | Mokosha/Lambency | lib/Lambency/UI.hs | Haskell | mit | 8,644 |
module DotName where
-- Example from Data.Function
-- uses an infix operator as a pattern variable
-- I think the only solution is to rename to normal variable and make all uses prefix
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
(.*.) `on` f = \x y -> f x .*. f y
| antalsz/hs-to-coq | examples/tests/DotName.hs | Haskell | mit | 270 |
import Control.Concurrent (threadDelay)
import Control.Exception
import Control.Monad
import qualified Graphics.Rendering.OpenGL as GL
import Graphics.Rendering.OpenGL (($=))
import qualified Graphics.UI.GLFW as GLFW
import Prelude hiding (catch)
main = do
-- initialize has to come first. If it doesn't return True,
... | spetz911/progames | GLFW/glfw01.hs | Haskell | mit | 3,192 |
module HandBrake.T.Encode
( tests )
where
-- base --------------------------------
import Control.Applicative ( pure )
import Data.Function ( ($), (&) )
import Data.List.NonEmpty ( NonEmpty( (:|) ) )
import Data.Tuple ( fst )
import System.Exit ( ExitCode )
import System.IO (... | sixears/handbrake | src/HandBrake/T/Encode.hs | Haskell | mit | 16,599 |
import Diagrams.Prelude
import Diagrams.Backend.Cairo
import Data.Default
import Control.Lens ((^.))
import Data.List
import Data.Ord
import Diagrams.Plots
-- | project a 3d point to 2d
projection :: (Double, Double, Double) -- ^ position of camera
-> (Double, Double, Double) -- ^ orientation of camera
... | kaizhang/haskell-plot | Test.hs | Haskell | mit | 2,558 |
{-# LANGUAGE CPP, FlexibleContexts, JavaScriptFFI, OverloadedStrings #-}
import Control.Concurrent
import Control.Concurrent.STM
import Control.Exception
import Control.Monad
import Control.Monad.State
import Data.IORef
import qualified Data.Serialize as S
import qualified Data.Text as T
import System.Random
import F... | quyse/pekabeaver | Main.hs | Haskell | mit | 24,202 |
module Problem021 where
import Data.List (group)
main =
print $ sum $ filter amicable [2..10000]
amicable x = x /= x' && sumd x' == x
where x' = sumd x
sumd x = product (map f1 gs) - product (map f2 gs)
where gs = map (\g -> (head g, length g)) $ group $ factors x
f1 (p, m) = (p ^ (m + 1) - 1) `div` (... | vasily-kartashov/playground | euler/problem-021.hs | Haskell | apache-2.0 | 647 |
-- Copyright 2016 Google Inc. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable... | polux/snippets | Lamport.hs | Haskell | apache-2.0 | 9,470 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections... | gcross/LogicGrowsOnTrees | LogicGrowsOnTrees/tests/test-Examples.hs | Haskell | bsd-2-clause | 3,236 |
{-# LANGUAGE TemplateHaskell, TypeSynonymInstances, FlexibleInstances,
OverloadedStrings #-}
{-# 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
... | grnet/snf-ganeti | test/hs/Test/Ganeti/Objects.hs | Haskell | bsd-2-clause | 29,828 |
import Test.Hspec
import Test.QuickCheck
import Control.Exception (evaluate)
import GameOfLife
main :: IO ()
main = hspec $ do
describe "GameOfLife" $ do
describe "NextGeneration" $ do
it "Create valid next glider" $ do
nextGeneration (glider 5 5) `shouldBe` [
... | AM636E/HaskellGameOfLife | test/Spec.hs | Haskell | bsd-3-clause | 1,165 |
-- jrc -- json-rpc request client
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy.Char8 as B8L
import qualified Data.Streaming.Network as NetStream
import qualified Options.Applicative as Opts
import qualified Network.Socket as Socket
import Options.Applicative ((<>))
import qualified JsonR... | shmookey/bc-tools | src/jrc.hs | Haskell | bsd-3-clause | 1,515 |
{-# LANGUAGE TypeOperators #-}
-- | Test of long-life for dynamics, via three rotations:
-- rotate 5 dynamic behaviors
-- rotate 6 inputs on left
-- rotate 7 inputs on right
-- for a total 210 combinations based on clock.
module Main
( main
) where
import Sirea.Prelude
import Sirea.Clock
import Si... | dmbarbour/Sirea | tst/RotDyn.hs | Haskell | bsd-3-clause | 1,298 |
{-# LANGUAGE OverloadedStrings #-}
module Database.Tempodb.Methods.Series
( seriesCreate
, seriesGet
, seriesList
, seriesUpdate
, seriesDelete
)
where
import Control.Monad.Reader
import Data.Aeson as A
import Data.ByteString.Char8 as C8
import Data.ByteString.Lazy... | ixmatus/hs-tempodb | src/Database/Tempodb/Methods/Series.hs | Haskell | bsd-3-clause | 2,668 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Dhall.Test.TypeInference where
import Control.Exception (SomeException (..))
import Data.Text (Text)
import Prelude hiding (FilePath)
import Test.Tasty (TestTree)
import Turtle (FilePath, (</>))
import qu... | Gabriel439/Haskell-Dhall-Library | dhall/tests/Dhall/Test/TypeInference.hs | Haskell | bsd-3-clause | 4,759 |
{-# LANGUAGE RankNTypes #-}
-- This program must be called with GHC's libdir as the single command line
-- argument.
module Main where
-- import Data.Generics
import Data.Data
import Data.List
import System.IO
import GHC
import BasicTypes
import DynFlags
import MonadUtils
import Outputable
import Bag (filterBag,isEmp... | sdiehl/ghc | testsuite/tests/ghc-api/annotations/parseTree.hs | Haskell | bsd-3-clause | 3,062 |
{-# LANGUAGE FlexibleInstances, ScopedTypeVariables, TypeSynonymInstances #-}
-- |This module contains classes and functions to relate Haskell types
-- with OpenGL DataTypes (typically used to describe the values stored
-- in arrays) and VariableTypes (used as attributes and uniforms in
-- GLSL programs).
module GLUtil... | coghex/abridgefaraway | src/GLUtil/TypeMapping.hs | Haskell | bsd-3-clause | 3,818 |
{- Provides constants used by the CORDIC algorithm.
- `alistF` is a list of angles [ atan 1, atan (1/2), atan (1/4, ... ]
- `klistF` is a list of the scaling constants for each iteration
- Traditionally these would have been hard-coded for performance; they are
- generated programmatically here for simplicity.
-}
... | chronon-io/cordic | src/Util.hs | Haskell | bsd-3-clause | 935 |
-- | RSS 2.0 feed source.
-- Items are produced from RSS 2.0 feeds.
-- The itmName, itmURL and itmDescription fields are filled from the
-- corresponding RSS fields.
-- The itmTags field is populated from the RSS tags.
--
-- TODO: support for other feed formats.
module Network.LambNyaa.Source.Feed (rssFeed, r... | valderman/lambnyaa | Network/LambNyaa/Source/Feed.hs | Haskell | bsd-3-clause | 1,739 |
module Data.TestPolynomial where
import Prelude hiding (Rational, gcd, negate, (*), (+), (-), (/), (^))
import Domains.Euclidean
import Domains.Ring
import Data.Polynomial
import Data.Rational
import Collins
import TestUtil
x, x2, x3, ... | pmilne/algebra | test/Data/TestPolynomial.hs | Haskell | bsd-3-clause | 1,512 |
{-# LANGUAGE StandaloneDeriving #-}
module Data.Text.Index
(
Index
, lookupWord
, lookupPhrase
, Weight, toDouble
, size
, empty
, addDocument
, removeDocument
)where
import qualified Data.Search.Results as Results
import Data.Foldable (foldMap, for_)
import Data.Func... | ariep/text-index | src/Data/Text/Index.hs | Haskell | bsd-3-clause | 7,323 |
module Callback.MouseMove where
import qualified Data.IORef as R
import Control.Applicative ((<$>))
import qualified Utils as LU
import qualified Graphics.UI.GLFW as GLFW
import qualified AppData as AP
newMouseMoveCallback :: AP.AppDataRef -> GLFW.CursorPosCallback
newMouseMoveCallback appRef = callback
where
... | dan-t/layers | src/Callback/MouseMove.hs | Haskell | bsd-3-clause | 480 |
module Network.XMPP.Address
( XMPPLocal
, localText
, localFromText
, XMPPDomain
, domainText
, domainFromText
, XMPPResource
, resourceText
, resourceFromText
, XMPPAddress(..)
, xmppAddress'
, xmppAddress
, addressToText
... | abbradar/yaxmpp | src/Network/XMPP/Address.hs | Haskell | bsd-3-clause | 7,050 |
{-# OPTIONS -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Error
-- Copyright : (c) The FFI task force 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : ffi@haskell.org
-- Stabil... | OS2World/DEV-UTIL-HUGS | libraries/Foreign/Marshal/Error.hs | Haskell | bsd-3-clause | 2,293 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
-- | Types used while planning how to build everything in a project.
--
-- Primarily this is the 'ElaboratedInstallPlan'.
--
module Distribution.Client.ProjectPlanning.Types (
SolverInstallPlan,
-- * Elaborated in... | sopvop/cabal | cabal-install/Distribution/Client/ProjectPlanning/Types.hs | Haskell | bsd-3-clause | 20,460 |
-- 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/Time/NB/Corpus.hs | Haskell | bsd-3-clause | 22,209 |
module Test.Property where
import Prelude hiding ((>>))
import Elm.Utils ((|>), (>>))
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Test.QuickCheck.IO ()
import Reporting.Annotation (stripRegion)
import qualified AST.Module
import qualified Data.Text as Text
import qualified Data.May... | nukisman/elm-format-short | tests/Test/Property.hs | Haskell | bsd-3-clause | 3,229 |
{-# LANGUAGE PatternGuards #-}
module Main where
import Tests.Testframe
import System.Environment (getArgs)
import Data.Char (toLower)
import System.Console.GetOpt
import System.Exit (ExitCode(..), exitWith)
import System.IO (hPutStrLn, stderr)
data Flag = Alg String | TestVar String
main = do
args <- getArgs
... | hakoja/SHA3 | main.hs | Haskell | bsd-3-clause | 1,174 |
module Main where
import Conifer.Types
import Control.Monad (when)
import System.Exit (exitFailure)
import Test.HUnit
main = do
Counts c t e f <- runTestTT tests
when (e > 0 || f > 0) exitFailure
tests = TestList [
TestLabel "getUserDataFromJSON_None" $ TestCase getUserDataFromJSON_None
, Tes... | bobgru/conifer | test/unit-tests/parserTests.hs | Haskell | bsd-3-clause | 8,654 |
-- |
-- Module : Crypto.Internal.DeepSeq
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- Simple abstraction module to allow compilation without deepseq
-- by defining our own NFData class if not compiling with deepseq
-- s... | nomeata/cryptonite | Crypto/Internal/DeepSeq.hs | Haskell | bsd-3-clause | 849 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE... | octopuscabbage/UltimateTicTacToeServer | src/Account/Types.hs | Haskell | bsd-3-clause | 948 |
{-# LANGUAGE TemplateHaskell #-}
module AWS.CloudWatch.Types
where
import AWS.Lib.FromText
data Metric = Metric
{ metricDimensions :: [Dimension]
, metricName :: Text
, metricNameSpace :: Text
}
deriving (Show, Eq)
data Dimension = Dimension
{ dimensionName :: Text
, dimensionValue :: T... | IanConnolly/aws-sdk-fork | AWS/CloudWatch/Types.hs | Haskell | bsd-3-clause | 4,515 |
<?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="ru-RU">
<title>Windows WebDrivers</title>
<maps>
<homeID>top</homeID>
<mapref location=... | secdec/zap-extensions | addOns/webdrivers/webdriverwindows/src/main/javahelp/org/zaproxy/zap/extension/webdriverwindows/resources/help_ru_RU/helpset_ru_RU.hs | Haskell | apache-2.0 | 963 |
<?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>TLS Debug | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref ... | veggiespam/zap-extensions | addOns/tlsdebug/src/main/javahelp/org/zaproxy/zap/extension/tlsdebug/resources/help_fil_PH/helpset_fil_PH.hs | Haskell | apache-2.0 | 985 |
{-
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... | bitemyapp/perdure | src/Database/Perdure/AllocCopy.hs | Haskell | apache-2.0 | 2,173 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns, MagicHash, CPP, TypeFamilies #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
-- Using TemplateHaskell in text unconditionally is unacceptable, as
-- it's a GHC boot library. TemplateHaskellQuotes was added in 8.0, so
-- this would s... | bgamari/text | src/Data/Text/Lazy.hs | Haskell | bsd-2-clause | 58,598 |
{-# LANGUAGE TypeSynonymInstances #-}
module Foundation.Math.Trigonometry
( Trigonometry(..)
) where
import Basement.Compat.Base
import qualified Prelude
-- | Method to support basic trigonometric functions
class Trigonometry a where
-- | the famous pi value
pi :: a
-- | sine
sin ... | vincenthz/hs-foundation | foundation/Foundation/Math/Trigonometry.hs | Haskell | bsd-3-clause | 1,487 |
{-# LANGUAGE PatternGuards, CPP, ForeignFunctionInterface #-}
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2004-2009.
--
-- Package management tool
--
-----------------------------------------------------------------------------
module Main (main) wh... | akru/haste-compiler | utils/haste-pkg/haste-pkg.hs | Haskell | bsd-3-clause | 71,975 |
--
-- Copyright © 2013-2014 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.
--
{-# OPTIONS_GHC -fno-warn-orpha... | anchor/marquise | lib/Marquise/IO/SpoolFile.hs | Haskell | bsd-3-clause | 4,886 |
module Blockchain.SampleTransactions where
import Prelude hiding (EQ)
import qualified Data.ByteString as B
import Network.Haskoin.Internals hiding (Address)
import Blockchain.Data.Address
import Blockchain.Data.Code
import Blockchain.Data.Transaction
import Blockchain.Constants
import Blockchain.ExtendedECDSA
imp... | jamshidh/ethereum-vm | src/Blockchain/SampleTransactions.hs | Haskell | bsd-3-clause | 11,275 |
{-# LANGUAGE GeneralizedNewtypeDeriving,
FlexibleInstances,
MultiParamTypeClasses,
TypeFamilies,
StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : Network.Kontiki.Monad
-- Copyright : (c) 201... | NicolasT/kontiki | src/Network/Kontiki/Monad.hs | Haskell | bsd-3-clause | 3,757 |
{-
A simple homogeneous pair type with useful Functor, Applicative, and
Traversable instances.
-}
{-# LANGUAGE CPP #-}
module Pair ( Pair(..), unPair, toPair, swap ) where
#include "HsVersions.h"
import Outputable
import Control.Applicative
#if __GLASGOW_HASKELL__ < 709
import Data.Foldable
import Data.Monoid
impor... | green-haskell/ghc | compiler/utils/Pair.hs | Haskell | bsd-3-clause | 1,191 |
{-# language DataKinds #-}
{-# language OverloadedLists #-}
{-# language OverloadedStrings #-}
{-# language QuasiQuotes #-}
{-# language Rank2Types #-}
{-# language TypeApplications #-}
{-# language TypeFamilies #-}
module Planetary.Core.Eval.Test (unitTests, runTest, mkLogger) where
import Control.Lens
import Control... | joelburget/interplanetary-computation | src/Planetary/Core/Eval/Test.hs | Haskell | bsd-3-clause | 11,459 |
{-# LANGUAGE CPP, MagicHash #-}
-- | Dynamically lookup up values from modules and loading them.
module DynamicLoading (
#ifdef GHCI
-- * Loading plugins
loadPlugins,
loadFrontendPlugin,
-- * Force loading information
forceLoadModuleInterfaces,
forceLoadNameModuleInterf... | vTurbine/ghc | compiler/main/DynamicLoading.hs | Haskell | bsd-3-clause | 11,451 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="sr-CS">
<title>JSON View</title>
<maps>
<homeID>jsonview</homeID>
<mapref location="map... | thc202/zap-extensions | addOns/jsonview/src/main/javahelp/help_sr_CS/helpset_sr_CS.hs | Haskell | apache-2.0 | 959 |
-- | Put common type definitions here to break recursive module dependencies.
module RegAlloc.Linear.Base (
BlockAssignment,
Loc(..),
regsOfLoc,
-- for stats
SpillReason(..),
RegAllocStats(..),
-- the allocator monad
RA_State(..),
)
where
import Ghc... | ezyang/ghc | compiler/nativeGen/RegAlloc/Linear/Base.hs | Haskell | bsd-3-clause | 3,779 |
module ShouldFail where
-- strictness annotations on the argument to a newtype constructor
-- are not allowed.
newtype N a = T ![a]
| urbanslug/ghc | testsuite/tests/parser/should_fail/readFail008.hs | Haskell | bsd-3-clause | 133 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Network.IPFS.Types (
IPFS (..),
Endpoint (..),
Multihash (..),
Key,
Data,
Template (..),
FileHash (..),
Link (..),
Node (..),
Obj... | basile-henry/hs-ipfs-api | src/Network/IPFS/Types.hs | Haskell | mit | 4,247 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Output
( -- * The Output Widget
OutputWidget
-- * Constructor
, mkOutput
-- * Using the output wi... | gibiansky/IHaskell | ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Output.hs | Haskell | mit | 3,538 |
{-# LANGUAGE ScopedTypeVariables #-}
module CNFList (tests) where
import BooleanLaws
import SimplifyLaws
import BooleanModelLaws
import FreeBoolean
import Test.Tasty
import Test.QuickCheck
import Control.Applicative
import Data.Function (on)
import Data.Algebra.Boolean.Negable (Negable, Neg(..))
import Data.Algebr... | phadej/boolean-normal-forms | tests/CNFList.hs | Haskell | mit | 824 |
maybe Tips for using this guide
CodeWorld editor -> can link back to CodeWorld editor
program = drawingOf(wheel)
wheel = text("I Love Pandas!")
wheel = solidRectangle(8,4)
wheel = circle(5) --5 is radius
--multiple
program = drawingOf(design)
design = solidRectangle(4, 0.4)
& solidCircle(1.2)
& ci... | kammitama5/kammitama5.github.io | images/play_img/notes.hs | Haskell | mit | 2,382 |
-- What's up next?
-- http://www.codewars.com/kata/542ebbdb494db239f8000046
module LazyNext where
next :: Eq a => a -> [a] -> Maybe a
next _ [] = Nothing
next item [x] = Nothing
next item (x:xs) = if x == item then Just(head xs) else next item xs
| gafiatulin/codewars | src/8 kyu/LazyNext.hs | Haskell | mit | 249 |
module SuperUserSpark.Constants where
import Import
keywordCard :: String
keywordCard = "card"
keywordSpark :: String
keywordSpark = "spark"
keywordFile :: String
keywordFile = "file"
keywordInto :: String
keywordInto = "into"
keywordOutof :: String
keywordOutof = "outof"
keywordKindOverride :: String
keywordKin... | NorfairKing/super-user-spark | src/SuperUserSpark/Constants.hs | Haskell | mit | 1,189 |
{-# htermination enumFromThenTo :: () -> () -> () -> [()] #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_enumFromThenTo_2.hs | Haskell | mit | 62 |
module Control.Monad.Classes.Except where
import qualified Control.Monad.Trans.Except as Exc
import qualified Control.Monad.Trans.Maybe as Mb
import qualified Control.Exception as E
import Control.Monad
import Control.Monad.Trans.Class
import GHC.Prim (Proxy#, proxy#)
import Control.Monad.Classes.Core
import Control.Mo... | strake/monad-classes.hs | Control/Monad/Classes/Except.hs | Haskell | mit | 1,605 |
-- | A utility module containing data definitions common to the rest of the
-- code. This file is forbidden from having dependencies on any other part
-- of the codebase, except for other libraries (such as
-- Graphics.Rendering.OpenGL.Monad and its cousins).
--
-- In all cases, the dependency graph should be a... | bfops/Chess | src/Util/Defs.hs | Haskell | mit | 661 |
-- Lists
alphabet = ['a'..'z']
-- This breaks out to the full alphabet
-- lists are lazy by default, so this pulls only the first 20
first20Mults x = take 20 [0,x..]
-- cycle creates a cycle between elements, generating a repeating sequence
-- repeat just repeats the same value over and over
first20MultsComp x = fir... | ChrisCoffey/haskell_sandbox | c_1/first_func.hs | Haskell | mit | 746 |
module Mck.AST where
newtype VarId = VarId String
newtype TypeId = TypeId String
newtype Agent = Agent String
newtype ProtocolId = ProtocolId String
newtype Label = Label String
newtype Constant = Const String
data JointProtocol = JointProtocol Environment [Protocol]
data Environment = Env [TypeDec] [VarDec] [Defini... | thinkmoore/influence-checker | src/Mck/AST.hs | Haskell | mit | 4,237 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-windowsconfiguration.html
module Stratosphere.ResourceProperties.FSxFileSystemWindowsConfigura... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/FSxFileSystemWindowsConfiguration.hs | Haskell | mit | 5,291 |
module Graphics.Render.Light(
module L
, enlightNormal
, enlightNormal'
, enlightSimple
) where
import Prelude as P hiding ((<*))
import Graphics.Light as L
import Graphics.GPipe
import Data.Vec as Vec
import Math.Vector
-- | Transforms color with alpha-as-intensity to GPU color
liftVec4Color :: Vec4 F... | NCrashed/sinister | src/client/Graphics/Render/Light.hs | Haskell | mit | 5,009 |
{-# OPTIONS -Wall #-}
import Data.Functor
import qualified Data.List as List
import qualified Data.Maybe as Maybe
import qualified Data.Set as Set
import Data.Text (Text)
import Helpers.Grid (Grid, (!), (//))
import qualified Helpers.Grid as Grid
import Helpers.Parse
import Helpers.Point (Point (..))
import Text.Parse... | SamirTalwar/advent-of-code | 2021/AOC_25.hs | Haskell | mit | 2,200 |
{-# LANGUAGE ForeignFunctionInterface, EmptyDataDecls, OverloadedStrings, DeriveGeneric, DeriveDataTypeable #-}
{-
JQuery bindings, loosely based on fay-jquery
-}
module JavaScript.JQuery ( JQuery(..)
, Event(..)
, EventType
, Selector
... | mgsloan/ghcjs-jquery | JavaScript/JQuery.hs | Haskell | mit | 28,244 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.