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
module Beowulf.Style.Colors where import Beowulf.Style aliceBlue :: ColorT aliceBlue = Hex 0xF0F8FF antiqueWhite :: ColorT antiqueWhite = Hex 0xFAEBD7 aqua :: ColorT aqua = Hex 0x00FFFF aquamarine :: ColorT aquamarine = Hex 0x7FFFD4 azure :: ColorT azure = Hex 0xF0FFFF beige :: ColorT beige = Hex 0xF5F5DC bisque :: C...
jrahm/Beowulf
Beowulf/Style/Colors.hs
Haskell
bsd-2-clause
6,332
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ViewPatterns #-} module Tests.Transform ( tests ) where import Data.Bits ((.&.), shiftL) import Data.Complex (Complex((:+))) import Data.Functor ((<$>)) import Statistics.Function (with...
00tau/statistics
tests/Tests/Transform.hs
Haskell
bsd-2-clause
5,615
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} module LiuMS where import Control.Monad import Control.Monad.Reader import Control.Monad.Trans.Except import Control.Monad.IO.Class import System.Directory import Data.ByteStrin...
notcome/liu-ms-adult
src/LiuMS.hs
Haskell
bsd-3-clause
2,373
----------------------------------------------------------------------------- -- -- Module : Code.Generating.Utils.Syntax.Exp -- Copyright : (c) 2011 Lars Corbijn -- License : BSD-style (see the file /LICENSE) -- -- Maintainer : -- Stability : -- Portability : -- -- | -- -------------------------------...
Laar/CodeGenerating
src/Code/Generating/Utils/Syntax/Exp.hs
Haskell
bsd-3-clause
1,715
module SMACCMPilot.GCS.Gateway.ByteString where import Data.ByteString (ByteString) import qualified Data.ByteString as B import Text.Printf import SMACCMPilot.GCS.Gateway.Monad bytestringPad :: Integer -> ByteString -> GW ByteString bytestringPad l bs = if B....
GaloisInc/smaccmpilot-gcs-gateway
SMACCMPilot/GCS/Gateway/ByteString.hs
Haskell
bsd-3-clause
1,323
{-# LANGUAGE OverloadedStrings #-} module HStyle.Block.Tests ( tests ) where import Test.Framework (Test, testGroup) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit (Assertion, (@?=)) import qualified Data.Text as T import HStyle.Block tests :: Test tests = testGroup "HStyle.Block.Tests" ...
mightybyte/hstyle
tests/HStyle/Block/Tests.hs
Haskell
bsd-3-clause
1,079
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module Main ( main ) where -------------------------------------------------------------------------------- import Control.Concurrent (forkIO) import Control.Monad (fo...
mattjbray/super-bomber-elf-haskell
app/Main.hs
Haskell
bsd-3-clause
5,885
-- | -- Navigable tree structure which allow a program to traverse -- up the tree as well as down. -- copied and modified from HXML (<http://www.flightlab.com/~joe/hxml/>) -- module Yuuko.Data.NavTree ( module Yuuko.Data.NavTree , module Yuuko.Data.Tree.NTree.TypeDefs ) where import Yuuko.Data.Tree.NTree....
nfjinjing/yuuko
src/Yuuko/Data/NavTree.hs
Haskell
bsd-3-clause
3,027
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} -- {-# LANGUAGE DataKinds #-} -- {-# LANGUAGE TypeOperators #-} module Ivory.Opts.CFG ( callGraphDot -- ** Generate a dot file of the control flow for a program. ,...
Hodapp87/ivory
ivory-opts/src/Ivory/Opts/CFG.hs
Haskell
bsd-3-clause
15,612
{- Implements the judgement freshTy given in Chapter 5. Also defines the monad Mfresh in which these judgements can be expressed -} module HOCHC.Fresh(freshVar, freshVarx,freshRel,freshTy,freshEnv, Mfresh, lift, runStateT, runFresh) where import HOCHC.DataTypes import Control.Monad (liftM, ap) import Contro...
penteract/HigherOrderHornRefinement
HOCHC/Fresh.hs
Haskell
bsd-3-clause
1,553
-- The Compiler Toolkit: configuration switches -- -- Author : Manuel M. T. Chakravarty -- Created: 3 October 95 -- -- Version $Revision: 1.3 $ from $Date: 1999/09/27 08:44:42 $ -- -- Copyright (c) [1995...1999] Manuel M. T. Chakravarty -- -- This library is free software; you can redistribute it and/or -- modif...
mwotton/ctkl
src/Text/CTK/Config.hs
Haskell
bsd-3-clause
1,591
module Protocol.PeerSpec (spec) where import Protocol.Peer -- import Protocol.Types import Test.Hspec import qualified Data.ByteString as B -- import qualified Data.ByteString.Char8 as B8 spec :: Spec spec = do describe "buildBitField" $ do it "should build bitfield" $ do -- 1100 1000 => ...
artems/FlashBit
specs/Protocol/PeerSpec.hs
Haskell
bsd-3-clause
488
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} {-| Binary instances for the core datatypes -} module Idris.Core.Binary where import Control.Applicative ((<*>), (<$>)) import Control.Monad (liftM2) import Control.DeepSeq (($!!)) import Data.Binary import Data.Vector.Binary import qualified Data.Text as T import quali...
athanclark/Idris-dev
src/Idris/Core/Binary.hs
Haskell
bsd-3-clause
25,274
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.VertexAttribBinding -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : port...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/VertexAttribBinding.hs
Haskell
bsd-3-clause
1,088
{-# LANGUAGE ViewPatterns, PatternGuards, TupleSections #-} module Input.Set(setStackage, setPlatform, setGHC) where import Control.Applicative import Data.List.Extra setStackage :: IO [String] setStackage = f . lines <$> readFile "input/stackage.txt" where f (x:xs) | Just x <- stripPrefix "constraints:...
ndmitchell/hogle-dead
src/Input/Set.hs
Haskell
bsd-3-clause
805
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} -------...
cchalmers/dense
src/Data/Dense/TH.hs
Haskell
bsd-3-clause
21,747
import Data.List (unfoldr, reverse) import Data.Char (chr, ord) decToBin :: Int -> String decToBin x = reverse $ unfoldr helper x where helper 0 = Nothing helper x = Just (chr ((ord '0') + (x `mod` 2)), x `div` 2) palindromic xs = xs == reverse xs main = print $ sum $ [ x | x <- [1 .. 999999], palindromic (s...
foreverbell/project-euler-solutions
src/36.hs
Haskell
bsd-3-clause
355
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} module Main (main) where import Client.Connection import Control.Concurrent (forkIO, threadDelay) import Control.Concurrent.MVar (newEmptyMVar, takeMVar, putMVar, MVar) import Control.Concurrent.STM (atomical...
nschoe/hpt
src/Main.hs
Haskell
bsd-3-clause
12,318
module Ghazan.Speed ( ) where
Cortlandd/ConversionFormulas
src/Ghazan/Speed.hs
Haskell
bsd-3-clause
35
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANG...
kadena-io/pact
src-tool/Pact/Analyze/Eval/Numerical.hs
Haskell
bsd-3-clause
6,973
{-- snippet lend --} lend amount balance = let reserve = 100 newBalance = balance - amount in if balance < reserve then Nothing else Just newBalance {-- /snippet lend --} {-- snippet lend2 --} lend2 amount balance = if...
binesiyu/ifl
examples/ch03/Lending.hs
Haskell
mit
776
{-# OPTIONS_GHC -Wno-missing-import-lists #-} -- | Optional parameters for actions. module Strive.Options ( module Strive.Options.Activities , module Strive.Options.Athletes , module Strive.Options.Authentication , module Strive.Options.Clubs , module Strive.Options.Comments , module Strive.Options.Friends...
tfausak/strive
source/library/Strive/Options.hs
Haskell
mit
776
{-# LANGUAGE OverloadedStrings #-} module Ketchup.Auth ( basicAuth ) where import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Base64 as B64 import Ketchup.Httpd import Ketchup.Utils -- |Performs HTTP Basic Auth basicAuth :: [(B.ByteString, B.ByteString)] -- ^...
silverweed/ketchup
Ketchup/Auth.hs
Haskell
mit
1,333
{-# LANGUAGE TemplateHaskell #-} {-| This module defines the type constraint closure operation. -} module Language.K3.TypeSystem.Closure ( calculateClosure ) where import Control.Monad import qualified Data.Map as Map import qualified Data.Set as Set import Language.K3.Utils.Pretty import Language.K3.TypeSystem.Da...
DaMSL/K3
src/Language/K3/TypeSystem/Closure.hs
Haskell
apache-2.0
7,097
{- Copyright 2013 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 law or agreed to in ...
mzero/plush
src/Plush/Job/StdIO.hs
Haskell
apache-2.0
3,591
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Program : ashellogl.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:43 Warning : this file is machine generated - do not...
uduki/hsQt
examples/ashellogl.hs
Haskell
bsd-2-clause
10,811
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-} -- | -- Module : Statistics.Distribution.FDistribution -- Copyright : (c) 2011 Aleksey Khudyakov -- License : BSD3 -- -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : portable -- -- Fisher F distribution module Statistics.Distribu...
fpco/statistics
Statistics/Distribution/FDistribution.hs
Haskell
bsd-2-clause
3,389
{-# LANGUAGE DeriveDataTypeable #-} module Network.Bluetooth.Exception (BluetoothException(..)) where import Control.Exception import Data.Typeable import Network.Bluetooth.Protocol data BluetoothException = BluetoothPortException BluetoothProtocol BluetoothPort deriving Typeable instance Show BluetoothException w...
bneijt/bluetooth
src/Network/Bluetooth/Exception.hs
Haskell
bsd-3-clause
654
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | Server and client game state types and operations. module Game.LambdaHack.Client.State ( StateClient(..), defStateClient, defaultHistory , updateTarget, getTarget, updateLeader, sside , PathEtc, TgtMode(..), RunParams(..), LastRecord, EscAI(..) , toggleMarkVision...
Concomitant/LambdaHack
Game/LambdaHack/Client/State.hs
Haskell
bsd-3-clause
10,273
-- 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/TypeErrors/Class.hs
Haskell
bsd-3-clause
3,765
#if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Safe #-} #endif -- | Produces XHTML 1.0 Frameset. module Text.XHtml.Frameset ( -- * Data types Html, HtmlAttr, -- * Classes HTML(..), ADDATTRS(..), CHANGEATTRS(..), -- * Primitives and basic combinators (<<), concatHtml, (+++), noHtml, isN...
DavidAlphaFox/ghc
libraries/xhtml/Text/XHtml/Frameset.hs
Haskell
bsd-3-clause
1,920
-- | -- Module : $Header$ -- Copyright : (c) 2013-2015 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE PatternGuards #-} module Cryptol.TypeCheck ( tcModule , tcExpr , tcDecls , InferInput(..) , InferOutpu...
iblumenfeld/cryptol
src/Cryptol/TypeCheck.hs
Haskell
bsd-3-clause
3,563
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE DataKinds, PolyKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module T14369...
sdiehl/ghc
testsuite/tests/indexed-types/should_fail/T14369.hs
Haskell
bsd-3-clause
808
-- (c) The University of Glasgow 2012 {-# LANGUAGE CPP, DataKinds, DeriveDataTypeable, GADTs, KindSignatures, ScopedTypeVariables, StandaloneDeriving #-} -- | Module for coercion axioms, used to represent type family instances -- and newtypes module CoAxiom ( BranchFlag, Branched, Unbranched, Bra...
anton-dessiatov/ghc
compiler/types/CoAxiom.hs
Haskell
bsd-3-clause
20,190
module Abs () where absN :: (Num a, Ord a) => a -> a absN x = if x > 0 then x else (-x) absI :: Int -> Int absI x = if x > 0 then x else (-x) --incI :: Int -> Int --incI = (+) 1 x0 = absN 4 x1 = absI (-5) --x2 = absI (incI 2) -- x3 = absI (-3)
mightymoose/liquidhaskell
tests/pos/Abs.hs
Haskell
bsd-3-clause
254
module Blank where {-@ LIQUID "--no-termination" @-} data Vec a = V (Int -> a) {-@ data Vec a < dom :: Int -> Prop, rng :: Int -> a -> Prop > = V {a :: i:Int<dom> -> a <rng i>} @-} {-@ empty :: forall <p :: Int -> a -> Prop>. Vec <{v:Int|0=1}, p> a @-} empty = V $ \_...
mightymoose/liquidhaskell
tests/pos/vecloop.hs
Haskell
bsd-3-clause
1,844
-- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you may n...
guker/fbthrift
thrift/lib/hs/Thrift/Types.hs
Haskell
apache-2.0
4,679
module Cmm.X86.InstrCore where import Cmm.LabelGenerator import Data.Int import Text.Printf -- | bypassing non exisiting module system of haskell data X86CodeGen = X86CodeGen data SizeDirective = BYTE | WORD | DWORD | QWORD -- 64 bit won't be supported for the time being deriving (Eq, Ord) inst...
cirquit/hjc
src/Cmm/X86/InstrCore.hs
Haskell
mit
5,446
-- Part 1 module Session4.Recursion (test) where import Prelude ((+), (*), Bool(..), Double, IO, Int, return) -- | empty a.k.a. null -- Examples: -- >>> empty [] -- True -- >>> empty [1, 2, 3, 4] -- False empty :: [a] -> Bool empty [] = True empty _ = False -- | map -- Examples: -- >>> map (+100) [] -- [] -- >>> ma...
seahug/pcph-scratch
src/Session4/Recursion.hs
Haskell
mit
1,346
module Latte.FrontEnd.Spec (main, spec) where import Test.Hspec import qualified Latte.FrontEnd.MainFunctionPresenceSpec import qualified Latte.FrontEnd.FunctionNameDuplicationSpec import qualified Latte.FrontEnd.TypeCheckSpec import qualified Latte.FrontEnd.VariableDeclaredSpec main :: IO () main = hspec spec spec...
mpsk2/LatteCompiler
testsuite/tests/Latte/FrontEnd/Spec.hs
Haskell
mit
657
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE GeneralizedNewtyp...
pseudonom/persistent
persistent/Database/Persist/Sql/Types.hs
Haskell
mit
4,437
module Glucose.Codegen.JavaScript (codegen) where import Control.Comonad import Control.Lens import Control.Monad.RWS import Data.Foldable (toList) import Data.Set as Set (Set, fromList, empty, insert, delete, member) import Data.Text (Text, pack, unpack) import Glucose.Identifier import Glucose.IR data JS...
sardonicpresence/glucose
src/Glucose/Codegen/Javascript.hs
Haskell
mit
2,323
-- (Ready for) Prime Time -- http://www.codewars.com/kata/521ef596c106a935c0000519/ module PrimeTime where prime :: Int -> [Int] prime n = takeWhile (<= n) . sieve $ [2..] where sieve (n:ns) = n : sieve [n' | n' <- ns, n' `mod` n /= 0]
gafiatulin/codewars
src/5 kyu/PrimeTime.hs
Haskell
mit
242
import Data.Aeson import Test.Tasty import Test.Tasty.QuickCheck as QC import Pulmurice.Common.Message main :: IO () main = defaultMain qcProps requestMessageProp :: ReqMsg -> Property requestMessageProp msg = Just msg === decode (encode msg) responseMessageProp :: ResMsg -> Property responseMessageProp msg = Just ...
futurice/pulmurice-common
tests/Tests.hs
Haskell
mit
558
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.EventSource (js_newEventSource, newEventSource, js_close, close, pattern CONNECTING, pattern OPEN, pattern CLOSED, js_getUrl, getUrl, js_getWithCredentials, getWithCredentials, js_ge...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/EventSource.hs
Haskell
mit
3,934
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} import qualified Data.ByteString.Lazy as L import Data.ByteString.Builder import Database.Redis import Control.Monad.IO.Class (liftIO) import System.IO import Data.Monoid((<>)) import Data.Foldable import Data.List import qualified Text.ProtocolB...
hnfmr/test-hedis
src/Pub.hs
Haskell
mit
1,503
-- Copyright (c) 2016-present, SoundCloud Ltd. -- All rights reserved. -- -- This source code is distributed under the terms of a MIT license, -- found in the LICENSE file. {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} module Kubern...
soundcloud/haskell-kubernetes
lib/Kubernetes/Model/V1/GCEPersistentDiskVolumeSource.hs
Haskell
mit
2,193
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module Tests.Sodium.Stream.Common where import Tests.Sodium.Common () import Crypto.Sodium.SecureMem import Crypto.Sodium.Stream.Internal import Data.Bits import qualified Data.ByteString ...
dnaq/crypto-sodium
test/Tests/Sodium/Stream/Common.hs
Haskell
mit
1,783
-- | -- Module : Data.Edison.Seq.BankersQueue -- Copyright : Copyright (c) 1998-1999, 2008 Chris Okasaki -- License : MIT; see COPYRIGHT file for terms and conditions -- -- Maintainer : robdockins AT fastmail DOT fm -- Stability : stable -- Portability : GHC, Hugs (MPTC and FD) -- -- T...
robdockins/edison
edison-core/src/Data/Edison/Seq/BankersQueue.hs
Haskell
mit
15,242
module HJS.Parser.ParserMonad where import Control.Monad.Identity import Control.Monad.Error import Control.Monad.State import HJS.Parser.Lexer data ParseResult a = Ok a | Failed String deriving Show data LexerMode = Normal | InComment | InRegex deriving Show data LexerState = LS { rest::String,lineno...
nbrunt/JSHOP
res/hjs-0.1/src/HJS/Parser/ParserMonad.hs
Haskell
mit
1,053
import Data.List import Data.Ord data Graph a = Graph [a] [(a, a)] deriving (Show, Eq) data Adjacency a = Adj [(a, [a])] deriving (Show, Eq) data Friendly a = Edge [(a, a)] deriving (Show, Eq) -- Problem 80 -- Conversions -- graphToAdj, adjToGraph, graphToFri, friToGraph, adjToFri, friToAdj graphToAdj :: Eq a => Gr...
CrazyMerlyn/99problems-haskell
80-89.hs
Haskell
mit
7,593
ans [a,b] = a + b main = do l <- getLine let i = map read $ words l :: [Integer] o = ans i print o
a143753/AOJ
NTL_2_A.hs
Haskell
apache-2.0
119
module Arrays where import Data.Array.IArray type ArrayLength = Int createNewEmptyArray :: ArrayLength -> Array Int a createNewEmptyArray = undefined fromList :: [a] -> Array Int a fromList xs = listArray (0, l - 1) xs where l = length xs buildPair :: (Int, Int) buildPair = let arr = listArray (1,10) (repeat...
songpp/my-haskell-playground
src/Arrays.hs
Haskell
apache-2.0
417
module External.A137735 (a137735) where a137735 :: Int -> Integer a137735 n = a137735_list !! n a137735_list :: [Integer] a137735_list = 1 : remaining 1 1 where remaining n maxTerm = nextTerm : remaining (n + 1) (max nextTerm maxTerm) where nextTerm = floor $ toRational n / toRational maxTerm
peterokagey/haskellOEIS
src/External/A137735.hs
Haskell
apache-2.0
302
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE RecordWildCards #-} -- | The module provides functionality for manipulating PoliMorf, the -- morphological dictionary for Polish. module Data.PoliMorf ( -- * Types Form , Base , POS , MSD , Tag , Cat , Entr...
kawu/polimorf
src/Data/PoliMorf.hs
Haskell
bsd-2-clause
2,320
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} -- | -- -- Generic OAuth2 plugin for Yesod -- -- * See Yesod.Auth.OAuth2.GitHub for example usage. -- module Yesod.Auth.OAuth2 ( authOAuth2 , authOAuth2Widge...
jasonzoladz/yesod-auth-oauth2
Yesod/Auth/OAuth2.hs
Haskell
bsd-2-clause
4,800
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Rank2Types #-} ------------------------------------------------------------------------------ -- | Pre-packaged Handlers that deal with form submissions and stand...
23Skidoo/snap
src/Snap/Snaplet/Auth/Handlers.hs
Haskell
bsd-3-clause
20,449
import Data.Accessor import Graphics.Rendering.Chart.Plot.Image import Graphics.Rendering.Chart import Graphics.Rendering.Chart.Gtk import Data.Array.Repa ((:.)(..)) import qualified Data.Array.Repa as A size = 100 image :: A.Array A.U A.DIM2 (Double,Double,Double) image = A.computeS $ A.fromFunction...
bgamari/chart-image
Test.hs
Haskell
bsd-3-clause
898
import System.Hardware.Sump as Sump import I2c import Data.Machine parseLevel '0' = Low parseLevel '1' = High signals = let sda = map parseLevel "1110001110001111" scl = map parseLevel "1111100100111111" in zipWith I2cSignals scl sda main = mapM_ print $ Data.Machine.run $ supply signals (auto decod...
bgamari/sump
TestI2c.hs
Haskell
bsd-3-clause
323
{-# LANGUAGE GADTs #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ViewPatterns #-} -- | -- Module : Data.Array.Accelerate.Trafo.Algebra -- Copyright : [2012] Manuel M T Chakr...
robeverest/accelerate
Data/Array/Accelerate/Trafo/Algebra.hs
Haskell
bsd-3-clause
20,751
module Lib.Task2 where import qualified Data.List as List task2 = sum $ filter isEven $ takeWhile (<4000000) fibs where fibs = List.unfoldr (\(a,b) -> Just (a,(b,a+b))) (0,1) isEven x = x `mod` 2 ==0
Austrotaxus/EulerProj
src/Lib/Task2.hs
Haskell
bsd-3-clause
221
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} module Y.String ( YiString , Position , Size(..) , fromString, toString , toReverseString , fromLazyText, toLazyText , empty , singleton, null, length , append, concat , reverse , take, drop , takeScreenful...
ethercrow/y
src/Y/String.hs
Haskell
bsd-3-clause
12,497
{-# LANGUAGE TemplateHaskell #-} module WithArity (main) where import Criterion.Main import Criterion.Types import Data.Monoid import Data.Syntactic hiding (E) import Data.Syntactic.Functional main :: IO () main = defaultMainWith (defaultConfig {csvFile = Just "bench-results/withArity.csv"}) [ bgroup "eval ...
emwap/syntactic
benchmarks/WithArity.hs
Haskell
bsd-3-clause
4,415
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures ...
mstksg/wavelets
src/Numeric/Wavelet/Continuous.hs
Haskell
bsd-3-clause
8,823
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module VForth.GameTextSpec ( TestableTitle(..) , TestableDescription(..) , unsafeRight , spec ) where import Test.Hspec import Test.QuickCheck.Gen import Test.QuickCheck import Data.Monoid ((<>)) import Data.Text.Arbitrary () import Data.Tex...
budgefeeney/ventureforth
chap6/test/VForth/GameTextSpec.hs
Haskell
bsd-3-clause
1,846
{-# LANGUAGE GADTs, NoImplicitPrelude, UnicodeSyntax #-} module Data.Nested.Tree ( -- * Tree type Tree (..) -- * Query , fruit, forest , null, size , lookup, member -- * Construction , empty , singleton , fromFoldable , fromList ...
sheganinans/applicative-nestedmap
src/Data/Nested/Tree.hs
Haskell
bsd-3-clause
2,283
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ConstrainedClassMethods #-} {-# LANGUAGE OverloadedStrings #-} -- We can do b...
sleexyz/haskell-fun
MLModulesWithFunctors2.hs
Haskell
bsd-3-clause
1,635
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ViewPatterns #-} module Foreign.HPX.Types where import Bindings.HPX import Control.Applicative (Alternative) import Control.Monad (...
iu-parfunc/haskell-hpx
src/Foreign/HPX/Types.hs
Haskell
bsd-3-clause
6,488
-- | Let's experiment with HUnit some more -- basicaly : <https://wiki.haskell.org/HUnit_1.0_User's_Guide> module TestStuff where import Test.HUnit import Stuff
emaphis/Haskell-Practice
testing-project/test/TestStuff.hs
Haskell
bsd-3-clause
166
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} module Main (main) where import Control.Lens import Halytics.Metric import Halytics.Monitor import Test.Tasty import Test.Tasty.HUnit (testCase, (@=?)) main :: IO () main = defaultMain tests tests :: Test...
nmattia/halytics
test/Test/Spec.hs
Haskell
bsd-3-clause
1,502
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE...
et4te/zero
src/Zero/KeyFetchToken/Client.hs
Haskell
bsd-3-clause
2,139
{-# LANGUAGE UndecidableInstances, FunctionalDependencies #-} module Feldspar.Multicore.Channel.Frontend where import Control.Monad.Operational.Higher import Control.Monad.Trans import Data.Ix import Data.Proxy import Data.Typeable import Feldspar hiding ((==)) import Feldspar.Data.Storable import Feldspar.Data.Vecto...
kmate/raw-feldspar-mcs
src/Feldspar/Multicore/Channel/Frontend.hs
Haskell
bsd-3-clause
6,955
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE ImpredicativeTypes #-} module Hack.Handler.Hyena (run, runWithConfig, ServerConf(..)) where import qualified Hack as Hack import Hyena.Server import Network.Wai as Wai import Prelude hiding ((.), (^)) import System.IO import Control.Monad import Data.Default import Data.May...
np/hack-handler-hyena
src/Hack/Handler/Hyena.hs
Haskell
bsd-3-clause
5,627
{-# LANGUAGE BangPatterns #-} module LRUCache where import Control.Applicative ((<$>)) import Data.Hashable (Hashable, hash) import qualified Data.HashPSQ as HashPSQ import Data.IORef (IORef, newIORef, atomicModifyIORef') import Data.Int (Int64) i...
Garygunn94/DFS
.stack-work/intero/intero2956XM1.hs
Haskell
bsd-3-clause
1,997
{-# LANGUAGE OverloadedStrings #-} module Main ( main ) where import Control.Error.Util (hush) import Control.Monad (void, when) import Control.Monad.State (StateT, liftIO, get, runStateT, modify) import Data.Aeson (decode) import qualified Data.Char as Char import qualified Data.Configurator as Conf import Data.Maybe...
bus000/Dikunt
plugins/WordReplacer/Main.hs
Haskell
bsd-3-clause
10,292
{-# LANGUAGE NamedFieldPuns #-} {- | Module : Mongo.Pid.Removal Description : Get Pid from Name Copyright : (c) Plow Technology 2014 License : MIT Maintainer : brent.phillips@plowtech.net Stability : unstable Portability : portable <Uses a name to grab the pid to remove old pid alarms from mongo>...
plow-technologies/mongo-pid-removal
src/Mongo/Pid/Removal.hs
Haskell
bsd-3-clause
3,380
{-# LANGUAGE FlexibleContexts, DeriveDataTypeable #-} {-- | Parser for the lambda AST built of parsec. Converts to an intermediate format for antiexpressions -} module Language.Lambda.Untyped.Parser where import Text.Parsec import Text.Parsec.Language import Text.Parsec.Token import Language.Lambda.Untyped.Syntax impo...
jfischoff/LambdaPrettyQuote
src/Language/Lambda/Untyped/Parser.hs
Haskell
bsd-3-clause
3,423
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} -- | UPDATE operations on the wallet-spec state module Cardano.Wallet.Kernel.DB.Spec.Update ( -- * Errors NewPendingFailed(..) , NewForeignFailed(..) , ApplyBlockFailed(..) -- * Updates , newPending , newForei...
input-output-hk/pos-haskell-prototype
wallet/src/Cardano/Wallet/Kernel/DB/Spec/Update.hs
Haskell
mit
16,318
{-| PyValue contains instances for the 'PyValue' typeclass. The typeclass 'PyValue' converts Haskell values to Python values. This module contains instances of this typeclass for several generic types. These instances are used in the Haskell to Python generation of opcodes and constants, for example. -} {- Copyrig...
ganeti/ganeti
src/Ganeti/PyValue.hs
Haskell
bsd-2-clause
4,431
{-# LANGUAGE PatternGuards, ViewPatterns #-} module Idris.Elab.Record(elabRecord) where import Idris.AbsSyntax import Idris.Docstrings import Idris.Error import Idris.Delaborate import Idris.Imports import Idris.Elab.Term import Idris.Coverage import Idris.DataOpts import Idris.Providers import Idris.Primitives import...
aaronc/Idris-dev
src/Idris/Elab/Record.hs
Haskell
bsd-3-clause
20,611
----------------------------------------------------------------------------- -- | -- License : BSD-3-Clause -- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi> -- -- The Github Repo Contents API, as documented at -- <https://developer.github.com/v3/repos/contents/> module GitHub.Endpoints.Repos.Contents ( --...
jwiegley/github
src/GitHub/Endpoints/Repos/Contents.hs
Haskell
bsd-3-clause
2,607
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE StandaloneDeriving #-} -------------------------------...
advancedtelematic/quickcheck-state-machine-model
test/DieHard.hs
Haskell
bsd-3-clause
6,644
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-} -- | The tar index cache provides generic support for caching a tarball's -- TarIndex; this is used by various other modules. module Distribution.Server.Features.TarIndexCache ( TarIndexCacheFeature(..) , initTarIndexCacheFeature ) where import Control.Exception...
haskell-infra/hackage-server
Distribution/Server/Features/TarIndexCache.hs
Haskell
bsd-3-clause
5,380
module HpcLexer where import Data.Char data Token = ID String | SYM Char | INT Int | STR String | CAT String deriving (Eq,Show) initLexer :: String -> [Token] initLexer str = [ t | (_,_,t) <- lexer str 1 1 ] lexer :: String -> Int -> Int -> [(Int,Int,Token)] lexer (c:cs) line column |...
nomeata/ghc
utils/hpc/HpcLexer.hs
Haskell
bsd-3-clause
1,929
module Canonicalize.Port (check) where import qualified Data.Foldable as Foldable import qualified AST.Declaration as D import qualified AST.Expression.General as E import qualified AST.Expression.Canonical as Canonical import qualified AST.Type as T import qualified AST.Variable as Var import qualified Reporting.Ann...
laszlopandy/elm-compiler
src/Canonicalize/Port.hs
Haskell
bsd-3-clause
3,449
{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} module Language.Haskell.Refact.Refactoring.MoveDef ( liftToTopLevel , compLiftToTopLevel , liftOneLevel , compLiftOneLevel , demote , compDemo...
RefactoringTools/HaRe
src/Language/Haskell/Refact/Refactoring/MoveDef.hs
Haskell
bsd-3-clause
76,745
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE TemplateHaskell #-} module Snap.Snaplet.Internal.Tests ( tests, initTest ) where ------------------------------------------------------------------------------ import Control.Len...
sopvop/snap
test/suite/Snap/Snaplet/Internal/Tests.hs
Haskell
bsd-3-clause
4,669
module MapFusion where import Prelude hiding (map) {-# RULES "map-fusion" forall f g. map f . map g = map (f . g) #-} map :: (a -> b) -> [a] -> [b] map f [] = [] map f (a:as) = f a : map f as
conal/hermit
examples/map-fusion/MapFusion.hs
Haskell
bsd-2-clause
201
{-# LANGUAGE DeriveGeneric #-} module GHC.ForeignSrcLang.Type ( ForeignSrcLang(..) ) where import Prelude -- See note [Why do we import Prelude here?] import GHC.Generics (Generic) -- | Foreign formats supported by GHC via TH data ForeignSrcLang = LangC -- ^ C | LangCxx -- ^ C++ | LangObjc -- ^ Ob...
sdiehl/ghc
libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs
Haskell
bsd-3-clause
470
module B1 where import A1 f :: C1 -> [Int] f (C1 x@[]) = x f (C1 x@(b_1 : b_2)) = x f (C1 x) = x
kmate/HaRe
old/testing/subIntroPattern/B1_TokOut.hs
Haskell
bsd-3-clause
98
module ScopeNamesBase where import ScopeNames import ScopeNamesBaseStruct import DefinedNamesBase() import FreeNamesBase() import Syntax instance Eq i => ScopeNames i e (HsExpI i) (HsExpI (i,e)) where scopeNames = scopeNamesRec instance Eq i => ScopeNames i e (HsDeclI i) (HsDeclI (i,e)) where scopeNames = scope...
forste/haReFork
tools/base/defs/ScopeNamesBase.hs
Haskell
bsd-3-clause
507
module Pfe2Cmds where --import Prelude hiding (putStr,putStrLn) --import WorkModule(analyzeSCM,expRel,inscpRel,mkWM) import Relations(applyRel) import SourceNames(SN(..)) import SrcLoc1(loc0) import Pfe1Cmds(pfe1Cmds) import PfeParse(moduleArg,idArgs,runCmds) import PFE2(runPFE2,getModuleExports,getAllExports) import...
forste/haReFork
tools/pfe/Pfe2Cmds.hs
Haskell
bsd-3-clause
1,444
{-# LANGUAGE Unsafe #-} {-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-} module GHC.Event.Internal ( -- * Event back end Backend , backend , delete , poll , modifyFd , modifyFdOnce -- * Event type , Event , evtRead , evtWrite , evtClose , eventIs ...
snoyberg/ghc
libraries/base/GHC/Event/Internal.hs
Haskell
bsd-3-clause
6,369
module Main where import X main :: IO () main = print $ case f x of A -> True; B -> False
ghc-android/ghc
testsuite/tests/driver/recomp010/Main.hs
Haskell
bsd-3-clause
93
module Main where import Game main = putStrLn "This game is not yet implemented, so you win by default!"
PolyglotSymposium/textual-game-hs
Main.hs
Haskell
mit
107
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} import qualified Data.ByteString as BS import Control.Applicative ((<$>)) import Data.Proxy import Manifest.Manifest import Manifest.PureManifest import Manifest.PostgreSQL data User = User BS.ByteString deriving...
avieth/Manifest-PostgreSQL
examples/User.hs
Haskell
mit
2,579
{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings, FlexibleInstances #-} {-# OPTIONS_HADDOCK prune, not-home #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Provides framework to interact with REST api gateways. Implementations specific to the -- Discord API are provided ...
jano017/Discord.hs
src/Network/Discord/Rest.hs
Haskell
mit
2,346
{-| Parse a list of flags supported in any of the front ends. Returns the flags in a data structure, along with any invalid flags. Deal with any files/include files in this stage. -} module CmdLine.Flag( CmdFlag(..), flagsHelp, flagsWebArgs, flagsWebQuery, flagsCmdLine ) where import Gen...
Pnom/haskell-ast-pretty
Test/examples/RealHoogle.hs
Haskell
mit
9,798
import Graphics.UI.SDL import Graphics.Rendering.OpenGL import Data.List import Data.Maybe import Data.Word import Control.Monad import Control.Monad.State import Formulae type ARTFVect = (GLfloat, GLfloat, GLfloat) data Camera = Camera { pos :: ARTFVect } data ARTFFlags = Alive | Dead deriving (Eq) data ARTF =...
esjee/hlsystem-artf
Main.hs
Haskell
mit
3,626
module Core.LambdaLift.DeBruijn ( deBruijn ) where import Common import Core.AST import Core.AnnotAST import Core.FreeVars import Core.Prelude import qualified Data.Map as M import qualified Data.Set as S deBruijn :: Program Name -> AnnotProgram Int (Annot Int Name) deBruijn = ProgramF . map deBruijnSC . getProgramF...
meimisaki/Rin
src/Core/LambdaLift/DeBruijn.hs
Haskell
mit
2,400