code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad.Trans (lift) import qualified Data.Text as T import Data.Either import Reflex.Dom import Frontend.Function import Frontend.ImageWidget import Frontend.WebcamWidget main :: IO () main = mainWidget $ do d <- lift askDocument -- imageInputWid...
CBMM/CBaaS
cbaas-frontend/exec/Frontend.hs
bsd-3-clause
591
0
9
114
134
74
60
17
1
module Horbits.Body (bodyUiColor, getBody, fromBodyId, module X) where import Control.Lens hiding ((*~), _2, _3, _4) import Horbits.Body.Atmosphere as X import Horbits.Body.Body as X import Horbits.Body.Color as X import Horbits.Body.Data ...
chwthewke/horbits
src/horbits/Horbits/Body.hs
bsd-3-clause
790
0
7
224
232
135
97
19
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | All types. module HIndent.Types (Printer(..) ,PrintState(..) ,Extender(..) ,Style(..) ,Config(..) ,defaultConfig ,NodeInfo(..) ,ComInf...
adamse/hindent
src/HIndent/Types.hs
bsd-3-clause
4,328
0
15
1,009
841
507
334
-1
-1
module Graphics.Vty.Widgets.Builder.SrcHelpers ( defAttr , toAST , call , bind , tBind , noLoc , act , expr , mkTyp , parseType , mkList , parens , mkName , mkString , mkInt , mkChar , mkTup , opApp , mkLet , mkImportDecl , nameStr ...
jtdaugherty/vty-ui-builder
src/Graphics/Vty/Widgets/Builder/SrcHelpers.hs
bsd-3-clause
3,680
0
15
1,224
1,378
730
648
105
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE CPP #-} module Control.Distributed.Process.Serializable ( Serializable , encodeFingerprint , decodeFingerprint , fingerprint , sizeOfFingerprint , Fingerpri...
mboes/distributed-process
src/Control/Distributed/Process/Serializable.hs
bsd-3-clause
2,835
1
13
569
552
309
243
-1
-1
module Utils ( wordCount, makeBatch, accuracy ) where import Control.Arrow ( (&&&) ) import Data.List ( sort, group, reverse, nub ) import Control.Monad ( join ) wordCount :: (Eq a, Ord a) => [a] -> [(a, Int)] wordCount = map (head &&& length) . group . sort makeBatch :: Int -> [a] -> [[a]] makeBatch _...
masashi-y/dynet.hs
examples/utils/Utils.hs
bsd-3-clause
653
0
12
166
308
169
139
17
1
module Data.Aeson.TH.Extra where import Data.Aeson.TH ( defaultOptions , Options(..) ) import Data.String.Extra (dropL1) prefixRemovedOpts :: Int -> Options prefixRemovedOpts i = defaultOptions {fieldLabelModifier = dropL1 i}
onurzdg/clicklac
src/Data/Aeson/TH/Extra.hs
bsd-3-clause
260
0
7
56
65
40
25
7
1
{-#LANGUAGE FlexibleInstances #-} {-#LANGUAGE FlexibleContexts #-} {-#LANGUAGE LambdaCase #-} {-#LANGUAGE MultiParamTypeClasses #-} {-#LANGUAGE OverloadedStrings #-} {-#LANGUAGE Rank2Types #-} {-#LANGUAGE ScopedTypeVariables #-} module Twilio.Types ( APIVersion(..) , module X -- * Misc , makeTwilioRequest ...
seagreen/twilio-haskell
src/Twilio/Types.hs
bsd-3-clause
2,543
0
13
521
616
344
272
70
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} ------------------------------------------------------------------------------- -- | -- Module : Database.Bloodhound.Types.Internal -- Copyrigh...
bermanjosh/bloodhound
src/Database/V5/Bloodhound/Types/Internal.hs
bsd-3-clause
2,168
0
10
522
253
156
97
23
0
{- Problem 30 Numbers that can be written as powers of their digits Result 443839 6.28 s Comment The upper boundary can be estimated since 999... = 10^k - 1 has to be equal to 9^5 + 9^5 + ... = k 9^5, which yields the maximum co...
quchen/HaskellEuler
src/Problem30.hs
bsd-3-clause
990
0
9
278
198
102
96
15
1
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} #ifdef DEFAULT_SIGNATURES {-# LANGUAGE DefaultSignatures #-} #endif #if...
np/lens
src/Control/Lens/At.hs
bsd-3-clause
10,918
0
16
2,571
4,050
2,236
1,814
211
1
module Parser ()where import Text.XML.HXT.Core import Data.String.UTF8 import Control.Monad odd :: (->) Int Bool odd a = True css tag = multi (hasName tag) testDoc = do html <- readFile "test.html" let doc = readString [withParseHTML yes, withWarnings no] html texts <- runX $ doc //> getText mapM_ pu...
Numberartificial/workflow
snipets/src/Demo/Parser.hs
mit
525
0
12
108
201
98
103
18
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : IDE.OSX -- Copyright : (c) Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GNU-GPL -- -- Maintainer : <maintainer at leksah.org> -- Stability : ...
jaccokrijnen/leksah
src/IDE/OSX.hs
gpl-2.0
2,447
0
17
601
429
222
207
18
1
module RSA.Break where import RSA.Break.Data import RSA.Euclid import Faktor.Prim import Faktor.Certify ( powmod ) import Data.Typeable import Challenger.Partial import Autolib.ToDoc import Autolib.Reporter import Autolib.Ana import Inter.Types data RSA_Code_Break = RSA_Code_Break deriving ( Read, Show, Typeable )...
florianpilz/autotool
src/RSA/Break.hs
gpl-2.0
1,487
41
9
383
515
276
239
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Dependency.Types -- Copyright : (c) Duncan Coutts 2008 -- License : BSD-like -- -- Maintainer : [email protected] -- Stability : provisional -- Portability : portable -- -- Common...
jwiegley/ghc-release
libraries/Cabal/cabal-install/Distribution/Client/Dependency/Types.hs
gpl-3.0
7,142
0
14
1,625
1,129
659
470
105
3
import Control.Monad import Control.Monad.Trans.Resource import System.IO import System.Exit import System.Environment import Data.Conduit import qualified Data.Conduit.List as CL import qualified Data.Conduit.Binary as CB import qualified Data.ByteString.Char8 as BS import Data.Conduit.ZMQ3 (zmqSource) import Syste...
rgrinberg/zeromq3-conduit
examples/display.hs
lgpl-2.1
800
1
13
165
247
132
115
24
1
{-# LANGUAGE CPP #-} module Graphics.ImageMagick.MagickWand.PixelWand ( pixelWand -- , clearPixelWand -- , cloneWand -- , cloneWands , isPixelWandSimilar -- , isPixelWand , setColorCount, getColorCount -- ** Literal names , setColor , getColorAsString, getColorAsNormalizedString -- HSL , get...
flowbox-public/imagemagick
Graphics/ImageMagick/MagickWand/PixelWand.hs
apache-2.0
9,048
0
17
1,773
2,945
1,593
1,352
159
1
module Main where import CLI.Main (runCLI) import Data.Version (showVersion) import Paths_gtfsschedule (version) programHeader :: String programHeader = "gtfsschedule - Be on time for your next public transport service (v. " ++ showVersion version ++ ")" main :: IO () main = runCLI programHeader "Shows schedule...
romanofski/gtfsbrisbane
app/Main.hs
bsd-3-clause
371
0
7
61
73
41
32
9
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} module Test.Foundation.String ( testStringRefs ) where -- import Control.Monad (replicateM) import Foundation import Foundati...
vincenthz/hs-foundation
foundation/tests/Test/Foundation/String.hs
bsd-3-clause
8,790
0
18
2,644
955
489
466
69
2
{-# LANGUAGE OverloadedStrings #-} module Web.Server ( runServer , formalizerApp -- Exposed for testing. ) where import Network.Wai.Middleware.RequestLogger import Network.Wai.Middleware.Static import Web.Actions as Action import Web.Spock.S...
Lepovirta/Crystallize
app/Web/Server.hs
bsd-3-clause
1,172
0
11
288
248
131
117
28
1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1998 This module contains definitions for the IdInfo for things that have a standard form, namely: - data constructors - record selectors - method and superclass selectors - primitive operations -} {-# LANGUAGE CPP #-} module MkId ( ...
vTurbine/ghc
compiler/basicTypes/MkId.hs
bsd-3-clause
59,709
0
21
16,498
7,361
4,015
3,346
600
6
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following condit...
leshchevds/ganeti
test/hs/Test/Ganeti/HTools/Instance.hs
bsd-2-clause
9,291
0
15
2,096
2,118
1,107
1,011
166
2
module Compiler.Simplify where import Data.Generics.PlateData import Compiler.Type import Data.List import Data.Maybe simplify :: Program1 -> Program2 simplify = addDollar . reform . freezeRules -- change rule application rule(arg) to rule_arg and replace all bits freezeRules :: Program1 -> Program1 freezeRules xs...
silkapp/tagsoup
dead/parser/Compiler/old/Simplify.hs
bsd-3-clause
2,095
0
16
624
903
458
445
42
3
-- ---------------------------------------------------------------------------- -- | Handle conversion of CmmData to LLVM code. -- module LlvmCodeGen.Data ( genLlvmData, resolveLlvmDatas, resolveLlvmData ) where #include "HsVersions.h" import Llvm import LlvmCodeGen.Base import BlockId import CLabel imp...
nomeata/ghc
compiler/llvmGen/LlvmCodeGen/Data.hs
bsd-3-clause
6,479
0
17
1,559
1,652
892
760
103
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Blackbox.Tests ( tests , remove , removeDir ) where ------------------------------------------------------------------------------ import Control.Exception (catch, finally, throwIO) import Control...
sopvop/snap
test/suite/Blackbox/Tests.hs
bsd-3-clause
12,605
0
18
3,358
2,023
1,054
969
217
2
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, TypeFamilies , TypeApplications, TypeInType #-} module DumpParsedAst where import Data.Kind data Peano = Zero | Succ Peano type family Length (as :: [k]) :: Peano where Length (a : as) = Succ (Length as) Length '[] = Zero -- vis kind app data T...
sdiehl/ghc
testsuite/tests/parser/should_compile/DumpParsedAst.hs
bsd-3-clause
456
2
8
114
159
93
66
-1
-1
module HLint.Generalise where import Data.Monoid import Control.Monad warn = concatMap ==> (=<<) warn = liftM ==> fmap warn = map ==> fmap warn = a ++ b ==> a `Data.Monoid.mappend` b
bergmark/hlint
data/Generalise.hs
bsd-3-clause
186
0
7
34
67
40
27
7
1
-- https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-frameworks/randoms import System.Random import Control.Monad (replicateM) main = replicateM 10 (randomIO :: IO Float) >>= print
junnf/Functional-Programming
codes/random.hs
unlicense
202
1
8
18
43
22
21
3
1
module Type where newtype TVar = TV String deriving (Show, Eq, Ord) data Type = TVar TVar | TCon String | TArr Type Type deriving (Show, Eq, Ord) infixr `TArr` data Scheme = Forall [TVar] Type deriving (Show, Eq, Ord) typeInt :: Type typeInt = TCon "Int" typeBool :: Type typeBool = TCon "Bool"
yupferris/write-you-a-haskell
chapter7/poly/src/Type.hs
mit
314
0
7
73
123
70
53
15
1
<?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>Passive Scan Rules - Alpha | ZAP Extension</title> <maps> <homeID>top</homeID...
kingthorin/zap-extensions
addOns/pscanrulesAlpha/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesAlpha/resources/help_az_AZ/helpset_az_AZ.hs
apache-2.0
988
83
53
162
403
212
191
-1
-1
module A1 where import D1 (sumSquares, fringe) import D1 import C1 import B1 main :: (Tree Int) -> Bool main t = isSame (sumSquares (fringe t)) ((sumSquares (B1.myFringe t)) + (sumSquares (C1.myFringe t)))
SAdams601/HaRe
old/testing/mkImpExplicit/A1_AstOut.hs
bsd-3-clause
234
4
12
61
103
56
47
10
1
-- | Register coalescing. module RegAlloc.Graph.Coalesce ( regCoalesce, slurpJoinMovs ) where import GhcPrelude import RegAlloc.Liveness import Instruction import Reg import Cmm import Bag import Digraph import UniqFM import UniqSet import UniqSupply import Data.List -- | Do register coalescing on ...
ezyang/ghc
compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
bsd-3-clause
2,760
0
14
903
565
288
277
57
3
module Existential where -- Hmm, this is universal quantification, not existential. data U = U (forall a . (a,a->Int,Int->a,a->a->a)) -- This is existential quantification data E = forall a . {-Eq a =>-} E (a,a->Int,Int->a,a->a->a) e = E (1,id,id,(+)) -- OK: f (E (x,toint,fromint,op)) = toint (x `op` x) -- Error: ...
forste/haReFork
tools/base/tests/Existential.hs
bsd-3-clause
682
0
11
112
162
100
62
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.Builtin -- Copyright : Isaac Jones 2006, Duncan Coutts 2007-2009 -- -- Maintainer : [email protected] -- Portability : portable -- -- The module defines all the known built-in 'Pr...
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Program/Builtin.hs
bsd-3-clause
10,350
0
17
2,525
1,912
1,094
818
205
2
module T7848 where data A = (:&&) Int Int | A Int Int x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h) = y where infixl 3 `y` y _ = (&) {-# INLINE (&) #-} {-# SPECIALIZE (&) :: a #-} (&) = x
gridaphobe/ghc
testsuite/tests/parser/should_fail/T7848.hs
bsd-3-clause
233
8
7
88
122
71
51
8
1
module Main where main = putStrLn $ s ++ show s where s = "module Main where\n\nmain = putStrLn $ s ++ show s\n where s = "
HalosGhost/hs
intro/quine.hs
isc
134
0
6
38
27
15
12
3
1
module Test.Scher.Property ( forAll , Property (verify) ) where import Test.Scher.Generic import Test.Scher.Symbolic import System.IO.Unsafe import System.Random import Data.IORef class Property b where verify :: b -> IO () instance Property Bool where verify b = assert b forAll :: (Symbolic a, Property...
m-alvarez/scher
Test/Scher/Property.hs
mit
858
0
10
202
366
189
177
32
1
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} module Web.Mackerel.Types.Host where import Control.Applicative ((<|>)) import Data.Aeson import qualified Data.Aeson as Aeson import Data.Aeson.TH (deriveJSON, constructorTagModifier, fieldLabelModifier) import Data.Aeson.Types (Parser, typeMismatch) import Data.Cha...
itchyny/mackerel-client-hs
src/Web/Mackerel/Types/Host.hs
mit
5,116
0
23
1,042
1,593
878
715
122
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Game where import Data.Monoid ((<>)) import Control.Concurrent (MVar, newEmptyMVar, putMVar) import Control.Monad.State import qualified Data.ByteString.Char8 as B import Data.Char (toLower) import Data.Maybe (listToMaybe) import System.Rando...
shak-mar/botstrats
server/Game.hs
mit
4,115
0
17
1,009
1,469
781
688
95
5
module Banjo where areYouPlayingBanjo :: String -> String areYouPlayingBanjo name@('R':xs) = name ++ " plays banjo" areYouPlayingBanjo name@('r':xs) = name ++ " plays banjo" areYouPlayingBanjo name = name ++ " does not play banjo"
dzeban/haskell-exercises
Banjo.hs
mit
232
0
8
35
69
38
31
5
1
{-# LANGUAGE ExistentialQuantification, Rank2Types #-} module Control.Monad.Trans.Store where import qualified Data.Map as M import Control.Monad import Control.Monad.Hoist import Control.Monad.Trans -- The semantics of store should be that it continues as soon as the reference -- has been calculated, but that the ...
DanielWaterworth/siege
src/Control/Monad/Trans/Store.hs
mit
2,617
0
23
774
1,178
570
608
66
4
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} module Main where import Text.XML.HXT.Core main = do runX (readDocument [ withValidate no, withParseHTML yes, withInputEncoding utf8 ] "" >>> processChildren (process1 `when` isElem) >>> writeDocument [] "-" ) process1 :: ArrowXml a => ...
danchoi/hxt-nav
Main.hs
mit
1,011
0
16
305
236
122
114
21
1
main = print $ (foldl1 cross $ map (`map` [1..]) [t, p, h]) !! 2 t n = n * ( n + 1) `div` 2 p n = n * (3 * n - 1) `div` 2 h n = n * (2 * n - 1) -- Lazily intersects ordered lists cross a@(x:xs) b@(y:ys) | x > y = cross a ys | x < y = cross xs b | otherwise = x : cross xs ys
nickspinale/euler
complete/045.hs
mit
293
0
11
98
206
109
97
8
1
module Azure.BlobStorage.Util where import qualified Blaze.ByteString.Builder as Builder import Control.Applicative import Control.Monad.Reader hiding (forM) import Data.ByteString (ByteString) import qualified Data.ByteString as BS import qualified Data.ByteString.Base64 as Base64 import...
fpco/schoolofhaskell.com
src/Azure/BlobStorage/Util.hs
mit
2,517
0
22
608
684
372
312
54
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} module Ch15.SupplyClass ( S.Supply , S.runSupply , S.runRandomSupply , MonadSupply (..) ) wher...
futtetennista/IntroductionToFunctionalProgramming
RWH/src/ch15/SupplyClass.hs
mit
677
2
11
228
193
104
89
17
1
module Main where import Data.List import Light.Cameras import Light.Film import Light.Filters import Light.Geometry f :: Film f = film (16, 12) (boxFilter (1, 1)) p1, p2 :: PerspectiveCamera p1 = perspectiveCamera f (pi/3) p2 = perspectiveCamera f (pi/2) o :: OrthographicCamera o = orthographicCamera f 1 getRays...
jtdubs/Light
src/App/CameraDiagrams.hs
mit
3,326
0
15
866
1,239
618
621
65
1
{-# LANGUAGE OverloadedStrings #-} module Day13 (day13, day13', run) where import Data.Attoparsec.Text ( Parser(..) , char , decimal , endOfLine , isHorizontalSpace , many' , option , parseOnly , string , takeTill ) import Data.Function (on) import Data.List (groupBy, nub, s...
brianshourd/adventOfCode2015
src/Day13.hs
mit
3,167
0
15
731
1,153
604
549
90
3
module U.Util.Components where import qualified Data.Graph as Graph import qualified Data.Map as Map import qualified Data.Set as Set import Data.Set (Set) import Data.Maybe (fromMaybe) -- | Order bindings by dependencies and group into components. -- Each component consists of > 1 bindings, each of which depends -- ...
unisonweb/platform
codebase2/util/U/Util/Components.hs
mit
1,739
0
14
386
326
193
133
16
1
{-# LANGUAGE DeriveGeneric #-} -- Object.hs; Mun Hon Cheong ([email protected]) 2005 module Object ( Object, ObjInput(..), ObjOutput(..), ObsObjState(..), Message(..), isRay, -- :: ObsObjState -> Bool isAICube, -- :: ObsObjState -> Bool isProjectile, -- :: ObsObjS...
pushkinma/frag
src/Object.hs
gpl-2.0
3,377
0
14
1,156
804
479
325
160
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Reffit.User where import Data.Aeson import Data.SafeCopy (Migrate, MigrateFrom, base, deriveSafeCopy, extension...
imalsogreg/reffit
src/Reffit/User.hs
gpl-3.0
3,518
0
10
1,169
619
331
288
57
0
-- BNF Converter: Error Monad -- Copyright (C) 2004 Author: Aarne Ranta -- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. module Dict.ErrM where -- the Error monad: like Maybe type with error msgs import Control.Monad (MonadPlus(..), liftM) data Err a = Ok a | Bad String deriving (Read, Show,...
isido/functional-morphology-for-koine-greek
lib/Dict/ErrM.hs
gpl-3.0
580
0
8
153
168
90
78
15
0
module Main where import System.Environment import Control.Monad displayLines :: String -> IO () displayLines fn = do content <- readFile fn let fLines = lines content forM_ fLines putStrLn displayFiles :: [String] -> IO () displayFiles [] = return () displayFiles xs = forM_ xs displayLines main = do args <- ge...
aauger/HaskellCoreUtils
HaskellCoreUtils/src/cat.hs
gpl-3.0
427
0
10
80
150
72
78
16
2
module German where import Data.Char import Language data Case = Nom | Acc | Dat | Gen deriving (Show, Eq) instance Language.Case German.Case data AdjectiveInflection = Strong | Mixed | Weak deriving Eq nom, acc, dat, gen :: NounPhrase German.Case -> [String] [nom, acc, dat, gen] = map applyCase [Nom, Acc, Dat, Ge...
Fedjmike/ngen
german.hs
gpl-3.0
6,865
0
16
1,796
2,086
1,145
941
130
13
module Sara.TestUtils.TestUtils where import Sara.Reporter nopReporter :: Reporter nopReporter = Reporter nop nop nop where nop :: a -> IO () nop _ = return ()
Lykos/Sara
tests/Sara/TestUtils/TestUtils.hs
gpl-3.0
172
0
9
38
58
31
27
6
1
module Figure where import Graphics.Rendering.Plot makePlot :: Figure () -> FilePath -> IO () makePlot fig filename = writeFigure SVG filename (1200, 800) fig createMatrixFigure :: Dataset a => a -> Figure () createMatrixFigure m = do setPlots 1 1 withPlot (1,1) $ do setDataset m addAxis XAxis (Side...
Toeplitz/haskell
Figure.hs
gpl-3.0
1,043
0
14
209
199
100
99
13
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Numerical.PETSc.Internal.Class.RealVectorSpace -- Copyright : (c) Marco Zocca 2015 -- License : LGP...
ocramz/petsc-hs
src/Numerical/PETSc/Internal/Class/RealVectorSpace.hs
gpl-3.0
4,591
0
9
1,044
579
335
244
45
1
module PropT07 where import Prelude(Bool(..)) import Zeno -- Definitions True && x = x _ && _ = False False || x = x _ || _ = True not True = False not False = True -- Nats data Nat = S Nat | Z (+) :: Nat -> Nat -> Nat Z + y = y (S x) + y = S (x + y) (*) :: Nat -> Nat -> Nat Z * _ = Z (S x) * y = y + (x...
danr/hipspec
testsuite/prod/zeno_version/PropT07.hs
gpl-3.0
2,990
0
11
921
2,010
1,045
965
114
2
{- Chapter 4 -} maximum' :: (Ord a) => [a] -> a maximum' [] = error "maximum of empty list!" maximum' [x] = x maximum' (x:xs) = max x (maximum' xs) replicate' :: Int -> a -> [a] replicate' n x | n <= 0 = [] | otherwise = x : replicate' (n-1) x take' :: (Num i, Ord i) => i -> [a] -> [a] take' n _ | n <...
medik/lang-hack
Haskell/LearnYouAHaskell/c04/chapter4.hs
gpl-3.0
688
2
8
200
460
241
219
25
1
module Main where import SLParser import Text.Parsec import VCGenerator import Z3.Monad import Data.List main :: IO () main = do input <- getContents let res = parse parseSL "" input either print (\x -> putStrLn "AST:" >> print x >> putStrLn "" >> do (w,res) <- evalZ3 (script x) ...
jbddc/vf-verifier
src/Main.hs
gpl-3.0
1,126
0
27
285
502
255
247
26
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/UserRoles/Insert.hs
mpl-2.0
3,221
0
14
741
406
242
164
63
1
{-# LANGUAGE UnicodeSyntax, Rank2Types #-} module Graphics.Gloss.Interface.FRP.Sodium (playSodium, InputEvent) where import Graphics.Gloss import Graphics.Gloss.Interface.IO.Game (playIO) import qualified Graphics.Gloss.Interface.IO.Game as G import FRP.Sodium import Control.Monad (void) -- | A useful type synonym f...
Twey/gloss-sodium
Graphics/Gloss/Interface/FRP/Sodium.hs
agpl-3.0
1,679
0
16
432
336
187
149
27
1
import ViperVM.Platform import ViperVM.Platform.Logger import ViperVM.Platform.TransferResult import ViperVM.Platform.LinkCapabilities import ViperVM.Platform.RegionTransferManager import ViperVM.Platform.RegionLockManager import ViperVM.Platform.BufferManager (createBufferManager) import Control.Monad import Text.Pri...
hsyl20/HViperVM
apps/RegionTransferManagerTest.hs
lgpl-3.0
4,192
0
20
1,201
1,109
523
586
91
8
{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable #-} -- | Virtual machines control module THIS.Hypervisor (runVM, shutdownVM ) where import Control.Monad import Control.Exception as E import Control.Concurrent import Data.Object import Data.Time import System.LibVirt as V import THIS.Types import THIS.Yaml...
portnov/integration-server
THIS/Hypervisor.hs
lgpl-3.0
2,607
0
23
960
747
350
397
69
8
{- - This file is part of Bilder. - - Bilder is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Bilder i...
ingemaradahl/bilder
src/Compiler/Simple/ToGLSL.hs
lgpl-3.0
7,285
0
12
1,223
3,074
1,531
1,543
135
2
k = 1000000007 ans m 0 = 1 ans m 1 = m ans m n = let n' = n `div` 2 x = ans m n' y = ans m (n-2*n') in (x * x * y) `mod` k main = do l <- getLine let (m:n:_) = map read $ words l :: [Integer] o = ans m n print o
a143753/AOJ
NTL_1_B.hs
apache-2.0
249
1
12
101
172
84
88
13
1
import Prelude data Tree a = Node (Tree a) a (Tree a) | Empty deriving Show areTreesEqual :: Tree Int -> Tree Int -> Bool areTreesEqual Empty Empty = True areTreesEqual Empty _ = False areTreesEqual _ Empty = False areTreesEqual (Node leftTree1 a rightTree1) (Node leftTree2 b rightTree2) =...
omefire/HaskellProjects
areTreesEqual.hs
apache-2.0
1,047
0
15
297
455
223
232
29
2
module Explession where level:: Int -> String -> Int level lv (head:tail) | head == '(' && lv >= 0 = level (lv + 1) tail | head == ')' && lv >= 0 = level (lv - 1) tail | otherwise = lv level lv ([]) = lv {- - Checks whether an expression contains a balanced amount of br...
art4ul/HaskellSandbox
Expression.hs
apache-2.0
574
0
12
172
180
92
88
9
1
module Data.Binary.Get.Machine where import Data.ByteString (ByteString) import Data.Binary.Get (Decoder(..), Get, pushChunk, runGetIncremental) import Data.Machine (MachineT(..), ProcessT, Step(Await, Yield), Is(Refl), stopped) processGet :: Monad m => Get a -> ProcessT m ByteString a processGet getA = processDecode...
aloiscochard/thinkgear
src/Data/Binary/Get/Machine.hs
apache-2.0
645
0
11
119
225
122
103
11
2
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QAbstractTextDocumentLayout.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:18 Warning : this file is machine ...
keera-studios/hsQt
Qtc/Gui/QAbstractTextDocumentLayout.hs
bsd-2-clause
28,773
0
18
3,961
7,795
3,973
3,822
-1
-1
{-# LANGUAGE BangPatterns #-} import Control.Concurrent.STM as S import qualified STMContainers.Map as TMap import qualified ListT as LT import qualified Data.ByteString.Char8 as L import Control.Monad import Debug.Trace import System.Random import Control...
lolepezy/rpki-pub-server
test/changeLog/changeLogList.hs
bsd-2-clause
2,612
107
10
729
807
437
370
61
3
{-# LANGUAGE RecordWildCards #-} -- | A map from hashable keys to values. module Data.DAWG.Gen.HashMap ( Hash (..) , HashMap (..) , empty , lookup , insertUnsafe , lookupUnsafe , deleteUnsafe ) where import Prelude hiding (lookup) -- import Control.Applicative ((<$>), (<*>)) -- import Data.Binary (Binary, Get, pu...
kawu/dawg-ord
src/Data/DAWG/Gen/HashMap.hs
bsd-2-clause
4,762
0
13
1,141
1,197
631
566
77
2
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following condit...
ganeti-github-testing/ganeti-test-1
test/hs/Test/Ganeti/OpCodes.hs
bsd-2-clause
33,826
0
55
10,176
5,802
2,918
2,884
573
2
-- 228 import Data.List(sort) import Euler(splitOn) parseTris [] = [] parseTris (x:xs) = t : parseTris xs where xy = map read $ splitOn ',' x t = sort $ zipWith toTheta (map (xy!!) [0,2,4]) (map (xy!!) [1,3,5]) toTheta a b = atan2 b a containsOrigin xs | length xs /= 3 = error "containsOri...
higgsd/euler
hs/102.hs
bsd-2-clause
658
4
11
173
327
168
159
17
1
{-# LANGUAGE OverloadedStrings #-} module Appoint.Users where import Control.Lens import Control.Monad.Reader import Data.Monoid ((<>)) import Appoint.Types.Config import Appoint.Types.Users (User(..), Collaborators(..)) import qualified Data.Text as T import qualified Data.Vector as V import qualified GitHub.Data as G...
rob-b/appoint
src/Appoint/Users.hs
bsd-3-clause
1,168
0
11
193
339
193
146
35
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} module Futhark.Pass.ExtractKernels.BlockedKernel ( blockedReduction , blockedReductionStream , blockedMap , blockedScan , blockedSegmentedScan , blockedKernelSize , chunkLambda , mapKernel , ...
mrakgr/futhark
src/Futhark/Pass/ExtractKernels/BlockedKernel.hs
bsd-3-clause
24,449
1
25
6,697
7,123
3,504
3,619
481
2
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses #-} module Data.Number.LogFloat.Vector () where import Data.Number.LogFloat import Data.Vector.Unboxed import Control.Monad import qualified Data.Vector.Unboxed.Base import qualified Data.Vector.Generic.Mutable as M import qualified Data.Vector.Generic as G newtype ...
bgamari/logfloat-unboxed
Data/Number/LogFloat/Vector.hs
bsd-3-clause
2,503
0
9
390
662
350
312
49
0
module Handler.CampaignNew where import Import import Import.Premium (hasPremium) import Import.Semantic (renderSemantic) campaignForm :: UserId -> Form Campaign campaignForm user = renderSemantic $ Campaign <$> areq textField "Name" Nothing <*> pure user getCampaignNewR :: Handler...
sulami/hGM
Handler/CampaignNew.hs
bsd-3-clause
1,210
0
15
278
343
161
182
34
2
module Forum.Internal (module X) where import Forum.Internal.SQL as X import Forum.Internal.Class as X import Forum.Internal.Types as X import Forum.Internal.Decoding as X
turingjump/forum
src/Forum/Internal.hs
bsd-3-clause
173
0
4
22
44
32
12
5
0
{- | Copyright : 2014 Tomáš Musil License : BSD-3 Stability : experimental Portability : portable Nearest Neighbour heuristic for TSP. -} module Problems.TSP.NN ( optimize ) where import Control.Arrow --import Data.List.Stream --import Prelude hiding ((++), lines, map, minimum, splitAt, sum, repeat, t...
tomasmcz/discrete-opt
src/Problems/TSP/NN.hs
bsd-3-clause
1,320
0
14
254
421
223
198
20
1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell import Language.Haskell.Liquid.Prelude foo x y | compare x y == EQ = liquidAssertB (x == y) | compare x y == LT = liquidAssertB (x < y) | compare x y == GT = liquidAssertB (x > y) prop = foo n m where n = choose 0 m = choose 1
spinda/liquidhaskell
tests/gsoc15/unknown/pos/compare1.hs
bsd-3-clause
299
1
9
80
137
66
71
10
1
{-| Module : Werewolf.Command.Unvote Description : Handler for the unvote subcommand. Copyright : (c) Henry J. Wylde, 2016 License : BSD3 Maintainer : [email protected] Handler for the unvote subcommand. -} module Werewolf.Command.Unvote ( -- * Handle handle, ) where import Control.Lens import ...
hjwylde/werewolf
app/Werewolf/Command/Unvote.hs
bsd-3-clause
1,584
0
15
351
357
195
162
30
4
module Main where import MixedTypesNumPrelude -- import qualified Prelude as P -- import Control.Applicative (liftA2) import System.Environment import AERN2.MP -- import qualified AERN2.MP.Ball as MPBall import AERN2.Poly.Cheb import AERN2.Poly.Cheb.Maximum import AERN2.Poly.Cheb.MaxNaive import qualified AERN2.Lo...
michalkonecny/aern2
aern2-fnreps/main/waac-benchmarks.hs
bsd-3-clause
3,999
0
32
1,340
1,730
876
854
94
17
module Data.Symbol.UnitTest(tests) where import Data.Symbol import Test.HUnit tests = TestList [ "name (symbol i s) = s" ~: "s" ~?= (name (symbol 1 "s")), "(symbol 1 s) == (symbol 1 s)" ~: assertBool "" ((symbol 1 "s") == (symbol 1 "s")), "unused == unused" ~: assertBool "" (unused == unused), "(symbol 1 ...
emc2/proglang-util
Data/Symbol/UnitTest.hs
bsd-3-clause
937
0
12
224
347
182
165
23
1
module M06MultipleChildren where import Rumpus {- You can call spawnChild as many times as you like. Let's create a field of dreams: ``` -} start :: Start start = do forM_ [0..99] $ \i -> do let x = (fromIntegral (i `mod` 10) - 5) * 0.1 z = (fromIntegral (i `div` 10) - 5) * 0.1 ...
lukexi/rumpus
pristine/Coding Guide/M06MultipleChildren.hs
bsd-3-clause
759
0
23
320
250
125
125
17
1
module Main where import Language main :: IO () main = putStr $ unlines [show vs ++ " -> " ++ show (interpret peg time_env) | (vs, time_env) <- iterations labels] where (labels, peg) = figure_3_c iterations [] = [([], emptyTimeEnv)] iterations (l:ls) = do v <- [0..10...
batterseapower/pegs
Main.hs
bsd-3-clause
1,529
0
12
529
799
438
361
50
2
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Main where import Control.Applicative import Control.Monad.Loops import Control.Monad.State.Strict import qualified Data.Attoparsec.Char8 as A import qualified Data.ByteString.Char8 as B import Data.List.Zipper import System.Environment newtype BF a = BF { unBF :: S...
tanakh/brainfuck
main.hs
bsd-3-clause
1,182
0
23
241
518
264
254
30
2
{-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Forum.Internal.Decoding where import Bookkeeper import Hasql.Class (Decodable(decode)) import Hasql.Decoders (Row) import Data.Proxy instance (All Decodable entries) => Decodable (Book' Identity entries) where decode = decodeBook de...
turingjump/forum
src/Forum/Internal/Decoding.hs
bsd-3-clause
560
0
9
85
155
84
71
-1
-1
{-# LANGUAGE TupleSections #-} module KMeans ( Point , Cluster , localKMeans , distrKMeans , createGnuPlot , __remoteTable ) where import System.IO import Data.List (minimumBy) import Data.Function (on) import Data.Array (Array, (!), bounds) import qualified Data.Map as Map (fromList, elems, toList, size...
haskell-distributed/distributed-process-demos
src/MapReduce/KMeans.hs
bsd-3-clause
4,139
0
15
1,102
1,575
864
711
-1
-1
{-# LANGUAGE CPP #-} -- | This module reexports the six necessary type classes that every 'Rule' type must support. -- You can use this module to define new rules without depending on the @binary@, @deepseq@ and @hashable@ packages. module Development.Shake.Classes( Show(..), Typeable(..), Eq(..), Hashable(..), ...
nh2/shake
Development/Shake/Classes.hs
bsd-3-clause
440
0
5
69
74
51
23
7
0
module Methods where import qualified Data.ByteString.Lazy.Char8 as C import qualified Data.ByteString.Lazy as L import Data.List import System.IO import Data.Word import Data.Binary.Get import Data.Int import Memory assure :: Maybe a -> a assure (Just a) = a assure _ = error "Error: can't convert Nothing to v...
skill-lang/skill
deps/haskell/Methods.hs
bsd-3-clause
8,340
0
18
2,260
3,389
1,768
1,621
156
7
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TemplateHaskell #-} {-# ...
tomberek/RETE
src/RETE/Lib4.hs
bsd-3-clause
11,486
0
21
2,930
5,111
2,677
2,434
-1
-1
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -- {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Flexible...
reuleaux/pire
src/Pire/Syntax/Expr.hs
bsd-3-clause
48,148
2
19
15,487
13,010
6,705
6,305
516
23
{-| Module : Graphics.Sudbury.Protocol.Runtime Description : Protocol data without docs: can project XML protocols to runtime protocols Copyright : (c) Auke Booij, 2015-2017 License : MIT Maintainer : [email protected] Stability : experimental Portability : POSIX -} module Graphics.Sudbury.Protocol.Runtime ...
abooij/sudbury
Graphics/Sudbury/Protocol/Runtime.hs
mit
326
0
3
53
9
7
2
1
0
------------------------------------------------------------------------- -- -- MakeTree.hs -- -- Turn a frequency table into a Huffman tree -- -- (c) Addison-Wesley, 19...
Numberartificial/workflow
snipets/src/Craft/Chapter15/MakeTree.hs
mit
1,891
0
10
691
402
228
174
24
1
{- Copyright 2019 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicab...
alphalambda/codeworld
codeworld-compiler/test/testcases/varlessPattern/source.hs
apache-2.0
648
0
6
124
23
12
11
2
1
-- | Parallel Arrays. --- -- Parallel arrays use a fixed generic representation. All data stored in -- them is converted to the generic representation, and we have a small -- number of operators that work on arrays of these generic types. -- -- Representation types include Ints, Floats, Tuples and Sums, so arr...
mainland/dph
dph-lifted-copy/Data/Array/Parallel/PArray.hs
bsd-3-clause
7,497
0
11
1,739
1,192
700
492
98
1
-- | Unsafe coerce. module Unsafe.Coerce where import FFI unsafeCoerce :: a -> b unsafeCoerce = ffi "%1"
beni55/fay
fay-base/src/Unsafe/Coerce.hs
bsd-3-clause
108
0
5
21
27
16
11
4
1
module Network.MPD.Applicative ( Command , runCommand -- * Querying MPD's status , module Network.MPD.Applicative.Status -- * Playback options , module Network.MPD.Applicative.PlaybackOptions -- * Controlling playback , module Network.MPD.Applicative.PlaybackControl -- * The current playlist , module Network.MPD....
matthewleon/libmpd-haskell
src/Network/MPD/Applicative.hs
mit
1,428
0
5
134
214
159
55
28
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module HERMIT.Dictionary.Induction ( -- * Induction externals , caseSplitOnR ) where import Control.Arrow import Control.Monad import Data.String import HERMIT.Context import HE...
ku-fpg/hermit
src/HERMIT/Dictionary/Induction.hs
bsd-2-clause
2,691
0
25
664
697
360
337
52
3
{- | Module : $Id$ Description : shared ATerm conversion instances Copyright : (c) Christian Maeder and Uni Bremen 2005-2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : provisional Portability : non-portable (existential types) This folder provides...
mariefarrell/Hets
ATC.hs
gpl-2.0
594
0
2
105
5
4
1
1
0