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 A5 where import D5 main = sumFun [1..4] + (sum ( map (f f_gen) [1..7]))
kmate/HaRe
old/testing/generaliseDef/A5_TokOut.hs
Haskell
bsd-3-clause
93
{-# OPTIONS_JHC -fno-prelude -fffi #-} module System.C.Stdio where import Jhc.Basics import Jhc.Type.C import Jhc.Type.Ptr type FILE = Ptr CFile foreign import ccall "stdio.h fopen" c_fopen :: Ptr CChar -> Ptr CChar -> IO FILE foreign import ccall "stdio.h popen" c_popen :: Ptr CChar -> P...
m-alvarez/jhc
lib/jhc/System/C/Stdio.hs
Haskell
mit
1,772
{-# LANGUAGE CPP, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Server.Packages.PackageIndex -- Copyright : (c) David Himmelstrup 2005, -- Bjorn Bringert 2007, -- ...
ocharles/hackage-server
Distribution/Server/Packages/PackageIndex.hs
Haskell
bsd-3-clause
12,567
module Aws.Sqs.Commands ( module Aws.Sqs.Commands.Message, module Aws.Sqs.Commands.Permission, module Aws.Sqs.Commands.Queue, module Aws.Sqs.Commands.QueueAttributes ) where import Aws.Sqs.Commands.Message import Aws.Sqs.Commands.Permission import Aws.Sqs.Commands.Queue import Aws.Sqs.Commands.QueueAttributes
RayRacine/aws
Aws/Sqs/Commands.hs
Haskell
bsd-3-clause
320
<?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="az-AZ"> <title>Getting started Guide</title> <maps> <homeID>top</homeID> <mapref locat...
ccgreen13/zap-extensions
src/org/zaproxy/zap/extension/gettingStarted/resources/help_az_AZ/helpset_az_AZ.hs
Haskell
apache-2.0
968
{-# OPTIONS_GHC -fglasgow-exts -O -ddump-simpl -fno-method-sharing #-} module Roman where import Control.Monad.ST newtype T s a = T { unT :: Int -> ST s a } instance Monad (T s) where return = T . const . return T p >>= f = T $ \i -> do { x <- p i ; unT (f x) i } myIndex :: T s Int...
ezyang/ghc
testsuite/tests/eyeball/inline1.hs
Haskell
bsd-3-clause
916
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} -- | This holds the certificate authority (without the private key) module Types.CA where import Control.Lens import Data.Data (Data, Typeable) import D...
tazjin/herbert
src/Types/CA.hs
Haskell
mit
733
module Spear.Math.Ray ( Ray(..) , raylr , rayfb ) where import Spear.Math.Utils import Spear.Math.Vector data Ray = Ray { origin :: {-# UNPACK #-} !Vector2 , dir :: {-# UNPACK #-} !Vector2 } -- | Classify the given point's position with respect to the given ray. Left/Righ...
jeannekamikaze/Spear
Spear/Math/Ray.hs
Haskell
mit
650
module Numeric.LinearCombination ( LinearCombination(..) , Term(..) , multiplyUsing , operationUsing , basisChangeUsing , Numeric.LinearCombination.filter , find , elementsToList , scalarMult , zero , showUsing , simplify ) where import GHC.Exts (sortWith) import Data.AEq import Numeric (sho...
pnutus/geometric-algebra
src/Numeric/LinearCombination.hs
Haskell
mit
5,080
-- 1 take 1 $ map (+1) [undefined, 2, 3] -- ⊥ -- 2 take 1 $ map (+1) [1, undefined, 3] -- [2] -- 3 take 2 $ map (+1) [1, undefined, 3] -- ⊥ -- 4 -- itIsMystery takes string and return list of bools where True correspond to vowel and False to consonant for input string itIsMystery :: String -> [Bool] itIsMystery xs = m...
ashnikel/haskellbook
ch09/ch09.9_ex.hs
Haskell
mit
473
{-# LANGUAGE FlexibleContexts #-} module Helpers.Database where import Database.Groundhog import Database.Groundhog.Core import Database.Groundhog.Sqlite import Data.Proxy db :: Proxy Sqlite db = undefined intToKey :: (PrimitivePersistField (Key a b)) => Int -> Key a b intToKey p = integralToKey p integralToKey ::...
archaeron/chatty-server
src/Helpers/Database.hs
Haskell
mit
471
{-# LANGUAGE QuasiQuotes #-} module AltParsing where import Control.Applicative import Text.Trifecta import Text.RawString.QQ type NumberOrString = Either Integer String parseNos :: Parser NumberOrString parseNos = skipMany (oneOf "\n") >> (Left <$> integer) <|> (Right <$> some letter) eitherOr...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter24/AltParsing/src/AltParsing.hs
Haskell
mit
365
module Lab6 where import System.CPUTime import System.Random import Control.Monad import Lecture6 -- Exercise 1 -- Catches some edge cases and then use the exMsq to calculate squared modulo. exM :: Integer -> Integer -> Integer -> Integer exM b e m | e < 0 = 0 | e == 0 = 1 `mod` m | otherwise = exMsq b e...
Gurrt/software-testing
week-6/Lab6.hs
Haskell
mit
7,815
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Y2018.M04.D04.Exercise where {-- So you have the data from the last two day's exercises, let's start storing those data into a PostgreSQL database. Today's exercise is to store just the authors. But there's a catch: you have to consider you're doing this as a da...
geophf/1HaskellADay
exercises/HAD/Y2018/M04/D04/Exercise.hs
Haskell
mit
2,012
{-# LANGUAGE OverloadedStrings #-} -- -- | Test SQL queries using SQLite interpreter -- module Codex.Tester.Sql ( sqliteTester ) where import Codex.Tester import Control.Applicative ((<|>)) import Data.Maybe (fromMaybe) import qualified Data.Text as T import Data.List (sort)...
pbv/codex
src/Codex/Tester/Sql.hs
Haskell
mit
5,242
module Triplet (isPythagorean, mkTriplet, pythagoreanTriplets) where isPythagorean :: (Int, Int, Int) -> Bool isPythagorean (a, b, c) = a * a + b * b + c * c == 2 * m * m where m = maximum [a, b, c] mkTriplet :: Int -> Int -> Int -> (Int, Int, Int) mkTriplet a b c = (a, b, c) pythagoreanTriplets :: Int -> Int -> [...
c19/Exercism-Haskell
pythagorean-triplet/src/Triplet.hs
Haskell
mit
484
import Test.Hspec import Control.Exception (evaluate) import qualified Data.Map.Strict as Map import Go import Go.UI.Color main :: IO () main = hspec $ do describe "Go.addMove" $ do it "adds a black stone to an empty board" $ do let point = Point (3, 4) Right game = addMove new...
tsujigiri/gosh
spec/Spec.hs
Haskell
mit
2,748
module RandomForest where import Data.List import Numeric.LinearAlgebra import Predictor import Utils import CART type RandomForest = EnsembleLearner CART_Tree newtype EnsembleLearner learner = EL [learner] instance (Predictor l) => Predictor (EnsembleLearner l) where predict v (EL ls) = (sum' (map (predict v) ls...
jvictor0/OnlineRandomForest
src/RandomForest.hs
Haskell
mit
518
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 11 -- Summation of primes module Problem11 where import Data.Maybe (catMaybes) type Coord = (Int, Int) grid :: [[Int]] grid = [ [08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08] , [49, 49,...
mk12/euler
haskell/Problem11.hs
Haskell
mit
2,717
module Note.Character where import Control.Arrow import Control.Applicative hiding ( (<|>) ) import Control.Name import Data.List import Data.String.Utils import Data.Utils import Note import Text.ParserCombinators.Parsec import Text.ParserCombinators.TagWiki import Text.Pin ( fromName ) import qualified Control.Modifi...
Soares/tagwiki
src/Note/Character.hs
Haskell
mit
4,677
-- Take a number of items from the beginning of a list. module Take where import Prelude hiding (take) take :: Integer -> [t] -> [t] take _ [] = [] take numberOfItems list | numberOfItems < 0 = error "Negative number." | otherwise = take' numberOfItems list where take' 0 _ = [] take' numberOfIte...
pascal-knodel/haskell-craft
Examples/· Recursion/· Primitive Recursion/Lists/Take.hs
Haskell
mit
630
module ScoreToLilypond.UtilsTest where import Data.ByteString.Builder import Data.Either.Combinators (fromRight') import Data.Ratio import qualified Data.Set as Set import Music.RealSimpleMusic.Music.Data import Music.RealSimpleMusic.Music.Utils import Music....
tomtitchener/RealSimpleMusic
tests/ScoreToLilypond/UtilsTest.hs
Haskell
cc0-1.0
6,069
{-# OPTIONS_GHC -Wall #-} import Control.Monad (void) import Test.HUnit import CreditCard digitsTest1, digitsTest2, digitsTest3, digitsTest4 :: Test digitsTest1 = TestCase $ assertEqual "in digits decomposition" [1,2,3,4] (toDigits 1234) digitsTest2 = TestCase $ assertEqual "in reverse digits decomposition" [...
mgrabovsky/upenn-cis194
hw01/testCreditCard.hs
Haskell
cc0-1.0
1,819
{-# LANGUAGE FlexibleInstances #-} -- | The RLP module provides a framework within which serializers can be built, described in the Ethereum Yellowpaper (<http://gavwood.com/paper.pdf>). -- -- The 'RLPObject' is an intermediate data container, whose serialization rules are well defined. By creating code that converts...
zchn/ethereum-analyzer
ethereum-analyzer-deps/src/Blockchain/Data/RLP.hs
Haskell
apache-2.0
6,324
{-# LANGUAGE ScopedTypeVariables #-} {- HSStructMain.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 Unle...
ssoudan/hsStruct
src/HSStructMain.hs
Haskell
apache-2.0
4,013
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTextCursor.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:35 Warning : this file is machine generated - do n...
uduki/hsQt
Qtc/Enums/Gui/QTextCursor.hs
Haskell
bsd-2-clause
7,402
-- -- Copyright 2014, NICTA -- -- This software may be distributed and modified according to the terms of -- the BSD 2-Clause license. Note that NO WARRANTY is provided. -- See "LICENSE_BSD2.txt" for details. -- -- @TAG(NICTA_BSD) -- -- Printer for C source format to be consumed by the CapDL initialiser. -- Note: corr...
smaccm/capDL-tool
CapDL/PrintC.hs
Haskell
bsd-2-clause
14,280
{-# LANGUAGE CPP, OverloadedStrings #-} -- Requires the network-bytestring library. -- -- Start server and run -- httperf --server=localhost --port=5002 --uri=/ --num-conns=10000 -- or -- ab -n 10000 -c 100 http://localhost:5002/ import Args (ljust, parseArgs, positive, theLast) import Control.Concurrent (forkIO,...
tibbe/event
benchmarks/PongServer.hs
Haskell
bsd-2-clause
3,719
module Application.Scaffold.Generate.Darcs where import System.Process import System.Exit darcsInit :: IO ExitCode darcsInit = system "darcs init" darcsFile :: FilePath -> IO ExitCode darcsFile fp = do putStrLn $ "add " ++ fp system ("darcs add " ++ fp) darcsRecord :: String -> IO ExitCode darcsRecord patchna...
wavewave/scaffold
lib/Application/Scaffold/Generate/Darcs.hs
Haskell
bsd-2-clause
387
module Animation where import Graphics.UI.SDL import Graphics.UI.SDL.Image import Control.Monad type Animation = [Surface] loadAnimation :: FilePath -> Int -> IO Animation loadAnimation folder size = do frames <- forM [0..size-1] $ \i -> do load $ folder ++ show i ++ ".png" return $ cycle frames
alexisVallet/hachitai-haskell-shmup
Animation.hs
Haskell
bsd-2-clause
307
{-# LANGUAGE PatternGuards #-} module Idris.PartialEval(partial_eval, getSpecApps, specType, mkPE_TyDecl, mkPE_TermDecl, PEArgType(..), pe_app, pe_def, pe_clauses, pe_simple) where import Idris.AbsSyntax import Idris.Delaborate import Idris.Core.TT import Idris.Core....
BartAdv/Idris-dev
src/Idris/PartialEval.hs
Haskell
bsd-3-clause
13,072
import Control.Concurrent import Control.Monad foreign import ccall input :: Int foreign import ccall output :: Int -> IO () main :: IO () main = do m <- newEmptyMVar forkIO $ putMVar m input r <- takeMVar m output r
bosu/josh
t/progs/MVar.hs
Haskell
bsd-3-clause
235
{-# LANGUAGE CPP, GADTs #-} ----------------------------------------------------------------------------- -- | -- Module : Math.Combinatorics.Species.AST.Instances -- Copyright : (c) Brent Yorgey 2010 -- License : BSD-style (see LICENSE) -- Maintainer : byorgey@cis.upenn.edu -- Stability : experimen...
timsears/species
Math/Combinatorics/Species/AST/Instances.hs
Haskell
bsd-3-clause
13,095
{-# language CPP #-} -- | = Name -- -- VK_KHR_ray_tracing_pipeline - device extension -- -- == VK_KHR_ray_tracing_pipeline -- -- [__Name String__] -- @VK_KHR_ray_tracing_pipeline@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 348 -- -- [__Revision__] -- 1 -- -...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_KHR_ray_tracing_pipeline.hs
Haskell
bsd-3-clause
195,430
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} -- https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#scripting--command-line-applications module Lib ( someFunc ) where import qualified Data.ByteString.Char8 as BS import qualified Data.Tex...
minimal/build-lib
src/Lib.hs
Haskell
bsd-3-clause
1,322
{-# LANGUAGE CPP #-} {-# LANGUAGE EmptyDataDecls, MultiParamTypeClasses, FunctionalDependencies, Rank2Types, DeriveDataTypeable, FlexibleInstances, UndecidableInstances, FlexibleContexts,ScopedTypeVariables, TypeFamilies #-} ------------------------------------------------------...
coreyoconnor/type-level-tf
src/Data/TypeLevel/Bool.hs
Haskell
bsd-3-clause
5,146
-- | All the solutions of the 4-queens puzzle. module Example.Monad.Queens4All ( run ) where import Control.Applicative import Control.Monad ( join ) import Data.Maybe import qualified Data.Traversable as T import Z3.Monad run :: IO () run = do sols <- evalZ3With Nothing opts script putStrLn "Solutions: " ...
sukwon0709/z3-haskell
examples/Example/Monad/Queens4All.hs
Haskell
bsd-3-clause
2,355
{-# LANGUAGE PackageImports #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE UnicodeSyntax #-} module Test.Complexity.Pretty (prettyStats, printStats) where import "base-unicode-symbols" Data.Function.Unicode ( (∘) ) import qualified "vector" Data.Vector as V import "this" Test.Complexity.Types ( MeasurementStats...
roelvandijk/complexity
Test/Complexity/Pretty.hs
Haskell
bsd-3-clause
1,204
{-# LANGUAGE ViewPatterns, GADTs, FlexibleContexts, DataKinds #-} module Sprite.GUI where import Graphics.UI.Gtk.OpenGL import Graphics.UI.Gtk hiding (Point, Object) import Graphics.Rendering.OpenGL import Control.Concurrent.STM import Control.Monad.Trans import Data.List.PointedList import Sprite.Widget (graph...
paolino/sprites
Sprite/GUI.hs
Haskell
bsd-3-clause
1,071
module Rules.Libffi (libffiRules, libffiDependencies) where import Base import Expression import GHC import Oracles import Rules.Actions import Settings.Builders.Common import Settings.Packages.Rts import Settings.TargetDirectory import Settings.User rtsBuildPath :: FilePath rtsBuildPath = targetPath Stage1 rts -/- "...
quchen/shaking-up-ghc
src/Rules/Libffi.hs
Haskell
bsd-3-clause
3,933
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.KO.Corpus ( corpus ) where import Prelude import D...
facebookincubator/duckling
Duckling/Numeral/KO/Corpus.hs
Haskell
bsd-3-clause
5,023
-- | Yesod.Test.Json provides convenience functions for working -- with Test.Hspec and Network.Wai.Test on JSON data. module Yesod.Test.Json ( testApp, APIFunction, assertBool, assertString, assertOK, assertJSON, Session(..), H.Assertion, module Test.Hspec, module Data.Aeson, SResponse(..) ) where ...
bogiebro/yesod-test-json
Yesod/Test/Json.hs
Haskell
bsd-3-clause
2,449
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} module Plots.Axis.Labels where import Con...
AjayRamanathan/plots
src/Plots/Axis/Labels.hs
Haskell
bsd-3-clause
3,989
module Rules.Generators.GhcVersionH (generateGhcVersionH) where import Base import Expression import Oracles import Settings.User generateGhcVersionH :: Expr String generateGhcVersionH = do when trackBuildSystem . lift $ need [sourcePath -/- "Rules/Generators/GhcVersionH.hs"] version <- getSetting...
quchen/shaking-up-ghc
src/Rules/Generators/GhcVersionH.hs
Haskell
bsd-3-clause
1,412
{-# LANGUAGE DeriveDataTypeable, RecordWildCards , OverloadedStrings, StandaloneDeriving , ScopedTypeVariables, CPP #-} module Database where import Data.Typeable import Data.TCache.IndexQuery import Data.TCache.DefaultPersistence import Data.TCache.AWS import Data.Monoid import qualified Data.Te...
agocorona/MFlow
Demos/Database.hs
Haskell
bsd-3-clause
2,521
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Network.Sock.Handler.Common where ------------------------------------------------------------------------------ import Control.Concurrent.MVar.Lifted import Control.Concurrent.STM import Control.Concurrent.STM....
Palmik/wai-sockjs
src/Network/Sock/Handler/Common.hs
Haskell
bsd-3-clause
9,309
{-# LANGUAGE OverloadedStrings #-} module Definition where import qualified Data.Text as T import Language data Definition = Definition { word :: T.Text , sourceLang :: Language , definitionLang :: Language , partOfSpeechList :: [(T.Text, [T.Tex...
aupiff/def
src/Definition.hs
Haskell
bsd-3-clause
963
{-# LANGUAGE FlexibleContexts #-} module PeerTrader where import Control.Concurrent import Control.Concurrent.Async import Control.Concurrent.STM (atomically, dupTChan, readTChan, writeTChan) import Control.Exception ...
WraithM/peertrader-backend
src/PeerTrader.hs
Haskell
bsd-3-clause
5,958
module NAA.Loop (runNoughtsAndArrs) where import NAA.AI import NAA.Logic import NAA.State import NAA.Data hiding (player) import NAA.Interface import NAA.Interface.CLI import Control.Monad.Trans import Control.Monad.State.Lazy -- So not only do we need to keep running the GameState over IO but we probably -- want som...
fatuhoku/haskell-noughts-and-crosses
src/NAA/Loop.hs
Haskell
bsd-3-clause
3,522
module Math.Misc.Permutation where import Math.Misc.Parity import Misc.Misc import Math.Algebra.Monoid -- | A permutation is represented as a pair of lists. The condition -- that the two lists contain precisely the same elements is /not -- checked/. type Permutation a = ([a], [a]) -- | Calculate the parity of a give...
michiexile/hplex
pershom/src/Math/Misc/Permutation.hs
Haskell
bsd-3-clause
748
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} module Himpress.Plumbing where import qualified Himpress.Format as F import Paths_himpress import System.INotify import System.FilePath (takeExtension) import Control.Concurrent (threadDelay) import Control.Arrow ((&&&),(***)) import Control.Monad (mapM_) import...
matthewSorensen/himpress
Himpress/Plumbing.hs
Haskell
bsd-3-clause
4,258
module Pos.Chain.Ssc.Error ( module Pos.Chain.Ssc.Error.Seed , module Pos.Chain.Ssc.Error.Verify ) where import Pos.Chain.Ssc.Error.Seed import Pos.Chain.Ssc.Error.Verify
input-output-hk/pos-haskell-prototype
chain/src/Pos/Chain/Ssc/Error.hs
Haskell
mit
213
{-| Implementation of the generic daemon functionality. -} {- Copyright (C) 2011, 2012 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 code must retain the ab...
apyrgio/ganeti
src/Ganeti/Daemon.hs
Haskell
bsd-2-clause
17,864
module Language.Haskell.GhcMod.Lint where import Exception (ghandle) import Control.Exception (SomeException(..)) import Language.Haskell.GhcMod.Logger (checkErrorPrefix) import Language.Haskell.GhcMod.Convert import Language.Haskell.GhcMod.Monad import Language.Haskell.GhcMod.Types import Language.Haskell.HLint (hlin...
cabrera/ghc-mod
Language/Haskell/GhcMod/Lint.hs
Haskell
bsd-3-clause
754
----------------------------------------------------------------------------- -- | -- License : BSD-3-Clause -- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi> -- -- The repo collaborators API as described on -- <http://developer.github.com/v3/repos/collaborators/>. module GitHub.Endpoints.Repos.Collaborators ( ...
jwiegley/github
src/GitHub/Endpoints/Repos/Collaborators.hs
Haskell
bsd-3-clause
2,278
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE MultiWayIf #-} module Hans.Dns.Packet ( DNSPacket(..) , DNSHeader(..) , OpCode(..) , RespCode(..) , Query(..) , QClass(..) , QType(..) , RR(..) , Type(..) , Class(..) , RData(..) ,...
GaloisInc/HaNS
src/Hans/Dns/Packet.hs
Haskell
bsd-3-clause
18,069
import System.Process.Extra main = system_ "bake-test"
capital-match/bake
travis.hs
Haskell
bsd-3-clause
57
module EnvSpec (main, spec) where import TestUtil import Network.MPD import System.Posix.Env hiding (getEnvDefault) main :: IO () main = hspec spec spec :: Spec spec = do describe "getEnvDefault" $ do it "returns the value of an environment variable" $ do setEnv "FOO" "foo"...
beni55/libmpd-haskell
tests/EnvSpec.hs
Haskell
mit
2,706
<?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="hr-HR"> <title>Core Language Files | ZAP Extension</title> <maps> <homeID>top</homeID> ...
kingthorin/zap-extensions
addOns/coreLang/src/main/javahelp/org/zaproxy/zap/extension/coreLang/resources/help_hr_HR/helpset_hr_HR.hs
Haskell
apache-2.0
980
{-# LANGUAGE TupleSections #-} import CoreSyn import CoreUtils import Id import Type import MkCore import CallArity (callArityRHS) import MkId import SysTools import DynFlags import ErrUtils import Outputable import TysWiredIn import Literal import GHC import Control.Monad import Control.Monad.IO.Class import System.En...
green-haskell/ghc
testsuite/tests/callarity/unittest/CallArity1.hs
Haskell
bsd-3-clause
9,333
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.Concurrent -- Copyright : (c) The University of Glasgow 2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintaine...
ezyang/ghc
libraries/base/Foreign/Concurrent.hs
Haskell
bsd-3-clause
2,940
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Hpc -- Copyright : Thomas Tuegel 2011 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module provides functions for locating various HPC-r...
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Hpc.hs
Haskell
bsd-3-clause
5,350
module Thread ( ThreadTree (..) , ContM (..) , atom , stop , buildThread ) where ---------------------------------- data ThreadTree req rsp m = Atom (m (ThreadTree req rsp m)) | Stop ---------------------------------- newtype ContM req rsp m a = ContM ((a-> ThreadTree req rsp m)-> ThreadTree req rsp m)...
ezyang/ghc
testsuite/tests/concurrent/prog002/Thread.hs
Haskell
bsd-3-clause
1,155
import qualified Graphics.UI.GLFW as GLFW import Graphics.GL import Data.Bits import Control.Monad import Linear import SetupGLFW import ShaderLoader import Cube ------------------------------------------------------------- -- A test to make sure our rendering works without the Oculus -------------------------------...
lukexi/oculus-mini
test/TestCube.hs
Haskell
mit
1,441
import Control.Monad.Trans.State.Lazy tick :: State Int String tick = return "foo" tick2 :: State Int String tick2 = do s <- tick return $ s ++ "bar" tick3 = do s <- tick s2 <- tick2 s3 <- tick2 put 1600 return $ s3 type Stack = [Int] pop :: State Stack Int ...
nlim/haskell-playground
src/Statements.hs
Haskell
mit
620
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} -- module module Persistence (loadSession, saveSession) where -- imports import Control.Applicative import Control.Monad.Error import Control.Monad.State import ...
nicuveo/RCL
src/Persistence.hs
Haskell
mit
2,461
data Way = U | R | D | L deriving(Eq, Show) data Op = Op { opPiece :: Int , opCost :: Int , opWay :: [Way] } deriving(Eq, Show) type Field = [Int] swapCost = 1 choiceCost = 10 fieldWidth = 4 fieldHeight = 4 maxChoice = 3 magicNum = 0 goal = [0..24] :: [Int] fie = 1:2:0:[3..24] :: [Int] solv...
inct-www-club/Procon2014
src/solver.hs
Haskell
mit
3,874
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} -- for the client: export those types needed for playnow module Game.Play.Api.Types where import Control.Lens.TH (makeLenses) import Data.Aeson (FromJSON, ToJSON...
rubenmoor/skull
skull-server/src/Game/Play/Api/Types.hs
Haskell
mit
1,138
module ProjectEuler.Problem56 ( problem ) where import Data.List import ProjectEuler.Types problem :: Problem problem = pureProblem 56 Solved result digitSum :: Integer -> Int digitSum = sum . unfoldr f where f 0 = Nothing f n = let (q,r) = n `quotRem` 10 in Just (fromIntegral r, q) result :: Int resu...
Javran/Project-Euler
src/ProjectEuler/Problem56.hs
Haskell
mit
389
-- | <http://strava.github.io/api/v3/activities/> module Strive.Actions.Activities ( createActivity , getActivity , updateActivity , deleteActivity , getCurrentActivities , getRelatedActivities , getFeed , getActivityZones , getActivityLaps ) where import Data.Aeson (encode) import Data.ByteString....
tfausak/strive
source/library/Strive/Actions/Activities.hs
Haskell
mit
4,194
module Data.Bson.Binary.Tests ( tests ) where import Data.Binary (encode, decode) import Test.Tasty (TestTree, testGroup) import Test.Tasty.QuickCheck (testProperty) import Data.Bson (Document) import Data.Bson.Binary () import Data.Bson.Tests.Instances () testEncodeDecodeDocument :: Document -> Bool testEn...
lambda-llama/bresson
tests/Data/Bson/Binary/Tests.hs
Haskell
mit
515
{-# LANGUAGE DeriveGeneric #-} module Test.SimpleTable where import DB.Model.SimpleTable import qualified DB.Model.SimpleTable as S import DB.Model.MultiTable (MultiTable) import qualified DB.Model.MultiTable as M import Test.Hspec data Test m = Test { key :: m Int, f :: m String, c :...
YLiLarry/db-model
test/Test/SimpleTable.hs
Haskell
mit
837
module LispLovesMe where import Text.ParserCombinators.Parsec hiding (spaces) import Data.List (intercalate) data AST = I32 Int | Sym String | Nul | Err | Lst [AST] | Boo Bool | Nod AST [AST] deriving (Eq, Show) spaces :: Parser String spa...
delta4d/codewars
kata/i-love-lisp/LispLovesMe.hs
Haskell
mit
4,742
{-# LANGUAGE OverloadedStrings #-} module System.PassengerCheck.HealthSpec (spec) where import Test.Hspec import System.PassengerCheck.Types import System.PassengerCheck.Health import System.Nagios.Plugin (CheckStatus(..)) spec :: Spec spec = do describe "queuedRequests" $ it "returns the number of queued re...
stackbuilders/passenger-check
spec/System/PassengerCheck/HealthSpec.hs
Haskell
mit
906
{- | Module : Main Copyright : Justin Ethier Licence : MIT (see LICENSE in the distribution) Maintainer : github.com/justinethier Stability : experimental Portability : portable This file implements a REPL /shell/ to host the interpreter, and also allows execution of stand-alone files containing Scheme ...
justinethier/husk-scheme
hs-src/Interpreter/shell.hs
Haskell
mit
7,473
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Api.MimeTypes ( Markdown ) where import qualified Data.ByteString.Lazy as LBS import Data.Text (Text) import Data.Text.Encoding (encodeUtf8) import Network.HTTP.Media ((//), (/:)) import Servant as S data Markdown instance S.Accept Mar...
gust/feature-creature
legacy/lib/Api/MimeTypes.hs
Haskell
mit
497
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLInputElement (js_stepUp, stepUp, js_stepDown, stepDown, js_checkValidity, checkValidity, js_setCustomValidity, setCustomValidity, js_select, select, js_setRangeText, setRangeText, js_set...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/HTMLInputElement.hs
Haskell
mit
47,804
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk-version.html module Stratosphere.Resources.ElasticBeanstalkApplicationVersion where import Stratos...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/ElasticBeanstalkApplicationVersion.hs
Haskell
mit
3,311
{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE...
paul-rouse/yesod-auth-hashdb
test/TestSite.hs
Haskell
mit
4,580
module Problem02 (partA, partB) where import Data.Monoid import Text.Megaparsec import Text.Megaparsec.String inputLocation :: FilePath inputLocation = "input/input02.txt" data Offset = Negative | Neutral | Positive deriving (Eq,Show,Enum,Ord) instance Monoid Offset where mempty = Neutral mappend Negati...
edwardwas/adventOfCodeTwo
src/Problem02.hs
Haskell
mit
3,402
-- (**) Rotate a list N places to the left. -- -- Hint: Use the predefined functions length and (++). -- -- Examples: -- -- * (rotate '(a b c d e f g h) 3) -- (D E F G H A B C) -- -- * (rotate '(a b c d e f g h) -2) -- (G H A B C D E F) -- Examples in Haskell: -- -- *Main> rotate ['a','b','c','d','e','f','g','h'] 3 -- ...
tiann/haskell-learning
haskell99/p19/main.hs
Haskell
apache-2.0
561
module Problem063 where main = print $ length [n | b <- [1 .. 9], p <- ps, let n = b ^ p, length (show n) == p] where ps = takeWhile (\p -> length (show (9 ^ p)) >= p) [1 ..]
vasily-kartashov/playground
euler/problem-063.hs
Haskell
apache-2.0
181
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} import Data.List class Foo a where foo :: a -> String -- Now will error due to the compiler don't know which one to call between -- String and [char] instance (Foo a) => Foo [a] where foo = concat . intersperse ", " . map foo instance Foo Char where ...
EricYT/Haskell
src/chapter-6-4.hs
Haskell
apache-2.0
375
-------------------------------------------------------------------------------- -- | -- Module : Network.SimpleIRC.Core.Lens -- Copyright : (C) 2014 Ricky Elrod -- License : BSD-style (see the file LICENSE) -- Maintainer : Ricky Elrod <ricky@elrod.me> -- Stability : provisional -- Portability : por...
relrod/simpleirc-lens
src/Network/SimpleIRC/Core/Lens.hs
Haskell
bsd-2-clause
3,054
import Prelude data Encoded a = Single a | Multiple Int a deriving Show encodeDirect :: Eq a => [a] -> [Encoded a] encodeDirect [] = [] encodeDirect xs = foldr (append) [] xs where append y [] = [Single y] append y ((Single z):zs) | (y == z) = (Multiple 2 z):zs | otherw...
2dor/99-problems-Haskell
11-20-lists-continued/problem-13.hs
Haskell
bsd-2-clause
492
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} import qualified Prelude as P import BasicPrelude import Filesystem.Path.CurrentOS (decodeString) import System.Environment (getArgs) import qualified Data.Text.Encoding as T import qualified Data.Ini.Reader as Ini import Data.Conduit.Network (runTCPServer, serverSettin...
yihuang/cloud-ftp
Main.hs
Haskell
bsd-3-clause
715
{-# LANGUAGE KindSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeOperators...
jonascarpay/visor
src/Types.hs
Haskell
bsd-3-clause
5,061
-- | -- Module : Language.Logo -- Copyright : (c) 2013-2016, the HLogo team -- License : BSD3 -- Maintainer : Nikolaos Bezirgiannis <bezirgia@cwi.nl> -- Stability : experimental -- -- Main wrapper module; the only module that should be imported by the model module Language.Logo ( module Lan...
bezirg/hlogo
src/Language/Logo.hs
Haskell
bsd-3-clause
721
module Util.Integral where instance Integral Float where quotRem a b = (fab, (ab - fab)*b) where ab = a/b fab = floor ab toInteger = floor instance Integral Double where quotRem a b = (fab, (ab - fab)*b) where ab = a/b fab = floor ab toInteger = floor
phylake/haskell-util
Integral.hs
Haskell
bsd-3-clause
295
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TemplateHaskell, DeriveGeneric #-} module OpenGL.Evaluator.GLPrimitives where import Data.Word import qualified Data.ByteString as BS import Data.Data import Data.Typeable import Foreign import Foreign.C.Types import Foreign.Storable import Data.Binary impor...
jfischoff/opengl-eval
src/OpenGL/Evaluator/GLPrimitives.hs
Haskell
bsd-3-clause
3,172
{-# LANGUAGE NoImplicitPrelude, UnicodeSyntax #-} -- |Help.Imports provides a central location for universally shared exports, primarily -- the non-standard Prelude. module Help.Imports ( -- *Overrides FilePath -- *Re-Exports , module ClassyPrelude ...
argiopetech/help
Help/Imports.hs
Haskell
bsd-3-clause
547
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Reactive.Banana.DOM.Widget ( ReactiveDom, CleanupHandler, IsWidget(..), IsEventWidget(..), WidgetInstance, mkWidget, re...
open-etcs/openetcs-dmi
src/Reactive/Banana/DOM/Widget.hs
Haskell
bsd-3-clause
4,195
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANG...
mstksg/tensor-ops
src/Data/Type/Uniform.hs
Haskell
bsd-3-clause
1,854
module Bump where import Control.Monad.Error (throwError, liftIO) import qualified Data.List as List import qualified Catalog import qualified CommandLine.Helpers as Cmd import qualified Diff.Compare as Compare import qualified Docs import qualified Elm.Docs as Docs import qualified Elm.Package.Description as Desc im...
rtfeldman/elm-package
src/Bump.hs
Haskell
bsd-3-clause
8,561
-- HSlippyMap Exemple import HSlippyMap {-- let max = tileFromLatLong 48.9031 2.5214 10 let min = tileFromLatLong 48.8146 2.1732 10 mapM (\(x,y) -> mapM (\y'-> print $ "http://tile.openstreetmap.org/" ++ show z ++ "/" \ ++ show x ++ "/" ++ show y' ++ ".png") y) [(x,[(minimum [tymin, tymax])..(maximum [tymin\ ,tymax])]...
j4/HSlippyMap
hsl.hs
Haskell
bsd-3-clause
914
{- - Hacq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Hacq. - Hacq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ...
ti1024/hacq
src/Control/Monad/Quantum/Base/Class.hs
Haskell
bsd-3-clause
20,174
{-# LANGUAGE FlexibleContexts #-} -------------------------------------------------------------------------------- -- | -- Module : Network.OpenID.Discovery -- Copyright : (c) Trevor Elliott, 2008 -- License : BSD3 -- -- Maintainer : Trevor Elliott <trevor@geekgateway.com> -- Stability : -- Portability :...
substack/hsopenid
src/Network/OpenID/Discovery.hs
Haskell
bsd-3-clause
5,704
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.DList.Instances () where -- don't define instance for dlist>=0.8 && base>=4.9 #if !(MIN_VERSION_base(4,9,0)) || !(MIN_VERSION_dlist(0,8,0)) import Data.DList import Data.Semigroup instance Semigroup (DList a) where (<>) = append #endif
gregwebs/dlist-instances
Data/DList/Instances.hs
Haskell
bsd-3-clause
311
{-# LANGUAGE NoImplicitPrelude, UnicodeSyntax, OverloadedStrings, TemplateHaskell #-} module Help.Settings ( -- *The Settings type Settings -- *Lens getters for Settings , ymlFile , logFile , logCollection ...
argiopetech/help
Help/Settings.hs
Haskell
bsd-3-clause
8,648
{-# LANGUAGE OverloadedStrings #-} module Network.API.TLDR.Types.Time ( Time(..), LastActive(..), CreatedAt(..) ) where import Data.Aeson import Data.Aeson.Types (typeMismatch) import Data.Text (unpack) import ...
joshrotenberg/tldrio-hs
Network/API/TLDR/Types/Time.hs
Haskell
bsd-3-clause
806