code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
import System.Exit mul [x, y] = xInt * yInt where xInt = read x :: Integer yInt = read y :: Integer mainLoop 0 = exitWith ExitSuccess mainLoop x = do values <- getLine print $ mul (words values) mainLoop (x - 1) main = do loops <- getLine mainLoop (read loops :: Integer)
ranisalt/spoj
mul.hs
Haskell
mit
288
{-# LANGUAGE DeriveGeneric, OverloadedStrings #-} module Main where import Data.Aeson import qualified Data.ByteString.Lazy.Char8 as BS import Data.Map.Strict(Map) import qualified Data.Map.Strict as M import Data.Maybe(fromJust) import Data.Tree(Tree(..), flatten, unfoldTree) import Diagrams.Backend.SVG.CmdLine(defaul...
bobgru/tree-derivations
src/LSystem5.hs
Haskell
mit
5,140
import Test.Hspec import StringCalculator import Control.Exception (evaluate) main :: IO () main = hspec $ do describe "StringCalculator" $ do it "should return 0 for an empty string" $ do calculate "" `shouldBe` 0 it "should return 1 for a string '1'" $ do calculate "1" `s...
theUniC/string-calculator.hs
tests/Spec.hs
Haskell
mit
890
module Main where import qualified Network as Net import System.IO (Handle, hClose) import System.Environment (getArgs) import Data.ByteString (ByteString) import Control.Monad (forever, unless) import Control.Concurrent.STM (STM, atomically) import Control.Concurrent (ThreadId, forkIO, threadDelay) import Control.Exc...
wyager/Neks
Network/Neks/NeksServer.hs
Haskell
mit
3,546
-------------------------------------------------------------------------- -- Copyright (c) 2007-2010, ETH Zurich. -- All rights reserved. -- -- This file is distributed under the terms in the attached LICENSE file. -- If you do not find this file, copies can be found by writing to: -- ETH Zurich D-INFK, Haldeneggsteig...
UWNetworksLab/arrakis
hake/ArchDefaults.hs
Haskell
mit
11,931
{-# LANGUAGE QuasiQuotes, ScopedTypeVariables #-} module Handler.EntryPics where import Import import Utils.Database import qualified Hasql as H import qualified Data.Text as T getEntryPicsR :: Int -> Handler Html getEntryPicsR entryId = do dbres <- liftIO $ do conn <- getDbConn H.session conn $ ...
dgonyeo/brandskell
Handler/EntryPics.hs
Haskell
mit
860
{-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-} -- | Reexports "Numeric.Natural.Compat" -- from a globally unique namespace. module Numeric.Natural.Compat.Repl ( module Numeric.Natural.Compat ) where import "this" Numeric.Natural.Compat
haskell-compat/base-compat
base-compat/src/Numeric/Natural/Compat/Repl.hs
Haskell
mit
292
{-# LANGUAGE BangPatterns #-} {- | - Module : Memo - Description : Infinite memorization tree structure - Copyright : (c) Maciej Bendkowski - - Maintainer : maciej.bendkowski@gmail.com - Stability : experimental -} module Memo ( Tree(..), idx, nats, toList ) where -- | An infinite binary t...
maciej-bendkowski/blaz
src/Memo.hs
Haskell
mit
1,080
module YesNo ( YesNo ) where import Tree import TrafficLight class YesNo a where yesno :: a -> Bool instance YesNo Int where yesno 0 = False yesno _ = True instance YesNo [ a ] where yesno [] = False yesno _ = True instance YesNo Bool where yesno = id -- Function 'id' means identity, get argument...
afronski/playground-fp
books/learn-you-a-haskell-for-great-good/making-our-own-types-and-typeclasses/YesNo.hs
Haskell
mit
713
{-# OPTIONS_GHC -O0 #-} {-# LANGUAGE CPP, DeriveGeneric, DeriveDataTypeable, LambdaCase, MagicHash, StandaloneDeriving #-} #ifndef __GHCJS__ {-# LANGUAGE PackageImports #-} #endif {- | Communication between the compiler (GHCJS) and runtime (on nod...
ghcjs/ghcjs
lib/ghcjs-th/GHCJS/Prim/TH/Types.hs
Haskell
mit
3,274
import AdventOfCode (readInputFile) import Control.Monad (foldM) import Data.Char (isDigit) import Text.Read (readMaybe) data JsonNest = Object Bool | Array deriving (Show) -- Left are for possible but malformed input strings, like } or ]. -- error are for invalid states that no input string, well-formed or malforme...
petertseng/adventofcode-hs
bin/12_json_numbers.hs
Haskell
apache-2.0
3,487
{- Copyright 2015 Tristan Aubrey-Jones 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 writing, sof...
flocc-net/flocc
v0.1/Compiler/Tests/PfFb/Run2.hs
Haskell
apache-2.0
1,951
data Position t = Position t deriving (Show) stagger (Position d) = Position (d + 2) crawl (Position d) = Position (d + 1) rtn x = x x >>== f = f x
fbartnitzek/notes
7_languages/Haskell/drunken-monad.hs
Haskell
apache-2.0
149
module Routes.Header where import Text.Blaze.Html -- local import Session import Html.Header buildHeaderHtml :: ServerT Html buildHeaderHtml = do return $ headerHtml
mcmaniac/blog.nils.cc
src/Routes/Header.hs
Haskell
apache-2.0
173
{-# LANGUAGE DeriveGeneric #-} module Model.JsonTypes.Turn ( Turn(..) , jsonTurn ) where import Data.Aeson (ToJSON) import Database.Persist.Sql (Entity(..)) import Data.Time.Clock (UTCTime) import GHC.Generics (Generic) import qualified Model....
flatrapp/core
app/Model/JsonTypes/Turn.hs
Haskell
apache-2.0
717
s :: [Int] s = map (2^) [0..] bin :: Int -> [Int] bin 0 = [] bin x = (x `mod` 2):(bin $ x `div` 2) tak [] = [] tak ((0,s):xs) = tak xs tak ((1,s):xs) = s:(tak xs) ans x = tak $ zip (bin x) s main = do c <- getContents let i = map read $ lines c :: [Int] o = map ans i mapM_ putStrLn $ map unwords $ map...
a143753/AOJ
0031.hs
Haskell
apache-2.0
334
-- Copyright 2020 Google LLC -- -- 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 ...
google/hrepl
hrepl/tests/Chain3Alternate.hs
Haskell
apache-2.0
760
{-# LANGUAGE OverloadedStrings #-} -- This is needed so that we can have constraints in type synonyms. {-# LANGUAGE RankNTypes #-} module Main where import Network.Wreq import Control.Lens import Data.Aeson.Lens (_String, _Array, key) main :: IO() main = do r <- get "https://api.github.com/users/prt2121/repos" p...
prt2121/haskell-practice
httpee/src/Main.hs
Haskell
apache-2.0
1,117
{-# LANGUAGE TupleSections #-} module Evolution where import System.Random import Control.Monad import Control.Arrow import Data.List import Data.Ord --import Data.MList type Probability = Double type FitnessValue = Double type Quantile = Double type FitnessFunction a = a -> FitnessValue type ReproducingFunction a =...
jtapolczai/Scratchpad
src/Evolution.hs
Haskell
apache-2.0
1,717
module Data.IORef ( IORef, newIORef, readIORef, writeIORef, modifyIORef, modifyIORef', atomicModifyIORef, atomicModifyIORef', atomicWriteIORef ) where import System.Mock.IO.Internal
3of8/mockio
New_IORef.hs
Haskell
bsd-2-clause
190
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QCursor.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:16 Warning : this file is machine generated - do not m...
keera-studios/hsQt
Qtc/Gui/QCursor.hs
Haskell
bsd-2-clause
8,833
{-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} -- | An example of how to do LDAP logins with ldap-client. -- -- First, the assumptions this example makes. It defaults to LDAP over TLS, -- so if you only have a plaintext server, please replace `Secure` with `Plain`. -- It also assumes the accounts y...
VictorDenisov/ldap-client
example/login.hs
Haskell
bsd-2-clause
3,786
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} module Math.Budget.Lens.FixedIntervalL where import Math.Budget.FixedPeriod class FixedIntervalL cat target | target -> cat where fixedIntervalL :: cat target FixedPeriod
tonymorris/hbudget
src/Math/Budget/Lens/FixedIntervalL.hs
Haskell
bsd-3-clause
239
{-# LANGUAGE FlexibleContexts #-} -- for parsec 3 import SICP.LispParser import SICP.DB import Text.Parsec hiding (space) import Data.MultiSet (MultiSet) import qualified Data.MultiSet as MultiSet import Control.Monad import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck as QC dbTests :: DB -> Tes...
feumilieu/sicp-haskell
test/test.hs
Haskell
bsd-3-clause
7,633
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module SIGyM.Store.Generation ( Generation , GenEnv (..) , GenState (..) , GenError (..) , Registry , mkEnvironment , runGen , evalGen , getTime , findStore , findContext , noMsg , strMsg , throwError , catchError , liftIO ) where impo...
meteogrid/sigym-core
src/SIGyM/Store/Generation.hs
Haskell
bsd-3-clause
1,612
{-# LANGUAGE FlexibleContexts #-} module Text.Parsec.Char.Extras where import Control.Applicative ((*>), (<*)) import Data.Char (isSpace) import Text.Parsec (ParsecT, Stream, between, char, letter, many, sepBy1, satisfy, spaces) csv :: Stream s m Char => ParsecT s u m a -> ParsecT s u m [a] csv = (`sepBy1` comma) c...
mitchellwrosen/Sloch
src/lang-gen/Text/Parsec/Char/Extras.hs
Haskell
bsd-3-clause
711
module Main where import Control.Exception (bracket) import Data.ByteString (hGetSome) import Data.Serialize (decode) import Data.Vector (Vector) import qualified Data.Vector as Vector import Minecraft.Anvil (AnvilHeader(..), ChunkLocation(..), getAnvilHeader, readChunkData, decompressChunkData, showAnvilHeader) impor...
stepcut/minecraft-data
utils/DumpAnvil.hs
Haskell
bsd-3-clause
1,117
module D5Lib where import Text.Megaparsec (ParseError, Dec, endBy) import Text.Megaparsec.String (Parser) import Text.Megaparsec.Char as C import Text.Megaparsec.Lexer as L import Data.List (splitAt) type ParseResult = Either (ParseError Char Dec) Jmps type Jmps = [Int] data State = State { pos :: Int , j...
wfleming/advent-of-code-2016
2017/D5/src/D5Lib.hs
Haskell
bsd-3-clause
1,538
-- 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.Temperature.EN.Tests ( tests ) where import Prelude import Data.String import Test.Tasty imp...
facebookincubator/duckling
tests/Duckling/Temperature/EN/Tests.hs
Haskell
bsd-3-clause
928
-- | Display mode is for drawing a static picture. module Graphics.Gloss.Interface.Pure.Display ( module Graphics.Gloss.Data.Display , module Graphics.Gloss.Data.Picture , module Graphics.Gloss.Data.Color , display) where import Graphics.Gloss.Data.Display import Graphics.Gloss.Data.Pic...
ardumont/snake
deps/gloss/Graphics/Gloss/Interface/Pure/Display.hs
Haskell
bsd-3-clause
1,032
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Eleco.Slave.Backend.Repa where import Data.Vector.Unboxed ( Vector , imap , fromList ) import qualified Data.Vector.Unboxed as V import Data.Vector.Binary import Data.Array.Repa ( Array , DIM1 , U , Z(..) , (:.)(..) , from...
cikusa/Eleco
Eleco/Slave/Backend/Repa.hs
Haskell
bsd-3-clause
4,224
module Arimaa ( module Types , module Parser ) where import Types import Parser
Saulzar/arimaa
src/Arimaa.hs
Haskell
bsd-3-clause
91
----------------------------------------------------------------------------- -- | -- Module : XMonad.Util.Timer -- Description : A module for setting up timers. -- Copyright : (c) Andrea Rossato and David Roundy 2007 -- License : BSD-style (see xmonad/LICENSE) -- -- Maintainer : andrea.rossato@unibz.i...
xmonad/xmonad-contrib
XMonad/Util/Timer.hs
Haskell
bsd-3-clause
1,857
module Language.Haskell.GhcMod.Lang where import DynFlags (supportedLanguagesAndExtensions) import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.Convert -- | Listing language extensions. listLanguages :: Options -> IO String listLanguages opt = return $ convert opt supportedLanguagesAndExtensions
darthdeus/ghc-mod-ng
Language/Haskell/GhcMod/Lang.hs
Haskell
bsd-3-clause
316
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.PixelBufferObject -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portab...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/PixelBufferObject.hs
Haskell
bsd-3-clause
779
{-# LANGUAGE CPP #-} -- | This module provides remote monitoring of a running process over -- HTTP. It can be used to run an HTTP server that provides both a -- web-based user interface and a machine-readable API (e.g. JSON.) -- The former can be used by a human to get an overview of what the -- program is doing and ...
fpco/ekg
System/Remote/Monitoring.hs
Haskell
bsd-3-clause
6,893
{-| Module : PP.Grammars.Ebnf Description : Defines a AST and parser for the EBNF language Copyright : (c) 2017 Patrick Champion License : see LICENSE file Maintainer : chlablak@gmail.com Stability : provisional Portability : portable AST for the EBNF language. Based on the grammar given in the ISO/IEC 1...
chlablak/platinum-parsing
src/PP/Grammars/Ebnf.hs
Haskell
bsd-3-clause
10,858
module Cases.DeclDependencyTest where import Language.Haskell.Exts hiding (name) import Test.HUnit import Cases.BaseDir import Utils.DependencyAnalysis import Utils.Nameable testdecldependency1 = testdecldependency test1 testdecldependency :: (String, String) -> Assertion testdecldependency (f,s) = do ...
rodrigogribeiro/mptc
test/Cases/DeclDependencyTest.hs
Haskell
bsd-3-clause
1,013
module Agon.Data.Types where data UUIDs = UUIDs [String] data CouchUpdateResult = CouchUpdateResult { curRev :: String } deriving Show data CouchList e = CouchList { clItems :: [CouchListItem e] } deriving Show data CouchListItem e = CouchListItem { cliItem :: e } deriving Show
Feeniks/Agon
app/Agon/Data/Types.hs
Haskell
bsd-3-clause
296
{-# LANGUAGE StandaloneDeriving, DeriveFunctor, OverloadedStrings #-} module Web.Rest ( Request(..), Method(..),Location,Accept,ContentType,Body, Response(..), ResponseCode, RestT,Rest,rest, runRestT,Hostname,Port,RestError(..)) where import Web.Rest.Internal ( Request(..), Method(..),L...
phischu/haskell-rest
src/Web/Rest.hs
Haskell
bsd-3-clause
476
{-# LANGUAGE DataKinds, DeriveDataTypeable, FlexibleContexts #-} {-# LANGUAGE FlexibleInstances, FunctionalDependencies, MagicHash #-} {-# LANGUAGE MultiParamTypeClasses, PolyKinds, QuasiQuotes, RankNTypes #-} {-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, TemplateHaskell #-} {-# LANGUAGE TypeFam...
konn/reactive-objc
Messaging/Core.hs
Haskell
bsd-3-clause
2,309
{-# LANGUAGE OverloadedStrings #-} module OAuthHandlers ( routes ) where ------------------------------------------------------------------------------ import Control.Applicative import Control.Monad import Control.Monad.Trans import Data.ByteString (...
HaskellCNOrg/snaplet-oauth
example/src/OAuthHandlers.hs
Haskell
bsd-3-clause
4,350
module Math.Matrix where import Math.Vector import Data.List ( intercalate ) import Data.Maybe ( fromJust, fromMaybe ) import qualified Data.List as L type Matrix a = [Vector a] -- Projection Matrices orthoMatrix :: (Num t, Fractional t) => t -> t -> t -> t -> t -> t -> Matrix t ort...
schell/blocks
src/Math/Matrix.hs
Haskell
bsd-3-clause
6,213
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module VirtualDom.Prim where import Control.Applicative import Control.Lens import Control.Monad.State import Data.String (IsString(fromString)) import GHCJS.DOM.Event import GHCJS.Foreign import GHCJS.Types import System.IO.Unsafe import qualified ...
ocharles/virtual-dom
src/VirtualDom/Prim.hs
Haskell
bsd-3-clause
5,318
module Twitch.Run where import Prelude hiding (FilePath, log) import Twitch.Internal ( Dep, runDep ) import Twitch.InternalRule ( Config(dirs, logger), InternalRule, toInternalRule, setupRules ) import Twitch.Rule ( RuleIssue ) import Data.Either ( partitionEithers ) import System.FilePath ( FilePath ) import Syste...
jfischoff/twitch
src/Twitch/Run.hs
Haskell
mit
1,264
{-# LANGUAGE TemplateHaskell #-} module Chapter2.Section2.LabInteractive where import Prelude {- Ex 1: Which of the following implementations defines a function putStr' :: String -> IO () that takes a String as its parameter and writes it to the standard output? Note...
ltfschoen/HelloHaskell
src/Chapter2/Section2/LabInteractive.hs
Haskell
mit
17,861
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 @Uniques@ are used to distinguish entities in the compiler (@Ids@, @Classes@, etc.) from each other. Thus, @Uniques@ are the basic comparison key in the compiler. If there is any single operation that needs to be fast, i...
nushio3/ghc
compiler/basicTypes/Unique.hs
Haskell
bsd-3-clause
13,652
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Setup -- Copyright : Isaac Jones 2003-2004 -- Duncan Coutts 2007 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell...
randen/cabal
Cabal/Distribution/Simple/Setup.hs
Haskell
bsd-3-clause
89,397
{- (c) The University of Glasgow, 2000-2006 \section{Fast booleans} -} {-# LANGUAGE CPP, MagicHash #-} module Eta.Utils.FastBool ( --fastBool could be called bBox; isFastTrue, bUnbox; but they're not FastBool, fastBool, isFastTrue, fastOr, fastAnd ) where -- Import the beggars import GHC.Exts #ifdef DEBUG...
rahulmutt/ghcvm
compiler/Eta/Utils/FastBool.hs
Haskell
bsd-3-clause
1,846
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Bits -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICE...
alexander-at-github/eta
libraries/base/Data/Bits.hs
Haskell
bsd-3-clause
21,596
{-# LANGUAGE CPP #-} module ETA.Rename.RnSplice ( rnTopSpliceDecls, rnSpliceType, rnSpliceExpr, rnSplicePat, rnSpliceDecl, rnBracket, checkThLocalName ) where import ETA.BasicTypes.Name import ETA.BasicTypes.NameSet import ETA.HsSyn.HsSyn import ETA.BasicTypes.RdrName import ETA.TypeC...
alexander-at-github/eta
compiler/ETA/Rename/RnSplice.hs
Haskell
bsd-3-clause
24,906
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title>Дополнение Selenium</title> <maps> <homeID>top</homeID> <mapref location...
thc202/zap-extensions
addOns/selenium/src/main/javahelp/org/zaproxy/zap/extension/selenium/resources/help_ru_RU/helpset_ru_RU.hs
Haskell
apache-2.0
1,006
<?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="ar-SA"> <title>Retest Add-On</title> <maps> <homeID>retest</homeID> <mapref location="m...
thc202/zap-extensions
addOns/retest/src/main/javahelp/org/zaproxy/addon/retest/resources/help_ar_SA/helpset_ar_SA.hs
Haskell
apache-2.0
961
module T16804a where import Data.Monoid data Test = A | B deriving (Show) instance Monoid Test where mempty = A -- empty for linenumbers in T16804 to be correct -- empty for linenumbers in T16804 to be correct testFunction :: Test -> Test -> Bool testFunction A B = True testFunction B A = True testFunction _ _ =...
sdiehl/ghc
testsuite/tests/ghci/scripts/T16804a.hs
Haskell
bsd-3-clause
597
{- $Id: AFRPTestsRPSwitch.hs,v 1.2 2003/11/10 21:28:58 antony Exp $ ****************************************************************************** * A F R P * * * * Module:...
ony/Yampa-core
tests/AFRPTestsRPSwitch.hs
Haskell
bsd-3-clause
8,137
-- (c) 2000-2005 by Martin Erwig [see file COPYRIGHT] module Data.Graph.Inductive.Query.SP( spTree,spLength,sp, dijkstra ) where import qualified Data.Graph.Inductive.Internal.Heap as H import Data.Graph.Inductive.Graph import Data.Graph.Inductive.Internal.RootPath expand :: Real b => b -> LPath b -> Contex...
FranklinChen/hugs98-plus-Sep2006
packages/fgl/Data/Graph/Inductive/Query/SP.hs
Haskell
bsd-3-clause
1,114
import Test.Cabal.Prelude main = cabalTest $ do cabal "new-test" []
themoritz/cabal
cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.test.hs
Haskell
bsd-3-clause
73
----------------------------------------------------------------------------- -- | -- Module : XMonad.Doc.Developing -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 -- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : portable -- -- This module gives a brief o...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Doc/Developing.hs
Haskell
bsd-2-clause
11,768
{-| Code for setting up the RIO environment. -} module Urbit.King.App ( KingEnv , runKingEnvStderr , runKingEnvStderrRaw , runKingEnvLogFile , runKingEnvNoLog , kingEnvKillSignal , killKingActionL , onKillKingSigL , HostEnv , runHostEnv , PierEnv , runPierEnv , killPierActionL , onKillPi...
urbit/urbit
pkg/hs/urbit-king/lib/Urbit/King/App.hs
Haskell
mit
8,381
{-| Module : Test.Problem Description : The Test node for the Problem module Copyright : (c) Andrew Burnett 2014-2015 Maintainer : andyburnett88@gmail.com Stability : experimental Portability : Unknown Contains the node for the tests of the Problem module and its children -} module Test.Problem ( tests ...
aburnett88/HSat
tests-src/Test/Problem.hs
Haskell
mit
748
{-# LANGUAGE CPP #-} module GHCJS.DOM.DedicatedWorkerGlobalScope ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.DedicatedWorkerGlobalScope #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) im...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/DedicatedWorkerGlobalScope.hs
Haskell
mit
391
import Test.Hspec import qualified Jenkins.TypesSpec as TypesSpec main :: IO () main = hspec TypesSpec.test
afiore/jenkins-tty.hs
test/Suite.hs
Haskell
mit
109
{-# LANGUAGE BangPatterns #-} module LMisc (zipp, zipp4, tokens, tokens', in2out, rDoubleS , findWithRemainder ,differentiateBy,findWithAdjs , takeFirst, mtone3, subs, subsN, choose, force ,ascending,nppP , allPieces, nPieces, adjustMatrix , myMin ,...
rawlep/EQS
sourceCode/LMisc.hs
Haskell
mit
34,881
module GameTypes.ServerGame where import Net.Communication (open, accept, receive, send) import Net.Protocol (Message(..)) import Players.RemotePlayer (RemotePlayer(..)) import Players.LocalPlayer (LocalPlayer(..)) import Network.Socket (sClose) import System.IO import TicTacToe (Token(..)) -- close...
davidarnarsson/tictactoe
GameTypes/ServerGame.hs
Haskell
mit
1,187
module Util.PrettyPrint ( PrettyPrint(..) , Util.PrettyPrint.print , Out , pprName , nil , str , num , append , newline , indent , Util.PrettyPrint.concat , interleave ) where -- Data type for Output data Out = Str String | Newline | Indent Out | Nil | Append Out Out -- helpers ni...
tadeuzagallo/verve-lang
src/Util/PrettyPrint.hs
Haskell
mit
1,635
----------------------------------------------------------------------------- -- -- Module : TypeNum.TypeFunctions -- Copyright : -- License : MIT -- -- Maintainer : - -- Stability : -- Portability : -- -- | -- {-# LANGUAGE PolyKinds, ConstraintKinds #-} module TypeNum.TypeFunctions ( -- * Types eq...
fehu/TypeNumerics
src/TypeNum/TypeFunctions.hs
Haskell
mit
9,940
import Data.List (maximumBy) import MyLib (fact,numOfDgt) main = print $ answer 1000 answer n = sndmax (cycs n) -- sndmax [(2,0),(0,5),(3,1)]==(0,5) -- sndmax [(2,0),(0,2),(3,3)]==(3,3) sndmax :: Ord a => [(b,a)] -> (b,a) sndmax = maximumBy (\(x,y) (z,w)->compare y w) -- cycs 3 == [] cycs :: Integral a => a -> [(a,...
yuto-matsum/contest-util-hs
src/Euler/026.hs
Haskell
mit
1,181
module GHCJS.DOM.RTCIceCandidateEvent ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/RTCIceCandidateEvent.hs
Haskell
mit
50
---------------------------------------------------------------------------- ---- | ---- Module: ETL ---- Description: Transform scrabble scores from [(score: [letter])] map to ---- [(letter:score)] map ---- Copyright: (c) 2015 Alex Dzyoba <alex@dzyoba.com> ---- License: MIT -----------------------------...
dzeban/haskell-exercism
etl/ETL.hs
Haskell
mit
1,388
import Data.ByteString.Char8 (pack) import Crypto.Hash main = do let input = "vkjiggvb" result = compute input print result type Coord = (Int, Int) type Dir = Char type State = (Coord, [Dir], String) bounds :: Int bounds = 3 start :: Coord start = (0,0) initState :: St...
aBhallo/AoC2016
Day 17/day17part2.hs
Haskell
mit
1,805
module Solidran.Lexf.DetailSpec (spec) where import Test.Hspec import Solidran.Lexf.Detail spec :: Spec spec = do describe "Solidran.Lexf.Detail" $ do describe "getAlphabetStrings" $ do it "should return an empty list on empty alphabet" $ do getAlphabetStrings 2 [] ...
Jefffrey/Solidran
test/Solidran/Lexf/DetailSpec.hs
Haskell
mit
1,105
import State (Token(..), State(..), TransitionFunction(..), Transition(..), TransitionMap) import qualified NDFSM (NDFSM(..)) import NDFSM (NDFSM, NDState, exploreTransitions, flatten, tabulate, acceptsState, eps) import qualified FSM (FSM(..)) import FSM (FSM, mapTransitions, mapToFunc, accepts) import qualified Data....
wyager/NDFSMtoFSM
StateMachine.hs
Haskell
mit
1,601
{-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {-# OPTIONS_GHC -fno-warn-missing-methods #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE DataKinds ...
nickspinale/bigword
tests/Properties.hs
Haskell
mit
5,100
{-| Module : DataAssociation.Abstract Description : Rules mining abstractions. License : MIT Stability : development Rules mining abstractions. -} module DataAssociation.Abstract ( LargeItemsetsExtractor(..) , AssociationRulesGenerator(..) ) where import DataAssociation.Definitions import Data.Map...
fehu/min-dat--a-priori
core/src/DataAssociation/Abstract.hs
Haskell
mit
1,277
{-# OPTIONS_GHC -Wall #-} -- {-# LANGUAGE DatatypeContexts #-} module ApplicativeFunctors where -- import Prelude hiding (Maybe) -- import Data.Maybe hiding (Maybe) import Control.Applicative type Name = String data Employee = Employee { name :: Name , phone :: String } ...
harrisi/on-being-better
list-expansion/Haskell/Learning/ApplicativeFunctors.hs
Haskell
cc0-1.0
873
-- http://www.codewars.com/kata/52b757663a95b11b3d00062d module WeIrDStRiNgCaSe where import Data.Char import Data.List.Split toWeirdCase :: String -> String toWeirdCase = unwords . map weirdise . words where weirdise = concatMap f . chunksOf 2 f (x:xs) = toUpper x : map toLower xs
Bodigrim/katas
src/haskell/6-WeIrD-StRiNg-CaSe.hs
Haskell
bsd-2-clause
288
-- | Command line options. module Options ( -- * Options type Options(..) -- * Options parsing , options ) where import Control.Applicative import Options.Applicative -- | Data type for command options. data Options = Options { inputFile :: FilePath -- ^ File to be compi...
vituscze/norri
src/Options.hs
Haskell
bsd-3-clause
1,784
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} module Control.CP.FD.OvertonFD.Sugar ( ) where import Data.Set(Set) import qualified Data.Set as Set import Control.CP.Debug import Control.Mixin.Mixin import Control.CP.Solver import Control.CP.FD.FD import Control.CP.FD.SimpleFD import Data.Expr.Data ...
neothemachine/monadiccp
src/Control/CP/FD/OvertonFD/Sugar.hs
Haskell
bsd-3-clause
4,046
module Tests.WebTest (tests) where import Test.HUnit import qualified Data.DataHandler import qualified Service.ServiceHandler import qualified Configuration.Util import qualified Service.Users import qualified Web.WebHandler import qualified Web.WebHelper import Control.Monad.Trans.Resource import Data.ByteStrin...
stevechy/HaskellCakeStore
Tests/WebTest.hs
Haskell
bsd-3-clause
1,143
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program -- Copyright : Isaac Jones 2006, Duncan Coutts 2007-2009 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This provides an abstraction which deals with configu...
IreneKnapp/Faction
libfaction/Distribution/Simple/Program.hs
Haskell
bsd-3-clause
7,075
module PolyGraph.ReadOnly.DiGraph.Properties where import PolyGraph.ReadOnly (GMorphism(..), isValidGraphDataSet) import PolyGraph.ReadOnly.DiGraph (DiGraph, DiEdgeSemantics(..)) import PolyGraph.Common (OPair(..), PairLike(toPair)) import qualified Data.Maybe as M import qualified Data.Foldable as F isValidDiGraph ...
rpeszek/GraphPlay
src/PolyGraph/ReadOnly/DiGraph/Properties.hs
Haskell
bsd-3-clause
1,308
module WorkerClient where import Control.Monad import qualified Data.Aeson as A import Data.ByteString.Lazy.Char8 import Codec.Picture import qualified Network.WebSockets as WS import qualified Model as Model import Job import Message -- import WebSocketServe...
CBMM/CBaaS
cbaas-server/src/WorkerClient.hs
Haskell
bsd-3-clause
1,443
{-# language TemplateHaskell #-} module Phil.Core.Kinds.KindError where import Control.Lens import Data.Text (unpack) import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) import Phil.Core.AST.Identifier import Phil.Core.Kinds.Kind import Phil.ErrorMsg import Phil.Typecheck.Unification data KindError = KVarNotDefine...
LightAndLight/hindley-milner
src/Phil/Core/Kinds/KindError.hs
Haskell
bsd-3-clause
1,340
{-# LANGUAGE RankNTypes, NoMonomorphismRestriction, BangPatterns, DeriveDataTypeable, GADTs, ScopedTypeVariables, ExistentialQuantification, StandaloneDeriving #-} {-# OPTIONS -Wall #-} module Language.Hakaru.Metropolis where import System.Random (RandomGen, StdGen, randomR, getStdGen) import Data.Dynamic import...
zaxtax/hakaru-old
Language/Hakaru/Metropolis.hs
Haskell
bsd-3-clause
6,619
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE FlexibleContexts #-} module NetworkSim.LinkLayer ( -- * MAC module NetworkSim.LinkLayer.MAC -- * Link-layer exception , LinkException (..) -- * Ethernet Frame , Frame (..) , Payload () , OutFrame , Destination ...
prophet-on-that/network-sim
src/NetworkSim/LinkLayer.hs
Haskell
bsd-3-clause
8,672
{-# LANGUAGE OverloadedStrings , BangPatterns , ScopedTypeVariables #-} module RunTests where import Control.Exception import Data.Conduit import Data.List (foldl') import Data.Monoid ((<>)) import Data.Conduit.HDBI import Database.HDBI import Database.HDBI.SQlite import Test.Framework import Test.Framework.Provi...
s9gf4ult/hdbi-conduit
testsrc/runtests.hs
Haskell
bsd-3-clause
4,603
{-# LANGUAGE DeriveGeneric #-} module Real.Types (module Real.Types, Version(..)) where import GHC.Generics newtype InstalledPackageId = InstalledPackageId String deriving (Eq, Ord, Generic) newtype PackageName = PackageName String deriving (Eq, Ord, Generic) data Version = Version [Int] [String] derivi...
thoughtpolice/binary-serialise-cbor
bench/Real/Types.hs
Haskell
bsd-3-clause
13,470
module Paths_CipherSolver ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a cat...
abhinav-mehta/CipherSolver
dist/build/autogen/Paths_CipherSolver.hs
Haskell
bsd-3-clause
1,174
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, Rank2Types #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : Numeric.LinearAlgebra.Matrix.STBase -- Copyright : Copyright (c) 2010, Patrick Perry <patperry@gmail.com> -- License : BSD...
patperry/hs-linear-algebra
lib/Numeric/LinearAlgebra/Matrix/STBase.hs
Haskell
bsd-3-clause
41,765
module Parse.IParser where import Parse.Primitives (Parser) import Reporting.Error.Syntax (ParsecError) type IParser a = Parser ParsecError a
avh4/elm-format
elm-format-lib/src/Parse/IParser.hs
Haskell
bsd-3-clause
145
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RecordWildCards #-} module Node.T1w (T1w(..) ,rules) where import Node.Types import Node.Util (getPath, outdir, showKey) import Shake.BuildNode import ...
reckbo/ppl
pipeline-lib/Node/T1w.hs
Haskell
bsd-3-clause
939
-- | Tests for automatic deriving of ann method from Annotated type class. module Language.Java.Paragon.SyntaxSpec (main, spec) where import Test.Hspec import Language.Java.Paragon.Annotation import Language.Java.Paragon.Syntax -- | To be able to run this module from GHCi. main :: IO () main = hspec spec -- | Main ...
bvdelft/paragon
test/Language/Java/Paragon/SyntaxSpec.hs
Haskell
bsd-3-clause
919
{-# LANGUAGE QuasiQuotes, TypeFamilies, PackageImports #-} import Control.Arrow import "monads-tf" Control.Monad.State import "monads-tf" Control.Monad.Error import Data.Maybe import Data.Char import System.Environment import Text.Papillon type List = [List1] data List1 = Item String List deriving Show main :: IO ()...
YoshikuniJujo/markdown2svg
tests/testParser.hs
Haskell
bsd-3-clause
1,644
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TemplateHaskell #-} module DataLayer ( KeyValue (..) , insert , find ) where import Control.Monad.Reader import Control.Monad.State import Data.Acid import Data.SafeCopy import Data.Typeable impor...
wavelets/9m
src/DataLayer.hs
Haskell
bsd-3-clause
1,050
module Ribbon where import Rumpus -- Devin Chalmers remix start :: Start start = do parentID <- ask addActiveKnob "Total Speed" (Linear -5 5) 1 setClockSpeed rotSpeedKnob <- addKnob "Rot Speed" (Linear 0 5) 1 yScaleKnob <- addKnob "YScale" (Linear 0 10) 1 zScaleKnob <- addKnob "ZScale" (Li...
lukexi/rumpus
pristine/Ribbon/RibbonRemix.hs
Haskell
bsd-3-clause
989
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} module Karamaan.Opaleye.TableColspec where import Karamaan.Opaleye.Wire (Wire(Wire)) import Karamaan.Opaleye.QueryColspec (QueryColspec(QueryColspec), runWriterOfQueryColspec, runPackM...
dbp/karamaan-opaleye
Karamaan/Opaleye/TableColspec.hs
Haskell
bsd-3-clause
3,476
module Math.Simplicial.NeighborhoodGraph where import qualified Data.Vector.Unboxed as UV import qualified Data.Vector as BV import qualified Math.VectorSpaces.Metric as Met import qualified Math.Simplicial.LandmarkSelection as LS import qualified Math.Misc.Matrix as Mat import qualified Math.VectorSpaces.DistanceMatr...
michiexile/hplex
pershom/src/Math/Simplicial/NeighborhoodGraph.hs
Haskell
bsd-3-clause
2,787
{-# LANGUAGE CPP, GADTs #-} ----------------------------------------------------------------------------- -- -- Pretty-printing of Cmm as C, suitable for feeding gcc -- -- (c) The University of Glasgow 2004-2006 -- -- Print Cmm as real C, for -fvia-C -- -- See wiki:Commentary/Compiler/Backends/PprC -- -- This is simpl...
GaloisInc/halvm-ghc
compiler/cmm/PprC.hs
Haskell
bsd-3-clause
48,991
{-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ImplicitParams #-} {-# Language OverloadedStrings #-} {-# OPTIONS_GHC -Wall -fno-warn-unused-top-binds #-} import qualified Data.ByteString as BS import qualified Data.ByteString.UTF8 as BS8 import Data.Char (isSpace) import Data.List ...
GaloisInc/saw-script
crux-mir-comp/test/Test.hs
Haskell
bsd-3-clause
9,682
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Lib ( mainFunc, module ClassyPrelude, module Haskakafka ) where import Common import Config import Fortune import Kansha import Threading import Control.Lens import Data.Aeson import Data.Aeson.Lens import GHC.IO.Handle...
Koshroy/kokona
src/Lib.hs
Haskell
bsd-3-clause
5,671