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 DeriveDataTypeable #-} module DrupalNodeTaxonomy where import qualified Text.JSON.Generic as JSON data DrupalNodeTaxonomy = DrupalNodeTaxonomy { tid :: String } deriving (Show, JSON.Data, JSON.Typeable) data DrupalNodeTaxonomyRelation = DrupalNodeTaxonomyRelation { und :: [DrupalNodeTax...
shaan7/ghost-drupal-import
DrupalNodeTaxonomy.hs
gpl-2.0
375
0
9
62
85
51
34
9
0
{- teafree, a Haskell utility for tea addicts Copyright (C) 2013 Fabien Dubosson <fabien.dubosson@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of t...
StreakyCobra/teafree
src/Teafree/Interaction/PPrint.hs
gpl-3.0
1,665
0
10
397
319
166
153
24
1
module Infsabot.Board.Logic ( Board(Board), boardContents, boardRobots, boardSize, boardTime, (!!!), setRobot, robotAt, updateSpot, robotAlongPath, inBoard, listOfRobots, startingBoard, GameSpot(GameSpot), toSeenSpot ) where import Data.Vector(Vector, (!)...
kavigupta/Infsabot
Infsabot/Board/Logic.hs
gpl-3.0
4,988
0
16
1,316
1,469
808
661
-1
-1
module Main where import System.Exit import System.Console.GetOpt import Data.Time.Clock.POSIX import Data.List import Network import Verbosity import HostPortStatus import CheckOpen import Flags main :: IO () main = do whenLoud $ putStrLn "Hello world." (flags, _, _) <- processOptions let timeout = flag...
waterret/PortScan-haskell
src/Main.hs
gpl-3.0
1,366
0
13
341
369
186
183
41
3
{-# LANGUAGE GADTs #-} {-# LANGUAGE TypeSynonymInstances #-} module SgFrontendTest where import Control.Monad import Control.Monad.State import Data.HList data Draw = Draw newtype Resource a = Resource a class Attrib a instance Attrib (Resource a) instance Attrib a => Attrib [a] data RenderState = A ...
haraldsteinlechner/lambdaWolf
SgFrontendTest.hs
gpl-3.0
1,572
0
9
542
285
163
122
-1
-1
module Model.Types( TransformationMatrix , TransformationVector , Translation , Rotation , Scale , ColorRGB , GLfloat , GLint , GLuint ) where import ...
halvorgb/AO2D
src/Model/Types.hs
gpl-3.0
610
0
6
264
113
68
45
17
0
module Pictikz.Output.Tikz where import Data.Maybe class Drawable a where draw :: a -> String node style (x,y) name alignment label = concat $ [ "\\node" , "[" ++ csl style ++ "]" , "(" ++ name ++ ")" , " at " , "(" ++ show x ++ ", " ++ show y ++ ") " , "[ align=" ++ alignment ++"]" , "{" ++ label ++...
mgmillani/pictikz
src/Pictikz/Output/Tikz.hs
gpl-3.0
792
0
12
222
345
182
163
29
1
{-# LANGUAGE OverloadedStrings , LambdaCase , RecordWildCards #-} module Glyph ( Glyph(..) , parseKvg , renderXhtml , glyphName ) where import Control.Applicative ((<$>)) import Control.DeepSeq (force, NFData(..)) import Data.Generics.Aliases (orElse) import Data.Li...
mkovacs/kanjibrowse
src/main/Glyph.hs
gpl-3.0
5,319
0
18
1,181
1,834
956
878
130
4
module Lambda.Types.TestEither where import Prelude hiding (succ, pred, sum) import Test.HUnit import Lambda.Variable import Lambda.Engine import Lambda.Types.Either import Lambda.Types.Bool import Lambda.Types.Int import Lambda.Types.Pair tests :: Test tests = test [ assertEqual "Test reveal inl...
fpoli/lambda
test/Lambda/Types/TestEither.hs
gpl-3.0
1,648
0
17
614
428
224
204
46
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Speech.Types -- Copyright : (c) 2015-2016 Brendan Hay ...
brendanhay/gogol
gogol-speech/gen/Network/Google/Speech/Types.hs
mpl-2.0
2,692
0
7
620
267
185
82
71
1
module Pr32 (g) where -- g 25 16 -> 4 g :: Int -> Int -> Int g 0 n = n g n 0 = n g a b = let x = max a b y = min a b in g (x-y) y
ekalosak/haskell-practice
Pr32.hs
lgpl-3.0
163
0
9
79
91
47
44
9
1
module Main where import Test.Framework (defaultMain) -- Util tests import qualified Network.Haskoin.Util.Tests (tests) -- Crypto tests import qualified Network.Haskoin.Crypto.BigWord.Tests (tests) import qualified Network.Haskoin.Crypto.Point.Tests (tests) import qualified Network.Haskoin.Crypto.ECDSA.Tests (tests)...
nuttycom/haskoin
tests/Main.hs
unlicense
2,854
0
31
320
614
426
188
54
1
module Main where import Control.DeepSeq import Criterion.Main main :: IO () main = defaultMain [ ]
erochest/barth-scrape
benchmark/BenchAll.hs
apache-2.0
133
0
6
49
34
19
15
6
1
{- Copyright 2016, Dominic Orchard, Andrew Rice, Mistral Contrastin, Matthew Danish 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 ...
dorchard/camfort
src/Camfort/Output.hs
apache-2.0
10,706
15
20
3,088
2,862
1,502
1,360
182
6
-- 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/BootUser.hs
apache-2.0
696
0
6
125
38
29
9
4
0
-- 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/cabal2bazel
bzl/tests/ffi/TemplateHaskellBaseTest.hs
apache-2.0
874
0
9
149
102
64
38
9
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} module HERMIT.External ( -- * Externals External , ExternalName , ExternalHelp , e...
beni55/hermit
src/HERMIT/External.hs
bsd-2-clause
18,532
39
22
4,515
3,635
2,101
1,534
315
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} module Harihara.Log where import Control.Applicative ((<$>)) import Control.Exception import Control.Monad (when) import Data.List as L import Data.Text as T import Data.Typeable -- Exceptions {{{ data LastfmException = NoResponse | JSONPars...
kylcarte/harihara
src/Harihara/Log.hs
bsd-3-clause
2,561
0
16
569
912
481
431
74
5
module Day10 where import Test.Hspec import qualified Text.Megaparsec.String as P import qualified Text.Megaparsec as P import qualified Data.Map as Map import Data.Map (Map) import Data.List import Debug.Trace import Utils -- Parsing parser = parseLine `P.sepBy` (P.string "\n") parseLine = (GiveR <$> parseGive...
guibou/AdventOfCode2016
src/Day10.hs
bsd-3-clause
4,346
0
18
1,327
1,409
753
656
81
3
module Adt03 ( ) where data Expression = Var String -- Variable | Val Int -- Integer literal | Op Expression Bop Expression -- Operation deriving (Show, Eq) -- Binary (2-input) operators data Bop = Plus | Minus | Times | Divide | Gt | Ge | Lt | L...
Enzo-Liu/cis194
src/Adt03.hs
bsd-3-clause
4,975
0
19
1,974
1,505
785
720
105
10
module Math.Modular where import Data.Ratio import GHC.Real class Num a => Euclidean a where eDivMod :: a -> a -> (a, a) eDiv :: a -> a -> a eMod :: a -> a -> a eDiv x y = fst (eDivMod x y) eMod x y = snd (eDivMod x y) eDivMod x y = (eDiv x y, eMod x y) instance Euclidean Word where eDiv...
bhamrick/hsmath
Math/Modular.hs
bsd-3-clause
1,535
0
12
493
711
380
331
42
2
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving, RecordWildCards #-} module Test.WebDriver.Session( -- * WDSessionState class WDSessionState(..), modifySession -- ** WebDriver sessions , WDSession(..), lastHTTPRequest, Sessi...
begriffs/hs-webdriver
src/Test/WebDriver/Session.hs
bsd-3-clause
4,876
0
14
1,441
887
509
378
69
1
{-# LANGUAGE ForeignFunctionInterface, CPP #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.ShaderAtomicCounters -- Copyright : (c) Sven Panne 2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com>...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/ShaderAtomicCounters.hs
bsd-3-clause
5,395
0
13
446
495
310
185
-1
-1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} module Node.HCP.Eddy ( rules , EddyUnwarpedImages (..) ) where import qualified FSL import qualified Node.HCP.Normalize as N import qualified Node.HCP.Preprocessing as Preprocessing import qualified Node....
reckbo/ppl
pipeline-lib/Node/HCP/Eddy.hs
bsd-3-clause
2,026
0
17
590
563
310
253
39
1
{-# LANGUAGE NoImplicitPrelude #-} module Utils ( showTrace , listDiff ) where import BasePrelude showTrace :: (Show a) => a -> a showTrace = trace =<< show -- assume these are sorted listDiff :: (Ord a) => [a] -> [a] -> ([a], [a]) listDiff = listDiff' ([], []) where listDiff' a []...
isovector/iwmag
src/Utils.hs
bsd-3-clause
601
0
10
186
294
163
131
15
4
module TotalProject where import Data {- infer :: Name -> Project -> TotalProject' infer name proj = case proj of CD c d as -> TotalProject' (makeCycle c as) (makeDur d as) (makeEndpoint (inferEndpointCD c d)) (makeTotaltime (inferTotaltimeD d)) (addOns' as) CD' c d' as -> TotalProject'...
Luizss/TheSystem
src/TotalProject.hs
bsd-3-clause
4,061
0
3
1,187
8
6
2
2
0
{-# LANGUAGE FlexibleInstances, TypeFamilies #-} module QueryArrow.FileSystem.Connection where import Control.Monad.Free import Control.Monad.Trans.State import Control.Monad.Trans.Reader import QueryArrow.DB.DB import QueryArrow.DB.GenericDatabase import QueryArrow.DB.NoConnection import QueryArrow.FileSystem.Query...
xu-hao/QueryArrow
QueryArrow-db-filesystem/src/QueryArrow/FileSystem/Connection.hs
bsd-3-clause
822
0
12
96
182
102
80
16
0
module Feature.DeleteSpec where import Test.Hspec import Test.Hspec.Wai import Text.Heredoc import Network.HTTP.Types import Network.Wai (Application) import Protolude hiding (get) spec :: SpecWith Application spec = describe "Deleting" $ do context "existing record" $ do it "succeeds with 204 and delet...
Skyfold/postgrest
test/Feature/DeleteSpec.hs
mit
2,507
0
18
651
510
288
222
-1
-1
{-# LANGUAGE TypeApplications #-} module Tests.ColorSchemes (test) where import qualified Control.Lens as Lens import qualified Control.Monad.Trans.FastWriter as Writer import Data.Aeson.Config (load) import Data.Data.Lens (template) import qualified Data.Map as Map import GUI.Momentu.Dra...
lamdu/lamdu
test/Tests/ColorSchemes.hs
gpl-3.0
2,016
0
16
624
657
360
297
47
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TupleSections #-...
deepfire/mood
experiments/apex/Main.hs
agpl-3.0
1,335
4
8
301
331
174
157
40
1
{-# LANGUAGE FlexibleContexts #-} module BDCS.Export.Customize(CSOverlay, Customization(..), addToOverlay, filesToObjectsC, runCustomizations) where import qualified Control.Exception.Lifted as CEL imp...
atodorov/bdcs
src/BDCS/Export/Customize.hs
lgpl-2.1
3,498
0
18
856
871
486
385
-1
-1
module Data.Interned.String ( InternedString(internedStringId) ) where import Data.Interned.Internal.String
greydot/intern
Data/Interned/String.hs
bsd-3-clause
113
0
5
13
23
16
7
5
0
{- Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com> This file is part of Aura. Aura is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later ve...
joehillen/aura
src/Aura/Pkgbuild/Base.hs
gpl-3.0
2,137
0
12
427
371
204
167
34
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="zh-CN"> <title>Browser View | ZAP Extension</title> <maps> <homeID>top</homeID> <mapre...
0xkasun/security-tools
src/org/zaproxy/zap/extension/browserView/resources/help_zh_CN/helpset_zh_CN.hs
apache-2.0
974
82
65
160
413
209
204
-1
-1
-- %************************************************************************ -- %* * -- The known-key names for Template Haskell -- %* * -- %**********************************...
vikraman/ghc
compiler/prelude/THNames.hs
bsd-3-clause
45,377
0
8
9,400
8,146
4,728
3,418
755
1
-- (c) The University of Glasgow 2002-2006 {-# LANGUAGE CPP, RankNTypes #-} module IfaceEnv ( newGlobalBinder, newInteractiveBinder, externaliseName, lookupIfaceTop, lookupOrig, lookupOrigNameCache, extendNameCache, newIfaceName, newIfaceNames, extendIfaceIdEnv, extendI...
ezyang/ghc
compiler/iface/IfaceEnv.hs
bsd-3-clause
10,522
0
21
3,334
2,063
1,109
954
154
2
{-# LANGUAGE OverloadedStrings #-} {- This example demonstrates an ability to stream in constant space content from a remote resource into an S3 object accessible publicly -} import qualified Aws import Aws.Aws (Configuration (..)) import qualified Aws.S3 as S3 import C...
romanb/aws
Examples/MultipartTransfer.hs
bsd-3-clause
1,604
0
27
441
362
190
172
30
3
<?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="id-ID"> <title>Network Add-on</title> <maps> <homeID>addon.network</homeID> <mapref loc...
kingthorin/zap-extensions
addOns/network/src/main/javahelp/help_id_ID/helpset_id_ID.hs
apache-2.0
969
77
67
156
413
209
204
-1
-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="hu-HU"> <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_hu_HU/helpset_hu_HU.hs
apache-2.0
980
78
66
160
415
210
205
-1
-1
module LetIn1 where data Tree a = Leaf a | Branch (Tree a) (Tree a) fringe_global x = let fringe :: Tree a -> [a] fringe (Leaf x) = [x] fringe (Branch left@(Leaf b_1) right) = (fringe left) ++ (fringe right) ...
kmate/HaRe
old/testing/subIntroPattern/LetIn1_TokOut.hs
bsd-3-clause
570
0
14
277
198
102
96
12
4
{-# OPTIONS #-} ----------------------------------------------------------------------------- {- | Module : Numeric.GSL.Integration Copyright : (c) Alberto Ruiz 2006 License : GPL-style Maintainer : Alberto Ruiz (aruiz at um dot es) Stability : provisional Portability : uses ffi Numerical integrat...
mightymoose/liquidhaskell
benchmarks/hmatrix-0.15.0.1/lib/Numeric/GSL/Integration.hs
bsd-3-clause
7,068
0
14
1,890
1,405
700
705
-1
-1
-- | Our extended FCode monad. -- We add a mapping from names to CmmExpr, to support local variable names in -- the concrete C-- code. The unique supply of the underlying FCode monad -- is used to grab a new unique for each local variable. -- In C--, a local variable can be declared anywhere within a proc, -- and it...
oldmanmike/ghc
compiler/codeGen/StgCmmExtCode.hs
bsd-3-clause
7,447
0
15
1,941
1,899
1,012
887
144
3
{-# language PolyKinds #-} {-# language FlexibleContexts #-} {-# language ConstraintKinds #-} {-# language FlexibleInstances #-} {-# language FunctionalDependencies #-} import GHC.Exts (Constraint) class Ríki (p :: i -> i -> *) class (Ríki p) => Varpi p q f | f -> p q instance Varpi () () f => Varpi (->) (->) (Either...
ezyang/ghc
testsuite/tests/polykinds/T11516.hs
bsd-3-clause
332
0
9
59
107
59
48
-1
-1
module T12746 where import T12746A foo a = case a of Foo -> True _ -> False
ezyang/ghc
testsuite/tests/patsyn/should_compile/T12746.hs
bsd-3-clause
94
0
7
35
31
17
14
5
2
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, ForeignFunctionInterface #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.ConsoleHandler -- Copyright : (c) The University of Glasgow -- License : see libraries/base/LICENSE -- -- Maintainer : cvs-ghc@...
beni55/haste-compiler
libraries/ghc-7.8/base/GHC/ConsoleHandler.hs
bsd-3-clause
5,192
0
3
1,302
26
24
2
3
0
{-# LANGUAGE FlexibleContexts #-} module Futhark.Analysis.Usage ( usageInStm , usageInExp , usageInLambda , UsageInOp(..) ) where import Data.Monoid import qualified Data.Set as S import Futhark.Representation.AST import Futhark.Representation.AST.Attributes.Aliases import q...
ihc/futhark
src/Futhark/Analysis/Usage.hs
isc
2,107
0
14
573
679
352
327
55
2
module CommandLine ( parseCommandLine , interpretGlobalOptions , defaultGlobalOptions ) where import ListExtras import ProgramInfo import System.Console.GetOpt data Flag = Verbose | Filename String | Output Stri...
fredmorcos/attic
projects/pet/archive/pet_haskell_20131209/CommandLine.hs
isc
2,371
0
13
875
645
360
285
47
4
module Days.Day6 ( day6 ) where import Days.Prelude part1 = const "" part2 = const "" day6 = Day { _parser = parser , _dayPart1 = part1 , _dayPart2 = part2 } where parser :: Parser () parser = pure ()
unknownloner/aoc2016
src/Days/Day6.hs
mit
228
0
8
68
79
45
34
12
1
{-# LANGUAGE DeriveLift#-} module System.Console.Docopt.Types where import Data.Char (isUpper) import Data.List (nub) import Data.Map (Map) import qualified Data.Map as M import Language.Haskell.TH.Syntax (Lift) -- * Usage expression Types type Name = String data Pattern a = Sequen...
docopt/docopt.hs
System/Console/Docopt/Types.hs
mit
3,776
0
10
1,340
736
420
316
72
6
module ActorPath where import Address data ActorPath = ActorPath { address :: Address , parent :: ActorPath , name :: String , (/) :: String -> ActorPath } -- TODO instance Show ActorPath where show a = show (parent a) ++ "/" ++ name a instance Eq ActorPath where p1 == p2 = ...
crdueck/actors
ActorPath.hs
mit
545
2
11
149
183
96
87
15
1
module Api.Users where -- Prelude. import ClassyPrelude hiding (hash) import Control.Lens import Data.Time (NominalDiffTime, addUTCTime) import Database.Persist (Entity(Entity)) -- Servant imports. import Servant import Servant.Auth.Server hidi...
jkachmar/servant-persistent-realworld
src/Api/Users.hs
mit
4,676
0
14
965
939
488
451
-1
-1
module WUnderground ( module WUnderground.Client , module WUnderground.Types ) where ------------------------------------------------------------------------------- import WUnderground.Client import WUnderground.Types -------------------------------------------------------------------------------
Soostone/wunderground
src/WUnderground.hs
mit
312
0
5
30
30
20
10
5
0
module Main where import System.Environment import System.Random import System.Console.ANSI import System.Timeout import System.IO import Control.Monad import Control.DeepSeq import Control.Applicative data Cell = Alive | Dead deriving Eq data World = World Int Int [Cell] instance Show Cell where show Alive...
GeorgiKhomeriki/MonadOfLife
life.hs
mit
3,318
3
15
893
1,172
593
579
77
2
{-# LANGUAGE PatternGuards #-} -- TODO: this should actually be reusable by being a package. -- And the parser should be an actual parser (ReadP? Whatever). -- -- Could be combined with Toxaris/filter-agda-dependency-graph, since it needs -- the output of this tool. import qualified Data.List as List import Control.A...
inc-lc/ilc-agda
GenerateEverythingIlc.hs
mit
4,747
0
13
905
912
483
429
83
2
{- | Module: Capnp.Pointer Description: Support for parsing/serializing capnproto pointers This module provides support for parsing and serializing capnproto pointers. This is a low-level module; most users will not need to call it directly. -} module Capnp.Pointer ( Ptr(..) , ElementSize(..) , EltSpec(..)...
zenhack/haskell-capnp
lib/Capnp/Pointer.hs
mit
5,860
0
12
1,469
960
527
433
112
5
{-# LANGUAGE MultiParamTypeClasses #-} module Y2017.M10.D25.Solution where {-- Today, we're going to divide the topic you chose into subtopics, and then optionally, view those subtopics as a graph, or retrieve articles in the subtopic by index (which also works in the graph-structure, too, but in this case the graph...
geophf/1HaskellADay
exercises/HAD/Y2017/M10/D25/Solution.hs
mit
7,634
0
16
1,415
1,330
713
617
80
2
module MPCH.MPD where import MPCH.Config (Config, host, password, port) import qualified Network.MPD as MPD mpd :: Config -> MPD.MPD a -> IO (MPD.Response a) mpd config action = MPD.withMPD_ h p $ doPw pw >> action where h = host config p = port config pw = password config ...
mineo/mpch
MPCH/MPD.hs
mit
358
0
10
101
136
72
64
9
1
module Euler.E47 where import Data.List (nub, isPrefixOf) import Euler.Lib (primeFactors) euler47 :: Int -> Int euler47 n = findSeq n $ validNums n findSeq :: Int -> [Int] -> Int findSeq _ [] = 0 findSeq n xs'@(x:xs) | ys `isPrefixOf` xs' = x | otherwise = findSeq n xs where ys = [ x .. x + n - ...
D4r1/project-euler
Euler/E47.hs
mit
531
2
9
136
253
134
119
17
1
module PreludeSpec where import Test.Hspec import Test.QuickCheck spec :: Spec spec = describe "composition" $ do let composed = (+10).(*2) simple x = (x * 2) + 10 it "should always return the same" $ property $ \x -> composed x == simple (x::Int)
zsedem/haskell-playground
human-prelude/test/PreludeSpec.hs
mit
294
1
13
90
106
57
49
10
1
{-# LANGUAGE RecordWildCards #-} {-| Module : Test.Problem.Instances.CNF.Builder.Internal Description : The tests for the Internal CNFBuilder module Copyright : (c) Andrew Burnett 2014-2015 Maintainer : andyburnett88@gmail.com Stability : experimental Portability : Unknown Exports the tests for the ...
aburnett88/HSat
tests-src/Test/Problem/Instances/CNF/Builder/Internal.hs
mit
7,860
0
15
1,920
1,753
912
841
183
2
{-# LANGUAGE ExistentialQuantification, FlexibleInstances, Rank2Types #-} ------------------------------------------------------------------------------ module Snap.Snaplet.Rest.Resource.Media ( -- * Type Media (..) , newMedia , newResponseMedia , newRequestMedia , newIntermediateMedia ...
zmthy/snaplet-rest
src/Snap/Snaplet/Rest/Resource/Media.hs
mit
8,726
0
15
1,502
1,935
1,055
880
123
1
{-# LANGUAGE OverloadedStrings, FlexibleInstances, TypeFamilies #-} {-# LANGUAGE DataKinds, TypeOperators, GADTs #-} module Haste.JQuery where import Haste hiding (AttrName) import Haste.Foreign import Data.Char import GHC.TypeLits newtype JQuery = JQuery JSAny fromJQuery :: JQuery -> JSAny fromJQuery (JQuery q) = q...
myuon/haste-jQuery
Haste/JQuery.hs
mit
21,524
0
12
4,226
8,101
4,071
4,030
441
1
{-# LANGUAGE OverloadedStrings #-} module Elm.Encoder ( toElmEncoderRef , toElmEncoderRefWith , toElmEncoderSource , toElmEncoderSourceWith ) where import Control.Monad.Reader import Data.Text import Elm.Common import Elm.Type import Formatting class HasEnco...
InfernalKnight/elm-export
src/Elm/Encoder.hs
epl-1.0
3,222
0
17
840
925
453
472
72
1
{- | Description : Hets shell (command interpreter) Copyright : (c) Otto-von-Guericke University of Magdeburg License : GPLv2 or higher, see LICENSE.txt Hets shell (command interpreter, call it with hets -I) that makes Hets scriptable -} module CMDL where
spechub/Hets
CMDL.hs
gpl-2.0
268
0
2
51
5
4
1
1
0
{-# LANGUAGE ScopedTypeVariables, LambdaCase #-} module Salsa20 where { import SeqIterate; import Util; import Data.Typeable(Typeable,cast); import Data.Bits(rotate,xor,Bits); import Data.List hiding (length, replicate,(!!)); -- import Control.Exception(assert); import qualified UserError as User; import Data.Word; imp...
kenta2/yescrypt
Salsa20.hs
gpl-3.0
5,153
0
21
907
2,099
1,160
939
92
2
import NormalEverything import ConcreteNormal.PreRenderable import Blender import Triangulation import SimplicialPartialQuotient import DisjointUnion tr = mkTriangulation 1 [ (0 ./ tABC, 0 ./ oDAB) ] spqwc = oneTetWithDefaultCoords tr show ntA' = standardCoordinates (0 ./ ntA) ntB' = standardCoordinates (0 ./ ntB...
DanielSchuessler/hstri
test_concreteNormal.hs
gpl-3.0
686
0
10
190
188
103
85
19
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-analytics/gen/Network/Google/Resource/Analytics/Management/ClientId/HashClientId.hs
mpl-2.0
3,312
0
13
689
312
192
120
54
1
module Main where import Text.JSON (fromFile) import System.Environment (getArgs) import System.IO (hPutStr, stderr) main :: IO () main = do args <- getArgs if null args then hPutStr stderr "json: expecting path to JSON file\n" else parse (head args) parse :: String -> IO () parse path = do ...
mharrys/json
cli/Main.hs
lgpl-2.1
425
0
10
113
150
75
75
16
2
{-# LANGUAGE OverloadedStrings #-} module AtomTable ( AtomTable , empty , fromList , add , merge , listNames , lookupByName , lookupByCode ) where import qualified Data.ByteString as B import Data.Int import Data.List as List import ETerm (AtomNo (..)) ...
kolmodin/herl
AtomTable.hs
apache-2.0
1,526
0
12
342
565
299
266
44
2
-- -- Minio Haskell SDK, (C) 2017 Minio, Inc. -- -- 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 ...
donatello/minio-hs
src/Network/Minio/PutObject.hs
apache-2.0
8,449
0
17
2,163
1,961
1,023
938
-1
-1
----------------------------------------------------------------------------- -- Copyright 2012 Microsoft Corporation. -- -- This is free software; you can redistribute it and/or modify it under the -- terms of the Apache License, Version 2.0. A copy of the License can be -- found in the file "license.txt" at the ...
lpeterse/koka
src/Core/BindingGroups.hs
apache-2.0
2,875
0
19
725
556
298
258
32
4
-- | -- Module : $Header$ -- Copyright : (c) 2013-2014 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ViewPatt...
TomMD/cryptol
src/Cryptol/Symbolic/BitVector.hs
bsd-3-clause
7,007
0
21
1,993
3,043
1,519
1,524
150
4
{-# OPTIONS_GHC -funbox-strict-fields #-} -- | -- Module : Control.Concurrent.NamedLock -- Copyright : (c) Thomas Schilling 2009 -- License : BSD-style -- -- Maintainer : nominolo@googlemail.com -- Stability : experimental -- Portability : portable -- -- This module implements \"named locks\". -- -- A ...
nominolo/named-lock
src/Control/Concurrent/NamedLock.hs
bsd-3-clause
4,252
0
21
1,069
627
330
297
42
2
{-# LANGUAGE RecordWildCards #-} module BV.Util(mod2, zero, mkConst, tConst, termExt, varToHaskell, termToHaskell, atomToHaskell, constSlice, constMul, constInvert, ...
termite2/bv
BV/Util.hs
bsd-3-clause
10,737
0
21
3,771
4,317
2,216
2,101
185
7
{-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Config -- Copyright : (c) David Himmelstrup 2005 -- License : BSD-like -- -- Maintainer : lemmih@gmail.com -- Stability : provisional -- Portability : po...
themoritz/cabal
cabal-install/Distribution/Client/Config.hs
bsd-3-clause
50,869
0
27
13,894
10,371
5,587
4,784
889
13
{-# LANGUAGE OverloadedStrings #-} module Test.Suggest where import Test.Common import Test.Import spec :: Spec spec = describe "Suggest" $ it "returns a search suggestion using the phrase suggester" $ withTestEnv $ do _ <- insertData let query = QueryMatchNoneQuery phraseSuggester = mkPh...
bitemyapp/bloodhound
tests/Test/Suggest.hs
bsd-3-clause
1,016
0
18
232
255
127
128
20
2
{-# LANGUAGE FlexibleInstances, UndecidableInstances, CPP, ViewPatterns, NondecreasingIndentation #-} #if __GLASGOW_HASKELL__ < 709 {-# LANGUAGE OverlappingInstances #-} {-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-} #endif -----------------------------------------------------------------...
goldfirere/glambda
src/Language/Glambda/Repl.hs
bsd-3-clause
6,627
0
22
1,692
1,751
897
854
159
3
{-# LANGUAGE DataKinds, DeriveGeneric, TypeApplications #-} module Test24 where -- Test case from #24, comments preserved import Optics.Core import Data.Generics.Product.Fields import Data.Generics.Product.Positions import GHC.Generics data Foo a b = Foo { x1 :: a, x2 :: b } deriving (Generic, Show) data Bar a b = ...
kcsongor/generic-lens
generic-optics/test/Test24.hs
bsd-3-clause
1,681
0
9
355
560
315
245
33
1
{-# LANGUAGE TemplateHaskell #-} module Mantle.Interface.TH where import Control.Monad import Control.Lens import Language.Haskell.TH import Language.Haskell.TH.Lens import Language.Haskell.TH.Build hiding (name) import Mantle.Interface appsT :: TypeQ -> [TypeQ] -> TypeQ appsT = foldl appT unTV (PlainTV t) = retur...
aninhumer/mantle
src/Mantle/Interface/TH.hs
bsd-3-clause
2,030
0
16
513
884
442
442
56
2
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ARB.BufferStorage -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabilit...
haskell-opengl/OpenGLRaw
src/Graphics/GL/ARB/BufferStorage.hs
bsd-3-clause
991
0
5
133
97
67
30
17
0
module Vulkan.Utils.ShaderQQ.Backend.Glslang ( GlslangError , GlslangWarning , processGlslangMessages ) where import qualified Data.ByteString.Lazy.Char8 as BSL import Data.List.Extra import System.FilePath type GlslangError = String type GlslangWarning = String processGlslangMessages ...
expipiplus1/vulkan
utils/src/Vulkan/Utils/ShaderQQ/Backend/Glslang.hs
bsd-3-clause
800
0
12
213
262
149
113
17
1
module Sprite.GL where import Graphics.UI.Gtk.OpenGL import Graphics.UI.Gtk import Graphics.Rendering.OpenGL import Control.Concurrent.STM import Control.Monad.Trans bootGL :: IO () bootGL = do -- Initialise the Gtk+ OpenGL extension -- (including reading various command line parameters) initGL depthFun...
paolino/sprites
Sprite/GL.hs
bsd-3-clause
2,284
17
17
524
668
328
340
56
1
module Main( main, emptyRepl ) where import SLISP.Core import SLISP.Data import SLISP.Repl import SLISP.Util.System(time) import System.Environment(getArgs) import System.Exit(exitFailure) import qualified Control.Exception as E(catch, SomeException) main :: IO () main = do getArgs >>= \args -> case args o...
ameingast/slisp
src/Main.hs
bsd-3-clause
859
0
14
172
344
180
164
27
6
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module Mud.UndeploySpec where import System.Exit import System.Posix.Process import Mud.Config (Config(..), defaultConfig) import Mud.History import Mud.Options import Mud.Undeploy import SpecHelpers spec :: Spec spec = do let parseConfigFiles = \case "si...
thoferon/mud
tests/Mud/UndeploySpec.hs
bsd-3-clause
5,078
0
23
1,729
1,228
660
568
-1
-1
{-# LANGUAGE OverloadedStrings #-} -- | Model for videos. module HL.Model.Videos (getHomeVideos) where import Data.Text (Text) -- | Get videos for the home page. getHomeVideos :: Monad m => m [(Text, Text, Text)] getHomeVideos = return vids -- | For now we manually encode them until I have time to think of a...
haskell-infra/hl
src/HL/Model/Videos.hs
bsd-3-clause
1,498
0
8
176
158
102
56
15
1
{-# LANGUAGE DataKinds, FlexibleContexts, TypeOperators #-} module Main where import Language.Hakaru.Syntax.Prelude import Language.Hakaru.CodeGen.Wrapper import Language.Hakaru.CodeGen.CodeGenMonad import Language.Hakaru.CodeGen.AST import Language.Hakaru.CodeGen.Pretty import Language.Haka...
zachsully/hkc-test
tests/haskell/bucketTests.hs
bsd-3-clause
3,620
0
17
796
1,426
742
684
86
1
module Util (binToInt, binToDouble) where import Genes binToInt::Chromosome->Int binToInt chromosome = binToInt' 0 base chromosome where base = 2^(length chromosome-1) binToInt'::Int->Int->Chromosome->Int binToInt' acc 0 [x] = acc+x binToInt' acc base (x:xs) = binToInt' (acc+x*base) newBase xs where newBase =...
Teaspot-Studio/bmstu-binary-genetics
src/Util.hs
mit
760
0
10
137
293
154
139
18
1
module NestedSampling.Model where -- Imports import Control.Monad.Primitive import System.Random.MWC -- A type for representing models. -- The type parameter defines the parameter space. data Model a = Model { modelFromPrior :: !(Gen RealWorld -> IO a), modelPertur...
jtobin/NestedSampling.hs
lib/NestedSampling/Model.hs
mit
442
0
14
144
95
55
40
13
0
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE QuasiQuotes, OverloadedStrings, RecordWildCards #-} module Language.Bond.Codegen.Cpp.Types_cpp (types_cpp) where import Data.Monoid import Prelude import...
chwarr/bond
compiler/src/Language/Bond/Codegen/Cpp/Types_cpp.hs
mit
3,368
0
11
891
232
147
85
-1
-1
{-# OPTIONS -fno-cse #-} {-# LANGUAGE NamedFieldPuns #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- GHC Driver -- -- (c) The University of Glasgow 2005 -- -----------------------------------------------------------------...
jwiegley/ghc-release
compiler/main/DriverPipeline.hs
gpl-3.0
97,270
0
31
34,012
15,987
8,071
7,916
-1
-1
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} module HollaBack.Types (Payload(..), EmailAddress, ParseError(..)) where import qualified Control.Exception as E import Control.Applicative ((<$>), (<*>)) import Data.Aeson (decode', ...
bitemyapp/HollaBack
HollaBack/Types.hs
bsd-2-clause
2,083
0
15
880
484
280
204
50
0
module Graphs.SearchCycles (searchCycles, cleanCycles) where {-- This module implements a cycle searcher. It works as a reference counting garbage collector --} import Utils.Utils hiding (get) import Control.Monad.State import Data.Map hiding (null, filter, map) import qualified Data.Map as M import Data.Set (Set) i...
pietervdvn/ALGT
src/Graphs/SearchCycles.hs
bsd-3-clause
2,569
106
13
568
964
516
448
52
2
-- auto update all packages maintained by arch-haskell that were -- built with cabal2arch older as asserted by oldCabal2Arch. -- -- generate the pkgbuild, upload it. -- import Distribution.ArchLinux.AUR import Distribution.ArchLinux.PkgBuild import Distribution.ArchLinux.Report import Data.Map as M hiding (update)...
remyoudompheng/archhaskell-web
scripts/needs-updates.hs
bsd-3-clause
1,578
2
22
543
337
166
171
34
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module Stackage.Test ( runTestSuites ) where import qualified Control.Concurrent as C import Control.Exception (Exception, SomeException, handle, throwIO, IOException, try) import C...
Tarrasch/stackage
Stackage/Test.hs
mit
11,872
0
21
3,931
3,189
1,619
1,570
250
5
{-# LANGUAGE ViewPatterns #-} {-# OPTIONS -fno-warn-name-shadowing #-} -- | Freenect example with GLUT, showing connection boundaries. -- Video demo here: http://www.youtube.com/watch?v=as2syH8Y8yc module Main where import Control.Concurrent import Control.Monad import Data.Bits imp...
chrisdone/freenect
examples/src/GlutBoundary.hs
bsd-3-clause
2,599
0
24
667
881
455
426
71
4
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell, DataKinds #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} -----------------------------...
mb21/qua-kit
services/examples-hs/src/Lib/Region.hs
mit
8,133
0
17
2,372
2,419
1,265
1,154
170
4
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Yi.Config.Default ( defaultConfig, availableFrontends, defaultEmacsConfig , defaultVimConfig, defaultCuaConfig, toVimStyleConfig , toEmacsStyleConfig, toCuaStyleConfig) where import ...
TOSPIO/yi
src/library/Yi/Config/Default.hs
gpl-2.0
10,365
0
16
3,657
1,938
1,136
802
196
2
{- $Id: AFRPTestsTask.hs,v 1.2 2003/11/10 21:28:58 antony Exp $ ****************************************************************************** * A F R P * * * * Module: ...
ony/Yampa-core
tests/AFRPTestsTask.hs
bsd-3-clause
7,676
47
18
2,590
2,700
1,426
1,274
151
2
module SubFun3 where --Any unused parameter to a definition can be removed. --In this example: remove x. The brackets enclosing 'foo' will also be removed. main :: IO Int main = do let foo x = h + t where (h,t) = head $ zip [1..10] [3..10] return $ (foo 4) + (foo 5)
RefactoringTools/HaRe
test/testdata/RmOneParameter/SubFun3.hs
bsd-3-clause
278
0
14
65
91
48
43
6
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE MultiWayIf #-} module TwinkleBear.Lesson05 (main) where import Prelude hiding (init) import Control.Applicative import Control.Monad import Data.Monoid import Foreign.C.Types import Linear ...
dalaing/sdl2
examples/twinklebear/Lesson05.hs
bsd-3-clause
3,456
0
30
983
1,085
544
541
77
10