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 name: WebSockets Made by: Tomas Möre 2015 Usage: This is a WebSockets module inteded to run over an instance of the standard Server IMPORTANT: If you start a websockets session DO NOT attempt to send any kind of ...
black0range/Smutt
src/Smutt/WebSocket/Server/WebSocket.hs
Haskell
mit
25,956
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module PrintC where -- pretty-printer generated by the BNF converter import AbsC import Data.Char -- the top-level printing method printTree :: Print a => a -> String printTree = render . prt 0 type Doc = [ShowS] -> [ShowS] doc :: ShowS -> Doc doc = (:) render ::...
aufheben/Y86
Compiler/lab/C/PrintC.hs
Haskell
mit
23,864
module Mortgage.Money ( Money ) where import Test.QuickCheck import Text.Printf import Data.Ratio data Money = Money {-# UNPACK #-} !Double instance Show Money where show (Money amt) = printf "%.2f" amt -- round to 0.01 instance Eq Money where (Money x) == (Money y) = round (100*x) == round (100*y) insta...
wangbj/MortageCalc
src/Mortgage/Money.hs
Haskell
mit
1,247
{-**************************************************************************** * Hamster Balls * * Purpose: Common data types shared by other modules * * Author: David, Harley, Alex, Matt * * ...
harley/hamball
src/Common.hs
Haskell
mit
7,661
f x = if x > 2 then do print "x" else do print "y"
itchyny/vim-haskell-indent
test/if/ifthendo.in.hs
Haskell
mit
51
module Test where import TambaraYamagami as TY import Stringnet as S import Data.Tree as T import Data.Matrix as M import Data.Maybe import Finite import Algebra obj = (toObject M) `TY.tensorO` (toObject M) `TY.tensorO` (toObject M) m = toObject M o = toObject one notOne = toObject $ AE $ AElement 1 -- a snake equ...
PaulGustafson/stringnet
Test.hs
Haskell
mit
1,938
-- |Module for representing and manipulating complex numbers. module Cplx where -- |Basic data type for storing complex numbers. data Cplx = Cplx {re :: Double, im :: Double } deriving (Eq) -- re Cplx a b = a -- im Cplx a b = b -- |Function 'conj' returns a complex conjugate of a complex number. conj :: Cplx -> Cplx ...
jmiszczak/hoqus
alternative/Cplx.hs
Haskell
mit
1,306
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : Object.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:34 Warning : this file is machine generated - do not mo...
uduki/hsQt
Qtc/Classes/Object.hs
Haskell
bsd-2-clause
2,870
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Mars.Command.Ls (Ls (..), LsResult (..), ansiColor) where import Data.Aeson import qualified Data.HashMap.Strict as Map import Data.Ix import Data.Maybe import Data.String imp...
lorcanmcdonald/mars
src/Mars/Command/Ls.hs
Haskell
bsd-3-clause
3,676
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module River.X64.Color ( colorByRegister , RegisterError(..) ) where import Control.Monad.Trans.State.Strict (StateT, runStateT, get, put) import Data.Functio...
jystic/river
src/River/X64/Color.hs
Haskell
bsd-3-clause
6,266
{-| Module : Idris.Output Description : Utilities to display Idris' internals and other informtation to the user. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Output where import Idris.Core.TT import Idris.Core.Evaluate (isDCo...
enolan/Idris-dev
src/Idris/Output.hs
Haskell
bsd-3-clause
15,694
{-# OPTIONS_GHC -Wall #-} module Cis194.Hw.LogAnalysis where -- in ghci, you may need to specify an additional include path: -- Prelude> :set -isrc import Cis194.Hw.Log -- $setup -- >>> let foo = LogMessage Warning 10 "foo" -- >>> let baz = LogMessage Warning 5 "baz" -- >>> let bif = LogMessage Warning 15 "bif" -- >>...
halarnold2000/cis194
src/Cis194/Hw/LogAnalysis.hs
Haskell
bsd-3-clause
4,449
module Problem13 ( numbers100 , sum100numbers , columnarAddition ) where import Data.List as L import Lib (digits, number) numbers100 :: [Integer] numbers100 = [ 37107287533902102798797998220837590246510135740250 , 46376937677490009712648124896970078050417018260538 , 7432498619952...
candidtim/euler
src/Problem13.hs
Haskell
bsd-3-clause
7,418
{-# LANGUAGE RebindableSyntax #-} -- Copyright : (C) 2009 Corey O'Connor -- License : BSD-style (see the file LICENSE) {-# LANGUAGE MagicHash #-} module Bind.Marshal.Verify.Dynamic where import Bind.Marshal.Prelude import Bind.Marshal.Action.Base import Bind.Marshal.Action.Dynamic import Bind.Marshal.Action....
coreyoconnor/bind-marshal
src/Bind/Marshal/Verify/Dynamic.hs
Haskell
bsd-3-clause
2,661
-- | Simulates the @isUnicodeIdentifierPart@ Java method. <http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html#isUnicodeIdentifierPart%28int%29> module Language.Java.Character.IsUnicodeIdentifierPart ( IsUnicodeIdentifierPart(..) ) where import Data.Char import Data.Word import Data.Set.Diet(Diet) impo...
tonymorris/java-character
src/Language/Java/Character/IsUnicodeIdentifierPart.hs
Haskell
bsd-3-clause
12,247
{-# LANGUAGE TemplateHaskell #-} module NintetyNine.Problem16 where import Test.Hspec import Test.QuickCheck import Test.QuickCheck.All import Data.List -- dropEvery "abcdefghik" 3 "abdeghk" dropEvery :: [a] -> Int -> [a] dropEvery xs n | length xs < n = xs | otherwise = take (n - 1) xs ++ dropEvery (dr...
chemouna/99Haskell
src/Problem16.hs
Haskell
bsd-3-clause
1,547
#!/usr/bin/runhaskell module Main where import Distribution.Simple main :: IO () main = defaultMain
colinhect/hsnoise
Setup.hs
Haskell
bsd-3-clause
104
------------------------------------------------------------ -- | -- Module : Data.NeuralNetwork.Backend.BLASHS -- Description : A backend for neural network on top of 'blas-hs' -- Copyright : (c) 2016 Jiasen Wu -- License : BSD-style (see the file LICENSE) -- Maintainer : Jiasen Wu <jiasenwu@hotmail.c...
pierric/neural-network
Backend-blashs/Data/NeuralNetwork/Backend/BLASHS.hs
Haskell
bsd-3-clause
5,167
-- -- Benchmark code: sample request using http-condiuit -- -- Copyright © 2012-2013 Operational Dynamics Consulting, 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 a B...
afcowie/pipes-http
tests/ConduitSample.hs
Haskell
bsd-3-clause
2,161
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings #-} module Tests.Test.HUnitPlus.Execution where import Control.Exception(Exception, throwIO) import Data.List import Data.HashMap.Strict(HashMap) import Data.Maybe import Data.Typeable import Distribution.TestSuite import Test.HUnitPlus.Base import Test.HUnitPlus.Exec...
emc2/HUnit-Plus
test/Tests/Test/HUnitPlus/Execution.hs
Haskell
bsd-3-clause
31,830
-- | -- Module : -- License : BSD-Style -- Maintainer : Nicolas DI PRIMA <nicolas@di-prina.fr> -- Stability : experimental -- Portability : unknown -- {-# LANGUAGE OverloadedStrings #-} module Main (main) where import Control.Monad (when) import Data.List (intercalate) import Network.SMTP import System....
NicolasDP/hs-smtp
cli/Main.hs
Haskell
bsd-3-clause
1,713
{-# LANGUAGE MultiParamTypeClasses #-} module Lambda.Convertor.Expr where import DeepControl.Applicative import DeepControl.Monad hiding (forM, mapM) import Lambda.DataType (Lambda) import Lambda.DataType.Expr import Lambda.Action import Lambda.Convertor.PatternMatch import Util.Pseudo import Prelude hiding (forM, ...
ocean0yohsuke/Simply-Typed-Lambda
src/Lambda/Convertor/Expr.hs
Haskell
bsd-3-clause
2,635
module Parser.ParseModule (parseModule) where import Parser.Parse import Parser.Syntax import Parser.ParseSpace import Parser.ParseDec import Parser.ParseIdent parseImportSome :: Parse Char ImportTermination parseImportSome = fmap ImportSome $ ksingleOrParenthesized parseLocalIdent parseImportAll :: Parse Char Impo...
Kiwi-Labs/kwirc
kwick/parser/ParseModule.hs
Haskell
mit
1,205
{-# LANGUAGE DeriveGeneric #-} module Course where import qualified Data.Text as T import Data.Aeson import GHC.Generics data Course = Course !T.Text deriving (Show, Generic) instance FromJSON Course
ksaveljev/udemy-downloader
Course.hs
Haskell
mit
204
-- | -- Module : Example.Time.Compat -- License : BSD-style -- Maintainer : Nicolas DI PRIMA <nicolas@di-prima.fr> -- -- This file is an example on how to use the Data.Hourglass.Compat -- module to transpose a ZonedTime (from time) into a LocalTime of DateTime -- (from hourglass). -- module Example.Time.Compa...
ppelleti/hs-hourglass
Example/Time/Compat.hs
Haskell
bsd-3-clause
935
{- ------------------------------------------------------------------------ (c) The GHC Team, 1992-2012 DeriveConstants is a program that extracts information from the C declarations in the header files (primarily struct field offsets) and generates various files, such as a header file that can be #included into non...
lukexi/ghc-7.8-arm64
utils/deriveConstants/DeriveConstants.hs
Haskell
bsd-3-clause
40,857
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Main -- Copyright : (c) David Himmelstrup 2005 -- License : BSD-like -- -- Maintainer : lemmih@gmail.com -- Stability : provisional -- Portability : portable -- -- Entry point to the ...
mmakowski/cabal
cabal-install/Main.hs
Haskell
bsd-3-clause
55,596
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.Spacing -- Copyright : (c) Brent Yorgey -- License : BSD-style (see LICENSE) -- -- Maintainer : <byorgey@gmail.com> -- Stability : un...
markus1189/xmonad-contrib-710
XMonad/Layout/Spacing.hs
Haskell
bsd-3-clause
2,275
module C1 (Tree, leaf1, branch1, branch2, isLeaf, isBranch, mkLeaf, mkBranch, myFringe, SameOrNot(..)) where data Tree a = Leaf {leaf1 :: a} | Branch {branch1 :: Tree a, branch2 :: Tree a} mkLeaf :: a -> Tree a mkLeaf = Leaf mkBranch :: (Tree a) -> (Tree a) -> Tree a mkBranch ...
SAdams601/HaRe
old/testing/fromConcreteToAbstract/C1_AstOut.hs
Haskell
bsd-3-clause
958
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.GHC.IPI641 -- Copyright : (c) The University of Glasgow 2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- module Distribution.Simple.GHC.IPI64...
randen/cabal
Cabal/Distribution/Simple/GHC/IPI641.hs
Haskell
bsd-3-clause
4,324
module Foo1 where -- Variant: ill-kinded. class XClass a where xFun :: a -> XData data XData = XCon XClass
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail147.hs
Haskell
bsd-3-clause
119
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE DataKinds #-} pattern PATTERN = () wrongLift :: PATTERN wrongLift = undefined
hferreiro/replay
testsuite/tests/patsyn/should_fail/T9161-1.hs
Haskell
bsd-3-clause
126
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Database ( module Generated , js_changeVersion , changeVersion' , changeVersion , js_transaction , transaction' , transaction , js_readTransaction , readTransaction' , readTransaction ) where import Data.Maybe (fromJu...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Database.hs
Haskell
mit
3,935
module Main where import Control.Applicative import Control.Concurrent.Suspend import Control.Exception import Control.Monad import Data.Int (Int64) import Data.List (intersperse) import Options import Text.Printf import Sound.ALUT import System.Console.ANSI import System.Console.Readline import System.Exit (exitFailu...
AZaviruha/pomodoro-cli
src/Main.hs
Haskell
mit
5,818
import Data.List.Split import qualified Data.Map as Map data Direction = N | E | S | W deriving (Show, Ord, Eq) turnMap = Map.fromList $ [ ((dirs !! i, 'L'), dirs !! ((i - 1) `mod` 4)) | i <- [0 .. 3] ] ++ [ ((dirs !! i, 'R'), dirs !! ((i + 1) `mod` 4)) | i <- [0 .. 3] ] where dirs = [N, E, ...
lzlarryli/advent_of_code_2016
day1/part1.hs
Haskell
mit
875
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Persistence.DBConnection ( loadConnection ) where import Control.Applicative import Control.Monad import Data.Aeson import qualified Data.ByteString.Lazy.Char8 as BSL import Database.Post...
ostapneko/stld2
src/main/Persistence/DBConnection.hs
Haskell
mit
761
module Group where import Data.List import Data.Maybe import GroupUtils {- Types -} type BinOp a = (a -> a -> a) type MTable a = ([a], [[a]]) data Group a = Group { set :: [a], op :: (BinOp a) } data GAction a b = GAction (Group a) [b] (a -> b -> b) instance (Show a, Eq a) => Show (Group a) where show (Group ...
elfeck/grouphs
src/Group.hs
Haskell
mit
9,129
module ByteString.BuildersBenchmark.Inputs where import Prelude import qualified ByteString.BuildersBenchmark.Subjects as A import qualified ByteString.BuildersBenchmark.Actions as B sized :: Int -> [ByteString] sized factor = replicate factor "abcdefg"
nikita-volkov/bytestring-builders-benchmark
library/ByteString/BuildersBenchmark/Inputs.hs
Haskell
mit
259
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE QuasiQuotes, OverloadedStrings, RecordWildCards #-} module Language.Bond.Codegen.Cpp.Apply_h (apply_h) where import System.FilePath import Prelude import...
upsoft/bond
compiler/src/Language/Bond/Codegen/Cpp/Apply_h.hs
Haskell
mit
1,611
-- | -- Module : CmdLineParser -- Description : Parser for command line options. -- Copyright : (c) Maximilian Nitsch, 2015 -- -- License : MIT -- Maintainer : maximilian.nitsch@gausus.de -- Stability : experimental -- Portability : portable -- -- This module enables to parse command line option and put t...
Ma-Ni/haspell
lib/Spellchecker/CmdLineParser.hs
Haskell
mit
2,455
module Text.XmlTv ( Channel(..) , Program(..) , xmlToChannel , xmlToProgram , parseChannels , parsePrograms , filterChans , updateChannel , findChan , sortChans , previous , current , later ) where import Control.Monad import Data.Maybe import Text.XML.Light import D...
dagle/hs-xmltv
src/Text/XmlTv.hs
Haskell
mit
3,370
{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.Map.MultiKey import Data.Typeable import Prelude hiding (lookup, null) data Record = Record { rIntKey :: Int , rStringKey :: String , rData :: String } deriving (Show, Typeable) instance MultiKeyable Record where empty = MultiKey [key rInt...
jhickner/data-map-multikey
example.hs
Haskell
mit
514
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.PositionCallback (newPositionCallback, newPositionCallbackSync, newPositionCallbackAsync, PositionCallback) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), M...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/PositionCallback.hs
Haskell
mit
2,205
module Main where import Control.Lens import Control.Monad ( unless, when ) import Data.IORef import System.Exit ( exitFailure, exitSuccess ) import System.IO ( hPutStrLn, stderr ) import qualified Graphics.UI.GLFW as W import Graphics.Rendering.OpenGL import Graphics.Event import Graphics.RenderableItem import Grap...
nyorem/cghs
viewer/Main.hs
Haskell
mit
2,592
module List3 where -- 21 insertAt :: a -> [a] -> Int -> [a] insertAt _ _ 0 = error "0 is not a valid position" insertAt elem list pos = fst split ++ [elem] ++ snd split where split = splitAt (pos - 1) list range :: Int -> Int -> [Int] range from to = [from..to]
matteosister/haskell-exercises
List3.hs
Haskell
mit
272
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-trigger.html module Stratosphere.Resources.GlueTrigger where import Stratosphere.ResourceImports import S...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/GlueTrigger.hs
Haskell
mit
3,424
{- MainTestSuite.hs Copyright 2014 Sebastien Soudan 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 t...
ssoudan/hsStruct
test/MainTestSuite.hs
Haskell
apache-2.0
4,122
{-# LANGUAGE OverloadedStrings #-} module Salesforce.HTTP ( showRequest , showResponse ) where import Control.Monad (when, unless) import Control.Monad.Writer (MonadWriter(..), execWriter) import Data.ByteString.Lazy (ByteString) import Data.CaseInsensitive (original) import qualified Data.ByteString.Char8 as B...
VictorDenisov/salesforce
src/Salesforce/HTTP.hs
Haskell
apache-2.0
2,496
module Commands (commandMap) where import Control.Applicative import qualified Data.Map as Map import qualified Data.Set as Set import System.Exit import System.Directory import Types import CSVmail import Tools -- Map that list the commands key and the corresponding function. It is the -- public interface commandM...
montefra/email_compare
src/Commands.hs
Haskell
bsd-2-clause
5,924
-- http://www.codewars.com/kata/52f787eb172a8b4ae1000a34 module Zeros where zeros :: Int -> Int zeros 0 = 0 zeros n = sum . tail . takeWhile (>0) . iterate (`div`5) $ n
Bodigrim/katas
src/haskell/5-Number-of-trailing-zeros-of-N.hs
Haskell
bsd-2-clause
169
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} module Database.Narc.AST.Pretty where import Database.Narc.AST import Database.Narc.Pretty import Database.Narc.Util (mapstrcat) -- Pretty-printing ------------------------------------------------===== instance Pretty (Term' a) where pretty (Unit) = "()" ...
ezrakilty/narc
Database/Narc/AST/Pretty.hs
Haskell
bsd-2-clause
1,241
module Evaluator.Deeds where import Data.List import StaticFlags import Utilities import Data.Ord (comparing) -- | Number of unclaimed deeds. Invariant: always greater than or equal to 0 type Unclaimed = Int -- | A deed supply shared amongst all expressions type Deeds = Int -- NB: it is OK if the number of deeds ...
osa1/chsc
Evaluator/Deeds.hs
Haskell
bsd-3-clause
2,553
{-# LANGUAGE MultiParamTypeClasses #-} import Control.Monad.Chrono import Control.Monad.IO.Class newtype Pos = Pos (Int, Int, Int) deriving Show data DeltaPos = MoveX Int | MoveY Int | MoveZ Int instance Keystone Pos DeltaPos where redo (MoveX n) (Pos (x, y, z)) = Pos (x + n, y, z) redo (MoveY n) (Pos (x, y...
kvanberendonck/monad-chrono
examples/Example.hs
Haskell
bsd-3-clause
997
-- |Load and unload MSF plugins. module MSF.Plugin ( module Types.Plugin , plugin_load , plugin_unload , plugin_loaded ) where import MSF.Monad import Types.Plugin import qualified RPC.Plugin as RPC -- | Silent operation. plugin_load :: (SilentCxt s) => PluginName -> PluginOptions -> MSF s Result plugin_loa...
GaloisInc/msf-haskell
src/MSF/Plugin.hs
Haskell
bsd-3-clause
804
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude, OverloadedStrings, RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, TemplateHaskell #-} {-# LANGUAGE TypeFamilie...
jeremyjh/free-agent
core/src/FreeAgent/Core/Protocol/Schedule.hs
Haskell
bsd-3-clause
9,410
{-# LANGUAGE CPP, BangPatterns #-} {-# OPTIONS_GHC -Wall -fno-warn-name-shadowing #-} module Main ( main, test {-, maxDistances -} ) where import Prelude import System.Environment import Data.Array.Accelerate as A import Data.Array.Accelerate.Interpreter -- <<Graph type Weight = Int32 type Graph = Array DIM2 Weight ...
mono0926/ParallelConcurrentHaskell
fwaccel.hs
Haskell
bsd-3-clause
2,783
module Applicatives where import Control.Applicative import Data.List (elemIndex) import Data.Monoid import Test.QuickCheck import Test.QuickCheck.Checkers import Test.QuickCheck.Classes added :: Maybe Integer added = (+3) <$> lookup 3 (zip [1...
vasily-kirichenko/haskell-book
src/Applicatives.hs
Haskell
bsd-3-clause
9,021
{-| Module : OpenLayersFunc Description : OpenLayers JavaScript and Haskell functions (using FFI) -} module OpenLayers.Func where import Prelude hiding (void) import JQuery import Fay.Text hiding (head, tail, map) import OpenLayers.Html import OpenLayers.Interna...
olwrapper/olwrapper
wrapper/OpenLayers/Func.hs
Haskell
bsd-3-clause
12,894
module Math.LinearRecursive.Internal.Polynomial ( Polynomial , polynomial , unPoly , fromList , toList , singleton , x , degree , evalPoly ) where import qualified Data.IntMap as IntMap import Math.LinearRecursive.Internal.Vector newtype Polynomial a = Polynomial { unPoly :: Vector a } polynomi...
bjin/monad-lrs
Math/LinearRecursive/Internal/Polynomial.hs
Haskell
bsd-3-clause
1,648
import System.Directory import PocParser import PocStrategy import StrategyTest -- Test GENERATE -- main :: IO () main = do --mapM_ (uncurry generateTest) genTests --plusTest --generateAllTest chooseStrategyTest -- PARSER AND PROGRAMS STUFF -- --main :: IO () --main = do -- files <- getDirectoryContents "t...
NicolaiNebel/Bachelor-Poc
test/Spec.hs
Haskell
bsd-3-clause
624
module CallByReference.Data where import Control.Monad.Trans.State.Lazy import qualified Data.Map as M import Data.Maybe (fromMaybe) type Try = Either String type Environment = M.Map String DenotedValue empty :: Environment empty = M.empty initEnvironme...
li-zhirui/EoplLangs
src/CallByReference/Data.hs
Haskell
bsd-3-clause
4,242
{-# LANGUAGE ExtendedDefaultRules, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings, TypeFamilies, RankNTypes #-} module Web.ISO.HSX where import Data.Monoid ((<>)) import Data.Text (Text, pack, unpack) import GHCJS.Marshal.Pure (pFromJSVal) import GHCJS.Types (JSVal(..), JSString(..)) import Web.ISO.Types ...
stepcut/isomaniac
Web/ISO/HSX.hs
Haskell
bsd-3-clause
2,383
{-# LANGUAGE FlexibleInstances, TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} import Control.Applicative import Data.IP import Data.Text import Data.Time import Test.Hspec import Test.HUnit import Test.Hspec.QuickCheck import Test.QuickCheck import Cloud.AWS.Lib.FromText import Cloud.AWS.Lib.ToText prop_...
worksap-ate/aws-sdk-text-converter
test/Spec.hs
Haskell
bsd-3-clause
2,120
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : Generics.Regular.Functions -- Copyright : (c) 2010 Universiteit Utrecht -- ...
dreixel/regular
src/Generics/Regular/Functions.hs
Haskell
bsd-3-clause
1,626
module Jade.Jumper where import Jade.Common import qualified Jade.Decode.Coord as Coord getEnds :: Jumper -> ((Integer, Integer), (Integer, Integer)) getEnds (Jumper (Coord3 x y r)) = Coord.coord5ends (Coord5 x y r 8 0) points (Jumper (Coord3 x y r)) = [Point x y]
drhodes/jade2hdl
src/Jade/Jumper.hs
Haskell
bsd-3-clause
268
module DiceSpec ( main, spec ) where import System.Random import Test.Hspec import Test.QuickCheck import TestHelpers import Dice main :: IO () main = hspec spec spec :: Spec spec = do describe "d4" $ it "is within range" $ property $ \seed n -> let rol...
camelpunch/rhascal
test/DiceSpec.hs
Haskell
bsd-3-clause
562
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.Ordinal.DA.Tests ( tests ) where import Prelude import Data.String import Test.Tasty import D...
facebookincubator/duckling
tests/Duckling/Ordinal/DA/Tests.hs
Haskell
bsd-3-clause
504
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.NV.VertexProgram2Option -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Port...
haskell-opengl/OpenGLRaw
src/Graphics/GL/NV/VertexProgram2Option.hs
Haskell
bsd-3-clause
731
{-# LANGUAGE OverloadedStrings #-} module HaskellStorm.Internal ( BoltIn (..) , EmitCommand (..) , Handshake (..) , PidOut (..) , SpoutIn , StormConfig (..) , StormOut (..) ) where import Control.Applicative ((<$>), (<*>)) import Control.Monad (mzero) import Data.Aeson ((.:), (.:?), (....
aaronlevin/pipes-storm
src/HaskellStorm/Internal.hs
Haskell
bsd-3-clause
4,546
module Interpreter (Program, run, verify, programFromText, testProgram, failingProgram ) where import Color import Evaluator import Program import qualified Data.Map as Map import Data.Maybe import qualified System.IO as System import System.Console.ANSI import System.Console.Regions import Control.Concurrent....
paterson/interpreter
src/Interpreter.hs
Haskell
bsd-3-clause
9,090
{-# LANGUAGE CPP, Rank2Types, ConstraintKinds, PatternGuards, ViewPatterns #-} {-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables, TupleSections #-} {-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, TypeFamilies #-} {-# LANGUAGE OverloadedStrings #...
conal/hermit-extras
src/HERMIT/Extras.hs
Haskell
bsd-3-clause
50,562
{-# LANGUAGE OverloadedStrings #-} {- Created : 2015 Sep 05 (Sat) 11:05:00 by Harold Carr. Last Modified : 2015 Sep 13 (Sun) 16:52:43 by Harold Carr. -} module Client where import Control.Lens import Data.Aeson (toJSON) import Msg import Network.Wreq epAddr = "http://12...
ryoia/utah-haskell
2015-09-17-solution/Client.hs
Haskell
apache-2.0
1,238
{-# LANGUAGE CPP, NondecreasingIndentation, TupleSections #-} {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- -- -- GHC Driver program -- -- (c) The University of Glasgow 2005 -- ----------------------------------------...
AlexanderPankiv/ghc
ghc/Main.hs
Haskell
bsd-3-clause
36,717
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} -- | This module implements predicate pushdown on comprehensions. module Database.DSH.CL.Opt.PredPushdown ( predpushdownR ) where import Control.Arrow import qualified Data.List.NonEmpty as N import qualified Data.Set ...
ulricha/dsh
src/Database/DSH/CL/Opt/PredPushdown.hs
Haskell
bsd-3-clause
8,803
-- print information about the current package -- (reads the cached build info, so only works after 'cabal configure') import Prelude hiding (print) import Distribution.Simple import Distribution.Simple.LocalBuildInfo import Distribution.Text import System.Environment readLocalBuildInfo :: IO LocalBuildInfo readLoca...
Toxaris/pts
src-tools/package-info.hs
Haskell
bsd-3-clause
768
module Spotify.Error ( Error(..), spotifyError ) where import qualified Bindings.Spotify.Error as SP data Error = Ok | ClientTooOld | UnableToContactServer | BadUsernameOrPassword | UserBanned | UserNeedsPremium spotifyError :: SP.Error -> Error spotifyError...
mrehayden1/harmony
Spotify/Error.hs
Haskell
bsd-3-clause
639
-- | Immediate operand module Haskus.Arch.X86_64.ISA.Immediate ( X86ImmFamP , X86ImmFamT , X86ImmFam , X86Imm , Imm (..) , immFamFixedSize , immFamOpSize , immFamOpSizeSE , immFamConst ) where import Haskus.Arch.X86_64.ISA.Size import Haskus.Arch.X86_64.ISA.Solver import Haskus.Arch.Commo...
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Arch/X86_64/ISA/Immediate.hs
Haskell
bsd-3-clause
2,513
{-# OPTIONS -Wall -Werror #-} module Test.TestEaster where import Data.Time.Calendar.Easter import Data.Time.Calendar import Data.Time.Format import Test.TestUtil import Test.TestEasterRef -- days :: [Day] days = [ModifiedJulianDay 53000 .. ModifiedJulianDay 53014] showWithWDay :: Day -> String showWithWDay = for...
bergmark/time
test/Test/TestEaster.hs
Haskell
bsd-3-clause
1,068
{-# LANGUAGE BangPatterns, CPP, MagicHash #-} module Main ( main ) where import Data.Bits import GHC.Prim import GHC.Word #include "MachDeps.h" main = putStr (test_popCnt ++ "\n" ++ test_popCnt8 ++ "\n" ++ test_popCnt16 ++ "\n" ++ test_popCnt32 ++ "\n" ++ test_popCnt64 ++ "\n"...
sdiehl/ghc
testsuite/tests/codeGen/should_run/cgrun071.hs
Haskell
bsd-3-clause
2,285
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 ************************************************************************ * * \section[FloatIn]{Floating Inwards pass} * ...
ezyang/ghc
compiler/simplCore/FloatIn.hs
Haskell
bsd-3-clause
29,172
----------------------------------------------------------------------------- -- | -- Module : Control.Monad.RWS -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2001 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : libraries@h...
johanneshilden/principle
public/mtl-2.2.1/Control/Monad/RWS.hs
Haskell
bsd-3-clause
895
module Syntax where type Name = String data Expr = Var Name | Lit Ground | App Expr Expr | Lam Name Type Expr deriving (Eq, Show) data Ground = LInt Int | LBool Bool deriving (Show, Eq, Ord) data Type = TInt | TBool | TArr Type Type deriving (Eq, Read, Show)
yupferris/write-you-a-haskell
chapter5/stlc/Syntax.hs
Haskell
mit
287
<?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="si-LK"> <title>Passive Scan Rules | ZAP Extension</title> <maps> <homeID>top</homeID> <...
thc202/zap-extensions
addOns/pscanrules/src/main/javahelp/org/zaproxy/zap/extension/pscanrules/resources/help_si_LK/helpset_si_LK.hs
Haskell
apache-2.0
979
<?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="ro-RO"> <title>All In One Notes Add-On</title> <maps> <homeID>top</homeID> <mapref loca...
thc202/zap-extensions
addOns/allinonenotes/src/main/javahelp/org/zaproxy/zap/extension/allinonenotes/resources/help_ro_RO/helpset_ro_RO.hs
Haskell
apache-2.0
968
module HLearn.Optimization.StepSize ( -- * fancy step sizes -- ** Almeida Langlois lrAlmeidaLanglois -- * simple step sizes -- ** linear decrease , lrLinear , eta -- , gamma -- ** constant step size , lrConst -- , step ) where import HLearn.Optimization.StepS...
mikeizbicki/HLearn
src/HLearn/Optimization/StepSize.hs
Haskell
bsd-3-clause
427
module PatBindIn3 where --A definition can be lifted from a where or let to the top level binding group. --Lifting a definition widens the scope of the definition. --In this example, lift 'sq' defined in 'sumSquares' --This example aims to test changing a constant to a function. sumSquares x = (sq x pow) + (sq x ...
kmate/HaRe
old/testing/liftToToplevel/PatBindIn3_TokOut.hs
Haskell
bsd-3-clause
454
module HAD.Y2014.M04.D09.Exercise where -- $setup -- >>> import Data.List data Foo = Foo {x :: Int, y :: String, z :: String} deriving (Read, Show, Eq) {- | orderXYZ Order Foo by x then by y and then by z prop> sort xs == (map x . orderXYZ . map (\v -> Foo v "y" "z")) xs prop> sort xs == (map y . ord...
1HaskellADay/1HAD
exercises/HAD/Y2014/M04/D09/Exercise.hs
Haskell
mit
481
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Word -- Copyright : (c) The University of Glasgow, 1997-2002 -- License ...
frantisekfarka/ghc-dsi
libraries/base/GHC/Word.hs
Haskell
bsd-3-clause
31,190
-- | Some helpers for interrogating a WAI 'Request'. module Network.Wai.Request ( appearsSecure , guessApproot ) where import Data.ByteString (ByteString) import Data.Maybe (fromMaybe) import Network.HTTP.Types (HeaderName) import Network.Wai (Request, isSecure, requestHeaders, requestHeaderHost) import ...
dylex/wai
wai-extra/Network/Wai/Request.hs
Haskell
mit
2,017
{-| A data structure for measuring how many of a number of available slots are taken. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source...
grnet/snf-ganeti
src/Ganeti/SlotMap.hs
Haskell
bsd-2-clause
3,394
-- !!! Testing the Word Enum instances. {-# LANGUAGE CPP #-} module Main(main) where import Control.Exception import Data.Word import Data.Int main = do putStrLn "Testing Enum Word8:" testEnumWord8 putStrLn "Testing Enum Word16:" testEnumWord16 putStrLn "Testing Enum Word32:" testEnumWord32 putStrLn "Te...
green-haskell/ghc
libraries/base/tests/enum03.hs
Haskell
bsd-3-clause
8,784
{-# LANGUAGE DeriveTraversable #-} import Data.Monoid (Endo (..)) import Control.Exception (evaluate) data Tree a = Bin !(Tree a) a !(Tree a) | Tip deriving (Functor, Foldable) t1, t2, t3, t4, t5 :: Tree () t1 = Bin Tip () Tip t2 = Bin t1 () t1 t3 = Bin t2 () t2 t4 = Bin t3 () t3 t5 = Bin t4 () t4 t6 = Bin t5 () t...
ezyang/ghc
testsuite/tests/perf/should_run/T13218.hs
Haskell
bsd-3-clause
546
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.JHC -- Copyright : Isaac Jones 2003-2006 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module contains most of the JHC-specific code for...
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/JHC.hs
Haskell
bsd-3-clause
8,608
{-# LANGUAGE OverloadedStrings #-} import Github.Issues import Data.Either import Data.Maybe import Data.Time.Clock import Data.Time.Calendar (addDays) import Data.Aeson import Data.Monoid import Data.Configurator import qualified Data.Configurator.Types as DCTypes (Value) import Web.Scotty import Network.HTTP.T...
rkday/github-dashboard
github-dashboard.hs
Haskell
mit
7,983
{-| Module : Utils.Tuple Description : Utilities for working with tuples Copyright : (c) Tessa Belder 2015-2016 This module contains useful functions for working with tuples. -} module Utils.Tuple ( unzipConcat, mapFst, mapSnd, tmap, tmap2, swap, fst3, snd3, thrd3, ...
julienschmaltz/madl
src/Utils/Tuple.hs
Haskell
mit
1,805
----------------------------------------------------------------------------- -- | -- Module : Control.AFSM.CoreType -- Copyright : (c) Hanzhong Xu, Meng Meng 2016, -- License : MIT License -- -- Maintainer : hanzh.xu@gmail.com -- Stability : experimental -- Portability : portable ------------------...
PseudoPower/AFSM
src/Control/AFSM/CoreType.hs
Haskell
mit
2,652
{-# htermination max :: Int -> Int -> Int #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_max_5.hs
Haskell
mit
46
{-# LANGUAGE OverloadedStrings #-} module OptionsSpec(spec) where import Control.Lens import System.NotifySend import Test.Hspec import Test.QuickCheck import Data.Text spec :: Spec spec = do describe "Command line options to notify-send" $ do it "should encode correctl...
bobjflong/notify-send
test/OptionsSpec.hs
Haskell
mit
640
import Data.List (intersect) import GHC.Exts (sortWith) type Value = Int type Board = [Value] type Col = Int type Row = Int type Index = Int type Block = Int easy, hard, evil :: String easy = "530070000600195000098000060800060003400803001700020006060000280000419005000080079" hard = "0000030202000190000010080976000000...
derkyjadex/sudoku-solver
Main.hs
Haskell
mit
3,651
--The MIT License (MIT) -- --Copyright (c) 2017 Steffen Michels (mail@steffen-michels.de) -- --Permission is hereby granted, free of charge, to any person obtaining a copy of --this software and associated documentation files (the "Software"), to deal in --the Software without restriction, including without limitation ...
SteffenMichels/IHPMC
src/AstPreprocessor.hs
Haskell
mit
10,833